argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Application Details destination cluster is "in-cluster (undefined)"

Open wmgroot opened this issue 2 years ago • 6 comments

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

Screenshot from 2022-03-30 12-10-45

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

wmgroot avatar Mar 30 '22 17:03 wmgroot

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

EdwinPhilip avatar Mar 30 '22 18:03 EdwinPhilip

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

n888 avatar Mar 30 '22 19:03 n888

Same issue here. private cloud

detox3r avatar Apr 10 '22 20:04 detox3r

Same here on version 2.3.3

ifaigenb avatar May 15 '22 10:05 ifaigenb

Same here on 2.3.3

eundoosong avatar May 24 '22 10:05 eundoosong

Also appears declarative setup fails when you try and use in-cluster with the following error:

InvalidSpecError: cluster 'in-cluster' has not been configured"

sidewinder12s avatar Aug 01 '22 22:08 sidewinder12s

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

m1mohamad avatar Sep 16 '22 14:09 m1mohamad

@sidewinder12s that error seems to happen when you pass server: in-cluster instead of name: in-cluster.

bardiharborow avatar Jan 07 '23 03:01 bardiharborow

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.

sidewinder12s avatar Jan 12 '23 22:01 sidewinder12s

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: ""

alexandervantrijffel avatar Jan 26 '23 22:01 alexandervantrijffel