Description
When deployments reference a ConfigMap or Secret they do get updated in place when a new blue/green rollout is triggered. This can already have unintended effects on the old deployment.
-
We could include ConfigMaps as a subsection of the spec, similar to ingress, so that the controller can transparently create and reference dedicated config maps per version (similar to
kustomize
that creates dedicated config maps for each overlay: https://github.com/kubernetes-sigs/kustomize/blob/37f03b4d018235d1a26dda1f031d374776b381a7/examples/ldap/base/kustomization.yaml#L4-L7) -
Alternatively, we could use
CDP_BUILD_VERSION
version as part of the ConfigMap's name and its reference in thepodTemplateSpec
. This would create a new ConfigMap for each rollout with immutable content. Old versions could be cleaned up by leveragingownerReference
from the Deployment to the ConfigMap, so that once the Stack is deleted the old ConfigMap gets cleaned up too. (Assuming ownerReferences work for ConfigMaps)
See https://github.bus.zalan.do/teapot/tokeninfo-router/pull/10/files for an example of a Deployment using a ConfigMap.