-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoreDNS Operator: Hash ConfigMap Name for RollingUpgrades #27
Comments
Hi @stealthybox: configMapGenerator:
- name: coredns
files:
- /etc/coredns/Corefile
commonAnnotations:
configHash: "" But I don't know how to use In case, I need to update version of coredns from 1.3.1 to 1.4.0. How should I do it? :-) Thanks :-) |
@stealthybox: ah, I should add kustomization.yaml file to channels/packages/coredns/, right? |
You can add the kustomization.yaml to that directory -- that can work. You'll need to change the way the manifests are applied inside of the operator code so that they use kustomize to process the YAML files. |
I appreciated your help on this issue. Do you think we should change something in https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/pkg/patterns/addon/pkg/loaders/fs.go#L49 with adding kustomize to process the YAML files or any advice? |
I think purely running The loader is the first step for the operator, it loads all of the manifests into memory, the next steps are to run various mutations on that manifest. If we rely on kustomize to hash the configmap name and it's done before the mutations are applied, then the operator may modify the configmap after it's been hashed/named. I think that would be confusing and easy to mess up. The configmap name hashing is probably the last (or one of the last) transforms you want to do on the manifest objects. If you wrote a transform to do this it could be added to the End chain. I think a broader kustomize integration could solve this but it requires some thought |
Hi @johnsonj, Thank you so much for your great suggestion. I'm making code following your idea and will push for review soon. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Hi guys, I will contribute it in GSCO 2020, Is it a hot update issue? is it that so? |
/remove-lifecycle rotten This issue should now be ready to be fixed via kubernetes-sigs/kubebuilder-declarative-pattern#66 - The remaining work should be to update the dependency and replace the (manifest)[https://github.com/kubernetes-sigs/cluster-addons/tree/master/coredns/channels/packages/coredns/1.3.1] with a kustomize manifest |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I believe this has been done with #50 /close |
@rajansandeep: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Feature to consider:
The operator could hash the configMap bytes and then update the name by appending the hash to it. The Deployment would then be updated to reference this new name.
This would allow the Deployment with multiple replicas to undergo a proper (and safe) RollingUpdate. (Changing the value of a ConfigMap is a common source of error for config rollouts)
Currently, we are just changing the value of the configmap and relying on the CoreDNS pods to use the
reload
plugin, but this could be optional.This mechanism is fully supported by kustomize's
configMapGenerator
should we integrate kustomize into the operator./kind feature
The text was updated successfully, but these errors were encountered: