Kubernetes Image Configuration in ConfigMap
I have a Backend service that deploys to Kubernetes. Whenever I want to deploy, I build a docker image, drag it to the google docker registry with a tag (for example 1.1.0
) and update the yaml for deployment.
However, updating that file and making another commit is a PITA. Especially since I have a production and staging environment (actually 2 namespaces) I recently learned about ConfigMaps in Kubernetes.
So, I would like to know if it is possible to store the value in ConfigMap with an image tag and use it? I haven't found a way yet.
Are there any good alternatives so I don't need to store the current version information in git? What's the best practice here? Using the tag latest
, I think it is not.
I want my CI to do deployment whenever I hit wizard or develop (I'm using gitlab CI), so any approach that's easy to do on the command line without a lot sed
would be appreciated.
source to share