Skip to content

Cluster join: Argo CD cluster Secrets to the cluster resource #5101

Closed

Description

@lex00

The Kubernetes objects in a repo do not say which cluster they run on, and the Terraform that creates that cluster sits in another directory. Argo CD records the link in a cluster Secret, a Secret labelled argocd.argoproj.io/secret-type: cluster with a name and a server. This issue joins those Secrets, and the Applications that target them, to the cluster resource. It also adds a declared mapping for repos where the names do not match. Part of #5094 and INTENTIUS/behold#1049, phase 3.

Today

  • chant already reads cluster Secrets for lint. isClusterSecret, secretField (which reads stringData or data) and CLUSTER_SECRET_TYPE_LABEL live in lexicons/k8s/src/lint/post-synth/argo-helpers.ts, and ARGO003 uses them.
  • behold's cluster anchor declines to guess when there is more than one cluster (behold src/cluster-anchor.ts).
  • kubernetes/gke-utility/argocd/clusters.yaml registers 10 clusters: 8 Secrets, plus 2 ExternalSecrets whose templates produce cluster Secrets. They carry clusterType and cloud labels.
  • The names there do not equal the GKE names. The Secret is gke-prow-build-trusted, while infra/gcp/terraform/k8s-infra-prow-build-trusted/main.tf sets cluster_name = "prow-build-trusted" and passes it through a local into google_container_cluster in modules/gke-cluster. A name-only join draws nothing on that repo.

Change

  • Catalog rule: a cluster Secret's name joins google_container_cluster, aws_eks_cluster or azurerm_kubernetes_cluster by literal name. A base64 data value is decoded.
  • Catalog rule: an Application's spec.destination.name or spec.destination.server joins its cluster Secret.
  • Declared mapping: an additive field on a workspace member entry names the cluster resource the member runs on, with a matching --discover option, and draws a declared edge. The field's name and form are a decision.
  • The behold half is filed in behold: the cluster anchor uses these edges instead of its own guess.

Done when

  • Fixture: argo/clusters.yaml holds Secret prod (server: https://10.0.0.1), and argo/app.yaml holds an Application with destination.name: prod. tf/main.tf declares a google_container_cluster named prod. The graph prints Application to Secret and Secret to cluster.
  • If the Terraform cluster is renamed prod-gke, no edge is drawn and dangling lists the Secret's name.
  • With the mapping field set on the argo member to that cluster, a declared edge is printed.
  • Two google_container_cluster nodes named prod in two roots draw no edge and are recorded as ambiguous.

Depends on

A kind for plain manifest directories. Reference catalog on declared graphs and across members.

Not in this issue

ApplicationSet clusters generators, which have their own issue. Live cluster reads.

Activity

  1. added
    wave:3
    epic:surfaces
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:surfaceswave:3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions