argo-cd
argo-cd copied to clipboard
Application Details destination cluster is "in-cluster (undefined)"
Checklist:
- [ X ] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [ X ] I've included steps to reproduce the bug.
- [ X ] I've pasted the output of
argocd version
.
Describe the bug
When viewing the Application Details in the ArgoCD UI, the cluster destination appears as "in-cluster (undefined)".
The impact of this issue is that my team has to do extra work to confirm which cluster a user's Application is actually targeting to assist them in debugging any related K8s issues.
To Reproduce
I'm not exactly sure when this became a problem, but it was not an issue while we were using version 2.2.5. We are observing this behavior on version 2.3.2.
We have 3 primary instances of ArgoCD running in our clusters, two with about 2000 Applications each, and one instance we use to install the other ArgoCD instances via GitOps with about 10 Applications. All instances exhibit this behavior.
If you stare at the Application Details long enough (maybe 10+ minutes), the text "in-cluster (undefined)" will eventually revert to the correct value showing the cluster name and server URL, without refreshing the page. After a short period of time the issue returns.
Expected behavior
In the Application Details view, I expect to see the correct cluster destination, with a name and server URL matching the cluster that the Application is configured to target in its destination
field.
Screenshots
Version
$ argocd version
argocd-server: v2.3.2+ecc2af9
Logs
Example Application Spec that produces this issue.
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argo-cd-package-general2
annotations:
# notifications.argoproj.io/subscribe.on-deployed.slack: cp-argo-notifications
notifications.argoproj.io/subscribe.on-health-degraded.slack: cp-argo-notifications
notifications.argoproj.io/subscribe.on-sync-failed.slack: cp-argo-notifications
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: cp-argo-notifications
spec:
project: argo-cd
destination:
name: awscmhinfra2
namespace: argo-cd-general
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
source:
repoURL: XXX (internal gitlab repo)
targetRevision: master
path: charts/argo-cd
helm:
releaseName: argo-cd-general
valueFiles:
- values-clusters.yaml
- values-instance-general2.yaml
To add more to it, we see the same behaviour when we choose cluster by name. If we choose by url, we see the cluster url, not in-cluster
FYI observing same issue here, with 2 argocd-server replicas (Same issue with 1 replica).
Running v2.3.2 with OIDC (no dex), testing as oidc admin user.
Seeing a 403 in browser-inspector while loading App Details ->
https://argocd.com/api/v1/clusters/?name=${CLUSTER_NAME}
argocd-server logs:
Request
[...] grpc.request.content="name:\"${CLUSTER_NAME}\" id:<> " grpc.service=cluster.ClusterService grpc.start_time="2022-03-30T18:16:22Z" span.kind=server system=grpc
Permission Denied
time="2022-03-30T18:16:22Z" level=warning msg="finished unary call with code PermissionDenied" error="rpc error: code = PermissionDenied desc = permission denied" grpc.code=PermissionDenied grpc.method=Get grpc.service=cluster.ClusterService grpc.start_time="2022-03-30T18:16:22Z" grpc.time_ms=0.414 span.kind=server system=grpc
Same issue here. private cloud
Same here on version 2.3.3
Same here on 2.3.3
Also appears declarative setup fails when you try and use in-cluster
with the following error:
InvalidSpecError: cluster 'in-cluster' has not been configured"
so I updated my cert-manager , kes and ingress controller manifests with the cluster URL , and that worked fine before , it fails with errors like this when trying to re-sync the apps :
Sync operation to failed: ComparisonError: rpc error: code = NotFound desc = cluster "https://xxxxx.gr7.eu-central-1.eks.amazonaws.com" not found;ComparisonError: rpc error: code = NotFound desc = cluster "https://xxxxx.gr7.eu-central-1.eks.amazonaws.com" not found;InvalidSpecError: cluster 'https://xxxxxx.gr7.eu-central-1.eks.amazonaws.com' has not been configured
@sidewinder12s that error seems to happen when you pass server: in-cluster
instead of name: in-cluster
.
Yup, just realized that. I opened a separate issue around how restrictive project RBAC is, you must define server or name on your projects and apps. You cannot mix and match them.
I got rid of the error by defining both a cluster name and an empty value for server:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp
namespace: argocd
spec:
project: enigma
destination:
namespace: enigma
name: in-cluster
server: ""