-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 CRDs created by controllers #2873
Comments
@torstenwalter I just came across this issue now deploying |
@saviogl The only workaround I see is to either deploy ConstraintTeamplate and Constraint seperately (different commits, wait until the first one is synced) or manually sync the ConstraintTeamplate... For anything better a patch to Argo CD would be needed I guess. |
@torstenwalter Yeah, that's pretty much what I ended up having to do indeed. Have you heard back through other channels from the maintainers around this enhancement submission? |
could adding wave to the template can help? |
I tried this. Same error. Argo CD claims that the sync task is invalid. |
No. |
I think that the fix should be that the sync check each wve separately - this way it will be the same as two commits. |
That makes sense, but then the check needs to happen before each wave to be able to take resources into account which have been created by a previous wave. A more simplistic approach could be to have an annotation on the resource to tell Argo CD that it should not fail if the resource type does not exist. |
To support CRDs created by k8s controller in one commit, we would like to introduce the following enhancement to ArgoCD:
Any feedback is appreciated. |
Summary
Argo CD should support deploying CRDs and manifests using the CRD instances in one commit even if the CRD manifest is not stored in version control, but another resource which takes care of creating the CRD.
Motivation
We are using Gatekeeper - Policy Controller for Kubernetes and want to deploy Constraint Templates and Constraints together.
I am quoting the examples from their documentation here:
If you commit both files together and Argo CD tries to sync them together then the sync status is
the server could not find the requested resource
.The issue is that kind
K8sRequiredLabels
does not exist. There is also no CRD with that spec.Actually that kind is created by the Gatekeeper controller which reacts to the
ConstraintTemplate
.Of course one need to wait until the controller created that resource, but this would be possible by implementing a health check and putting the
ConstraintTemplate
to a sync wave before theConstraint
.Would be great if Argo CD could support this. Current workaround is to commit the
ConstraintTemplate
first, sync it with Argo CD and then create theConstaint
.Proposal
One option would be to allow to ignore non existing resources in
dry-run
. This could be enabled via a configuration parameter or be the default.This is how it could look like:
https://github.com/argoproj/argo-cd/blob/master/controller/sync.go#L475-L477
The text was updated successfully, but these errors were encountered: