Comments (8)
Spoke with @alexmt. auto-sync based on a difference from a tracking branch and live state, is not yet implemented.
This should be a new field in the ApplicationCRD. I propose something like:
syncPolicy: Always
from argo-cd.
This needs more thought. A string is too simplistic. We probably need more knobs. e.g.
syncPolicy:
always:
frequency: 5m
retry: false
from argo-cd.
@jessesuen, unless we expect to have other keys under syncPolicy
, I'm not convinced it's as semantically useful to nest under always
. Maybe promoting the frequency and retry directives up a level would help simplify configuration, something like:
sync:
policy: Always
frequency: 5m
retry: false
from argo-cd.
The keyword sync
will be too generic. For example, I already anticipate a need for a syncStrategy
. Today, our only sync strategy is kubectl apply
. However in the future, we will support a workflow based sync, or perhaps kubectl replace
.
The reason I proposed this structure:
syncPolicy:
always:
frequency: 5m
retry: false
Is because this nesting of data-structures as types, is a common API pattern in k8s (volumes is a good example). deploymentspec also use RollingUpdate type, with the anticipation of different update strategies in the future. There is a good reason for this: not all the options may be applicable to all policies. My example is probably not the best, because frequency and retry might be something applicable to all policies and we would likely promote it higher, but you could imagine something like:
syncPolicy:
workflow:
path: guestbook/workflows/blue-green.yaml
parameters:
- name: foo
value: bar
In the above case, path, and parameters only apply to the workflow sync policy, and we would not want to pollute the syncPolicy datastructure with those fields.
from argo-cd.
Revisiting this based on recent discussions:
Considerations:
- how do we prevent unnecessary syncs? e.g. we need to record that we already attempted to sync to a revision.
- what happens if there is a very active repo? e.g. user's code repo shared with deployment repo
- how does auto-sync play nicely with parameter overrides?
- how does auto-sync play with rollback? (i think rollback action needs to be disabled)
from argo-cd.
One more consideration I would bring up:
- Do we have an option to enable or disable
prune
on auto-sync?
from argo-cd.
@marioduarte thanks for the feedback. For the implementation for configuring automated sync, I have added an option to disable pruning. Default behavior will be to prune. Current proposal for the spec is:
spec:
destination:
namespace: asdf
server: https://localhost:6443
project: default
source:
path: kustomize-guestbook/base
repoURL: https://github.com/jessesuen/argocd-example-apps.git
syncPolicy:
automated:
disablePrune: true
This is how you would configure it with pruning:
spec:
destination:
namespace: asdf
server: https://localhost:6443
project: default
source:
path: kustomize-guestbook/base
repoURL: https://github.com/jessesuen/argocd-example-apps.git
syncPolicy:
automated: {}
from argo-cd.
On second thought, I think it will be safer to make automatic pruning behavior opt-in. The default will be off:
spec:
destination:
namespace: asdf
server: https://localhost:6443
project: default
source:
path: kustomize-guestbook/base
repoURL: https://github.com/jessesuen/argocd-example-apps.git
syncPolicy:
automated: {}
and to enable automatic pruning:
spec:
destination:
namespace: asdf
server: https://localhost:6443
project: default
source:
path: kustomize-guestbook/base
repoURL: https://github.com/jessesuen/argocd-example-apps.git
syncPolicy:
automated:
prune: true
from argo-cd.
Related Issues (20)
- The Argo CD Application resource cannot retrieve the server address information of the deployment cluster.
- hydrator: support project-scoped write credentials
- "the server is currently unable to handle the request" - after AKS upgrade
- hydrator(ui): refresh revision metadata in hydrator panel
- hydrator(ui): show hydration status in applications list
- The ArgoCD v2.12.0 doesn't work with tag tracking HOT 7
- Argocd Panics with invalid cluster secret HOT 2
- hydrator: enable pushing for SSH creds HOT 3
- Allow to exclude specific resources from diff targets HOT 3
- Argo CD Release v2.13
- Floating view toolbar covers cloud and first two resource boxes in Network View
- argocd app diff fails to render when templating CRDs
- Support prompt for certain argocd cmd commands
- ApplicationSet rolling sync stuck in ArgoCD 2.12
- UI error: Cannot read properties of null (reading 'appsInAnyNamespaceEnabled') HOT 1
- OpenKruise Daemonset sync blocked by healthy check HOT 1
- PR got check failed and blocked by License Compliance check HOT 3
- Expose info about the argocd instnace in the clusters/namespaces it manages
- "ghost" env var HOT 2
- Add additional websocket tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argo-cd.