3 ms·
Keep your db outside the cluster. Use a managed db or just host it on its own server. You should be doing that even if not using k8s anyway. Don’t share memory
by figassis 3y ago
Keep your db outside the cluster. Use a managed db or just host it on its own server. You should be doing that even if not using k8s anyway. Don’t share memory and cpu with your db.
Regarding storage, try to build stateless apps that only need temporary storage that don’t need to outlive a request (like uploads). For long lived unchanging assets, you can try including in the container (ie. defaults.json, countries.json, samples.json, etc). For assets that need to be fresh, try to have the app generate at startup (eg. Email vírus definitions) or via init container. I think this will cover most use cases.
This won’t work with apps that depend on shared storage like Wordpress, but Wordpress is horrible and I can’t support you running it :-)