which one to choose between ( PVC & ConfigMap )

11/28/2018

since this morning i've a question in my mind. What is the best things to manage file configuration on kubernetes!

For the moment we use PVC & PV

But i would want to update automatically during the CI pipeline the config files . For one application we have almost 10 configs files

How can i update it automatically with kubernetes ? Or do you think i will have to change for configMap ?

I still reading the documentation on internet but i dont find an answear to my question :(

Thanks

-- morla
kubernetes
kubernetes-helm
kubernetes-pvc

1 Answer

11/28/2018

If it is configuration then a ConfigMap fits. You can update the ConfigMap resource descriptor file as part of your CI pipeline and then apply that change with 'kubectl apply' and you can do a rolling update on your app. This moves you in the direction of every config change being a tracked and versioned change.

You may also want to look at Secrets, depending on how sensitive your config is.

I guess you will have the same number of files whether in a PV or a ConfigMap - the choice only affects how they are made available to the app in Kubernetes. But if you find your CI pipelines are doing a lot of replacements then a templating system could help. I'd suggest looking at helm so that you can pass parameters into your deployments at the time of deploy.

-- Ryan Dawson
Source: StackOverflow