feat: Added support to expose ArgoCD instance URL#20327
feat: Added support to expose ArgoCD instance URL#20327rahulbollisetty wants to merge 13 commits intoargoproj:masterfrom
Conversation
…ources Signed-off-by: B Rahul <rahul20bollisetty@gmail.com>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: B Rahul <rahul20bollisetty@gmail.com>
Signed-off-by: B Rahul <rahul20bollisetty@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20327 +/- ##
=========================================
Coverage ? 55.08%
=========================================
Files ? 324
Lines ? 55227
Branches ? 0
=========================================
Hits ? 30422
Misses ? 22184
Partials ? 2621 ☔ View full report in Codecov by Sentry. |
Signed-off-by: B Rahul <rahul20bollisetty@gmail.com>
Signed-off-by: B Rahul <rahul20bollisetty@gmail.com>
reggie-k
left a comment
There was a problem hiding this comment.
I wonder whether we can make use of the AnnotationInstallationID introduced here:
#20222
It seems to tackle a slightly different but similar scenario of being able to know what instance of the multiple ArgoCDs in the cluster manages the resource.
Can this eliminate the need to specify the ArgoCD instance URL explicitly by the user?
Well that's a good addition for tracking the resources, but let's say you have multiple ArgoCD (~ 100 instance) instance, and you have access to a cluster, now you want to figure out which ArgoCD instance is managing a resource by looking at the manifest of the resource, it would be really difficult and not user-friendly to find out by just the |
|
Yeah, that makes sense to me, this PR is definitely a valuable addition, thank you for the implementation and for the explanation! I wonder whether there is an alternative to the user having to specify the URL explicitly? Like maybe some auto-calculation based on |
Getting the URL for an ArgoCD instance automatically is tricky because it depends on where and how it's deployed—locally or on a cloud platform like AWS EKS, GKE, or Azure AKS. For cloud deployments, you often need to manually find the LoadBalancer IP. Since there's no built-in way for ArgoCD to automatically grab the URL, you usually have to set it up manually based on your specific setup. |
| AnnotationInstallationID = "argocd.argoproj.io/installation-id" | ||
|
|
||
| // AnnotationKeyAppInstanceID is the Argo CD server URL that is managing this resource | ||
| AnnotationKeyAppInstanceID = "argocd.argoproj.io/instance-id" |
There was a problem hiding this comment.
The naming is confusing. AppInstanceID sounds like an id for the application instance rather than ArgoCD server. I'd also use a more verbose value, like argocd.argoproj.io/argocd-server-instance-id.
| } | ||
|
|
||
| if err := resourceTracking.SetAppInstanceID(local, argoSettings.URL); err != nil { | ||
| log.Warnf("Failed to set Application Instance ID due to missing or invalid ArgoCD URL in ArgoCD Configmap") |
There was a problem hiding this comment.
No need for Warnf, just use Warn, or include the error.
|
Can we combine the two identifiers - Since both are optional components, if both of them is not specifiied, we can have an empty value cc: @jannfis |
FIXES #19547
This PR adds the support for exposing the info about the argocd instance in the clusters/namespaces it manages, by adding a annotation to each resource manifests when URL is configure in argocd-cm.
Checklist: