How do you add (register) an external cluster to ArgoCD?
Short answer
Use `argocd cluster add ` (which creates a service account and stores credentials as a cluster Secret), or declaratively create a cluster Secret with the API URL, credentials, and the argocd.argoproj.io/secret-type: cluster label. ArgoCD then lists it as a deployment destination.
Advertisement
AModel answer
Use `argocd cluster add <context>` (which creates a service account and stores credentials as a cluster Secret), or declaratively create a cluster Secret with the API URL, credentials, and the argocd.argoproj.io/secret-type: cluster label. ArgoCD then lists it as a deployment destination.
kind: Secret
metadata:
labels:
argocd.argoproj.io/secret-type: cluster
stringData:
server: https://remote-api
config: '{"bearerToken":"...","tlsClientConfig":{...}}'Real-world example
A new prod cluster is registered by applying a labeled cluster Secret, after which apps can target it.
Likely follow-ups
- What does argocd cluster add create? | How is a cluster defined declaratively?
Related topics