-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Provide a way to pause syncing an application #4808
Comments
Isn't this basically achievable by just turning off auto sync? |
I think that autosync in my case is controlled by the parent application which means that if i try to turn it off, when the parent syncs, it's overridden, although i could be wrong. Certainly, if I try to change the branch of a child application then when the parent application syncs it overwrites the branch. |
Note:
|
I agree with @jannfis that this just sounds like auto-sync enabled/disabled.
Wouldn't you just have the same problem with a new pause field? |
It would have to not be something which is controlled by the versioned content -- a strict local overlay. |
Yes, it is but it is still useful to have a maintenance mode which just stops all syncing across the cluster. |
Exactly. Very interested in this feature too, as we have ArgoCD managed by itself and we have to go back to the root manifests and commit things to git whenever we need to temporarily disable |
I think the title of this question is misleading 😅 Seems related to #3039 and #2913 (comment) Current behavior Current workaround Problematic Expected behavior Config on parent app: apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: application-sync-parent
spec:
# ...
ignoreDifferences:
- group: argoproj.io
kind: Application
jsonPointers:
- /spec/syncPolicy/automated
syncPolicy:
automated:
prune: true
selfHeal: true Automated sync enabled by default on child app: apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: child-app
spec:
# ...
syncPolicy:
automated:
prune: true
selfHeal: true |
@agaudreault-jive wrote:
This will be addressed by https://blog.argoproj.io/new-sync-and-diff-strategies-in-argocd-44195d3f8b8c |
@jsoref @vikas027 @renaudguerin Have you considered maybe using sync-windows to achieve this disabling sync behavior?? |
@leoluz I havent, It seemed too hack-ish to use the sync windows as a process to disable the sync during emergencies. # Allow the Application sync behavior to be overwritten in ArgoCD UI or CLI
resource.customizations.ignoreDifferences.argoproj.io_Application: |
managedFieldsManagers:
- argocd-server
jsonPointers:
- /spec/syncPolicy/automated This seems like it could work, and it will be applied only for the automated fields |
Restarting this discussion because it needs to be implemented in ApplicationSet as well and it has now been merged in this repo. |
@agaudreault-jive : You mean to say pause syncing an application feature or presence of ignoreDifferences field is not implemented in appplicationset? and yaml mentioned in #542 quite works
|
pause syncing an application created/managed by an ApplicationSet. It actually does not and it is listed in the current limitations. The presence of the ignore difference in ApplicationSet is another limitation, but the implementation would be one way to fix this issues |
ohk got it sorry I overlooked actual issue and thought it as yaml deployment issue, looks like a must feature, although links mentions a limitation arises by design but I too feel it would be a good feature |
I have a use-case that I don't see mentioned yet. We have an automated build pipeline that will build, tag, and push docker images to a registry when code is merged into the main branch of our project. We also have an argocd image watcher process monitoring our registry for new image versions. When it finds one, it updates our deployment manifest image tag. This works well, and for our biggest project we'll manually sync changes a few times per day. Every now and then we'll have an issue flagged in staging, so we know that syncing the same image to production will introduce an issue. Suddenly it can be critical that no one manually syncs prod. The easiest way to resolve the problem is to push a fix and wait for a new image to build, but that can take upwards of 30 minutes. Today we're relying on communicating issues like these using slack, but that's not a great solution. It would be much more useful for us to be able to instead temporarily disable, or lock syncing for a project until the issue is resolved. |
@sondrelg I think that could be easily accomplished by configuring a blocking sync window in these cases. |
Am I correct in my interpretation here? It looks like using windows would mean we would first take a guess at how long it will take us to resolve the issue. We might say "let's freeze syncs for 30 minutes" and create a window with ~:
But then if our fix is delayed, we would need to "top up" the window by extending or recreating it, right? And If we do resolve it in the 30 minutes and someone decides to just let the window expire and not clean up the window, then tomorrow at 13:37 syncs will be blocked again for 30 minutes? Is that right? 🙇 |
I assume you can assign a deny-all window and then remover it later. Or you can assign multiple allow windows for the same effect? 😄 |
true, maybe a |
There are two real world experience I have seen where having a general "stopped" status, and the ability for easily managing that status, would be helpful.
Using windows is an option too. Maybe it would be helpful to expose the ability to toggle a cluster's "power state", and the underlying implementation in argoCD would be to create a deny window for the cluster on the cluster's app project? |
I think this issue has been resolved in #14743 If using the apps-of-apps pattern, the basic https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/#application-level-configuration can be used. @sondrelg & @mmerrill3, you are pointing out another use-case that differs from the initial issue. Can you check if a specific issue for this use-case of suspending a cluster already exists, and if not, create a new issue? Thanks |
My use-case was solved above, so no worries 👍 Thanks for the help! |
Summary
Provide a way to pause syncing an application
Motivation
I have an application which is broken. I can delete the application in argocd and then argocd will recreate it. Currently that just recreates it in its broken state. I'd like to be able to tell argocd to "pause" its syncs for this application, let me delete the application, and then after I fix the underlying state (possibly by deleting some PVCs), I would then "unpause" it and let argocd recreate the application properly.
Proposal
An option in app details?
The text was updated successfully, but these errors were encountered: