Repository navigation
Closed
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:3Wave 3 of an epic's rollout: can start once earlier waves land
Description
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 readsstringDataordata) andCLUSTER_SECRET_TYPE_LABELlive inlexicons/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.yamlregisters 10 clusters: 8 Secrets, plus 2 ExternalSecrets whose templates produce cluster Secrets. They carryclusterTypeandcloudlabels.- The names there do not equal the GKE names. The Secret is
gke-prow-build-trusted, whileinfra/gcp/terraform/k8s-infra-prow-build-trusted/main.tfsetscluster_name = "prow-build-trusted"and passes it through a local intogoogle_container_clusterinmodules/gke-cluster. A name-only join draws nothing on that repo.
Change
- Catalog rule: a cluster Secret's
namejoinsgoogle_container_cluster,aws_eks_clusterorazurerm_kubernetes_clusterby literal name. A base64datavalue is decoded. - Catalog rule: an Application's
spec.destination.nameorspec.destination.serverjoins its cluster Secret. - Declared mapping: an additive field on a workspace member entry names the cluster resource the member runs on, with a matching
--discoveroption, 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.yamlholds Secretprod(server: https://10.0.0.1), andargo/app.yamlholds an Application withdestination.name: prod.tf/main.tfdeclares agoogle_container_clusternamedprod. The graph prints Application to Secret and Secret to cluster. - If the Terraform cluster is renamed
prod-gke, no edge is drawn anddanglinglists the Secret's name. - With the mapping field set on the
argomember to that cluster, a declared edge is printed. - Two
google_container_clusternodes namedprodin 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.
Metadata
Metadata
Assignees
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:3Wave 3 of an epic's rollout: can start once earlier waves land
Activity
feat(workspace): join Argo CD cluster Secrets to the cluster resource (…
feat: estate-read batch 2, catalog rules for secrets, identities, Hel…