-
Notifications
You must be signed in to change notification settings - Fork 882
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
Support triggering rollout when referenced ConfigMaps and/or Secrets change #958
Comments
A common technique to solving this is:
|
I would be interested in seeing first-class support for config changes in Argo Rollouts similar to how Flagger handles it. While I'm not fond of requiring the same config on basically every application, my main complaint with the status quo is the diff it generates. When using a hash to create a new configmap/secret for every change to it's contents, we're stuck with a useless Argo CD diff of the entire configmap/secret being added/removed. |
I've been thinking about this some more. I think the way I would solve this, is with a simple controller that monitors ConfigMaps and Secrets. These objects would be annotated to have back-references to a rollout (or even deployment) which would need to be redeployed upon change. For example: apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
annotations:
redeploy-on-update: rollout.argoproj.io/guestbook
data:
foo: bar The controller would continuously watch configmaps and secrets. When these objects are updated, it would inject a hash of the configmap into an annotation of the referenced rollout or deployment pod template. e.g.: apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: guestbook
spec:
template:
metadata:
annotations:
configmap.my-config.hash: abcd1234 Because of the change in the The beauty of this approach is that this controller could operate standalone, and would even work with Deployments. In other words, non-rollout users of Argo CD and Deployments would benefit from this. |
I just came across a project which took a slightly different but similar approach and already has built-in support for Argo Rollouts! Has anyone tried using reloader with Argo Rollouts? |
Looks like their implementation is tied to rollout releases: I think we should improve Rollout support in Reloader so that it is no longer tightly coupled to Rollout versions |
#958 (comment) I just tried skataker Reloader and it worked as billed: it ran a rolling update. I would much prefer a solution that triggers a rollout and goes through the configured update process. As an added bonus your proposal should result in a pleasant diff, which would be a major improvement over the configmap name with hash solution mentioned here #958 (comment). |
@jessesuen we have this same need....we're planning on file mounted configmaps for our needs, but need seamless roll fwd/back w/ argo rollouts, and the has option is super attractive to us. |
There is an issue with this approach when combined with ArgoCD with
Now there are several things can happen:
What do you think @jessesuen ? What is your suggestion to overcome this limitation/issue? Edit 1: After more investigation, found this argoproj/argo-cd#1629 which is exactly what I described above but the problem is not complete until this is done argoproj/argo-cd#1636 Edit 2: For anyone having the same question and need a workaround, this works for us now by adding these 2 annotations to the configmap generated by Kustomize or Helm
If you are using
Keep in mind that ArgoCD won't prune old ConfigMap(s) anymore and it will start to pile up if you change the ConfigMap a lot. But I guess once in a while, you can prune them manually or write an argocd hook job to clean them up when the sync is complete (= rollout is promoted) |
@tobernguyen have you tried PruneLast (on its own, without |
How this will work in the case that we abort the rollout? When we abort the rollout, will ArgoCD prune the old configmap because now the sync is complete, right? |
I would like to implement it |
Based on the description of how PruneLast works, I'd venture a guess that the old configmap is still present.
What I'd like to see is the addition of the Similar to
|
Since 2020, My method for that as i am using always Helm with Argocd:
|
Going to close this in favor of external tooling managing this such as https://github.com/stakater/Reloader as well as other tools like helm being able to do the same thing. |
Summary
Support for optionally triggering a rollout when one or more referenced ConfigMaps and/or Secrets change.
Use Cases
Deployments can often be config changes only. It would be useful if a rollout could optionally happen when underlying ConfigMaps and/or Secrets used by the Deployment (as volume mounts, environment vars) are changed.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.
The text was updated successfully, but these errors were encountered: