-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Behavior of creating Argo Application thru API (crossplane) vs. Kubectl Apply #20580
Comments
So, is there an option to make the API behave like kubectl apply? I guess a fallback could be to use the kubernetes provider in crossplane to submit the app instead of using the crossplane provider which interacts with the argocd-server.. |
I'm not sure why this is an issue with Argo CD. IMO that sounds more like an issue with the Argo CD Provider. |
ill double check if it actually hammers or its just the UI making it look it is repeatedly calling the API (the resource keeps getting the square animation around it). If the provider doesnt exponentially requeue, I will log it on the provider. In any case, I am more curious about the API vs. kubectl apply behavior for the App creation and if there is a way to have similar behavior....before i commit to using the |
Update, it is indeed hammering (2-3x per second). I also see that the provider is issueing a list command which is causing a panic
|
if you use the cli command with a path that doesn't exist, it gives you the same error message. I think the expectation is to create the app but leave it in not synced state, similar to behaviour when you create the app using a manifest
|
Thanks reza for confirming my thought that the API is more stringent than kubectl apply. I am curious to know if theres a way to interact with the API to behave like kubectl. If there arent, then crossplane argocd provider wont be able to help with the outcome i seek. I mean the hammering behavior does need addressing. im going to accelerate plan B and try with kubernetes provider. While waiting to see if an alternative setting i am not aware of exists |
That part I understand. I think the issue is that when submitting to the K8s API, K8s doesn't do any validation of the object other than that it adheres to the given CRD. The validation of the application happens async, when the application-controller picks up the application from k8s. With the CLI, by default the object will be validated by the Argo CD API. With the CLI this should be able to be worked around by using
In order for the Argo CD Crossplane Provider to provide the same behavior, it would need to pass |
That one is likely caused by the Argo CD Provider having a really old version of Argo CD bundled with it. crossplane-contrib/provider-argocd#210 hopefully fixes that. |
Is this the same as the syncOptions below or something different with same name? ( i have the syncOption defined as such) syncOptions:
- Validate=false |
Not exactly - they do the same thing but for different objects. |
Thanks Blake. I found the details in the ArgoCD api reference as well. I will close this ticket since ArgoCD exposes the flag, the crossplane-provider does not make it available. I will continue chasing on that side. |
Checklist:
argocd version
.Describe the bug
We are using crossplane to deploy/register applications against ArgoCD instances. When deploying through the API, we find that it is more strict than doing a kubectl apply with an equivalent manifest.
To Reproduce
YAML submitted by kubectl
Equivalent resource from crossplane, the application never gets accepted and returns an error and seen as status. The issue with that is crossplane now HAMMERS the argocd API trying to recreate it because it was not accepted.
Expected behavior
When submitting the app through the API (ie thru crossplane), we expect the application to be accepted and end up in
Unknown
status while the contents in the folder get populatedScreenshots
Proof kubectl accepts the manifest
Perspective on the Crossplane managed resource:
Version
Paste the output from `argocd version` here. argocd: v2.12.3+6b9cd82 BuildDate: 2024-08-27T15:30:40Z GitCommit: 6b9cd828c6e9807398869ad5ac44efd2c28422d6 GitTreeState: clean GoVersion: go1.23.0 Compiler: gc Platform: linux/amd64 argocd-server: v2.12.3+6b9cd82 BuildDate: 2024-08-27T15:30:40Z GitCommit: 6b9cd828c6e9807398869ad5ac44efd2c28422d6 GitTreeState: clean GoVersion: go1.23.0 Compiler: gc Platform: linux/amd64 Kustomize Version: v5.4.3 2024-07-19T16:34:19Z Helm Version: v3.16.1+g5a5449d Kubectl Version: v0.29.6 Jsonnet Version: v0.20.0
Logs
from ArgoCD server
The text was updated successfully, but these errors were encountered: