Kubernetes best practice: different config for local or remote

4/25/2020

What is the best practice when one needs to have slightly different configs depending on whether it is being run locally or in the cloud?

For example say that locally (e.g. minikube) I need to create a secret and use it to authenticate.

But this authentication is not necessary when running in the cloud.

One obvious way to achieve this would be to have 2 different yaml files, but that really does not sound like a good idea. What is the best practice in such cases?

-- Al Wld
kubernetes

1 Answer

4/26/2020

Explore Kustomize which is a purely declarative approach and a template-free way to customize application configuration. You have a base config and then depending on environment you can create overlays to override the base config.

https://github.com/kubernetes-sigs/kustomize/tree/master/examples/helloWorld

-- Arghya Sadhu
Source: StackOverflow