-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Allow interpolation of variables from generators in ApplicationSet SyncPolicy #13190
Comments
This feature #11567 would solve it. Looks targeted for release 2.7.0 |
Maybe I am missing some understanding of this feature #11567 but I don't think that is solving what I am trying to achieve Here is an example of what I had in mind with a list generator apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: my-clusters
spec:
generators:
- list:
elements:
- cluster: prod
preserveResources: true
- cluster: dev
preserveResources: false
syncPolicy:
preserveResourcesOnDeletion: {{preserveResources}}
template:
metadata:
name: '{{cluster}}'
spec:
source:
path: '{{cluster}}'
repoURL: https://<my-git-repository>.git
destination:
name: '{{cluster}}' and with a cluster generator apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: my-clusters
spec:
generators:
- clusters: {}
syncPolicy:
preserveResourcesOnDeletion: '{{metadata.annotations.preserve-resources}}'
template:
metadata:
name: '{{name}}'
spec:
source:
path: '{{name}}'
repoURL: https://<my-git-repository>.git
destination:
name: '{{name}}' If that is indeed covered by the issue mentioned, I'll be glad to close this and wait for the 2.7.0 release |
This should be fixed with #14893, feel free to reopen if that's not the case |
Hey @blakepettersson |
Summary
We would like to have the ability to use variables inside the
syncPolicy
field of an applicationSet, based on the values of the cluster generator.Motivation
We are using argocd to bootstrap kubernetes clusters, meaning that we use the cluster registration in the secret to trigger the automatic creation of applications in order to deploy the helm charts that we need in the cluster.
We are using the cluster generator and it works very well like this:
However, we encounter an issue that is the applicationSet
syncPolicy
is not able to interpolate variables from the generator (especially thepreserveResourcesOnDeletion
field). We would like to be able to have the ability ,from the cluster generator labels, to set this field to true or false, according to the context of the cluster (set it to true for prod for example in case of an issue with our argocd instance).Proposal
I have seen that it is possible to interpolate variables outside of the template field in this pull request #9254 and wonder if the same kind of things could be done for the syncPolicy field.
The text was updated successfully, but these errors were encountered: