# List all clustersargocd cluster list -o json# Add a clusterargocd cluster add example-cluster# Get cluster detailsargocd cluster get example-cluster -o wide# Remove a clusterargocd cluster rm example-cluster# Update cluster settingsargocd cluster set CLUSTER_NAME --name new-name --namespace '*'
Argo CD needs credentials to deploy applications to target clusters. The local cluster where Argo CD is installed is automatically configured as https://kubernetes.default.svc.
The cluster where Argo CD is running is called the “in-cluster” and doesn’t need to be added explicitly.
# List clustersargocd cluster list# List with wide outputargocd cluster list -o wide# List as JSONargocd cluster list -o json# List as YAMLargocd cluster list -o yaml
Output:
SERVER NAME VERSION STATUS MESSAGE PROJECThttps://kubernetes.default.svc in-cluster 1.28 Successful defaulthttps://prod.example.com production 1.27 Successful defaulthttps://dev.example.com development 1.28 Successful dev-team
With Wide Output:
argocd cluster list -o wide
SERVER NAME VERSION STATUS MESSAGE LABELS NAMESPACEShttps://kubernetes.default.svc in-cluster 1.28 Successful environment=production *https://prod.example.com production 1.27 Successful env=prod,region=us-west *https://dev.example.com development 1.28 Successful env=dev,team=platform app1,app2
Get detailed information about a specific cluster.
# Get cluster infoargocd cluster get production# Get with wide outputargocd cluster get production -o wide# Get as JSONargocd cluster get production -o json# Get as YAMLargocd cluster get production -o yaml
Output:
Cluster: Server: https://prod.example.com Name: production Version: 1.27 Status: Successful Message: Connection State: Successful Sync Status: SyncedInfo: Platform: linux/amd64 Server Version: v1.27.4 Connection State: Status: Successful Message: cluster is reachableLabels: environment: production region: us-west-2Namespaces: Allowed: *Projects: default production-apps
# Update cluster nameargocd cluster set https://prod.example.com --name production# Set namespacesargocd cluster set production --namespace app1 --namespace app2argocd cluster set production --namespace '*' # Allow all namespaces# Add labelsargocd cluster set production --label env=production --label tier=critical# Set project restrictionsargocd cluster set production --project prod-team --project platform-team# Update shardargocd cluster set production --shard 2
# Remove cluster by nameargocd cluster rm production# Remove cluster by server URLargocd cluster rm https://prod.example.com# Remove without confirmationargocd cluster rm production --yes
Removing a cluster does not delete applications deployed to it, but Argo CD will no longer be able to sync them.
# List all clusters with statusargocd cluster list# Get detailed cluster infoargocd cluster get production# Check connectivitykubectl --context production-context cluster-info
# Allow only specific namespacesargocd cluster set production \ --namespace production \ --namespace monitoring \ --namespace logging# Allow all namespaces with wildcardargocd cluster set production --namespace '*'# Allow namespace patterns (regex)argocd cluster set production \ --namespace 'prod-*' \ --namespace 'app-*'
# Check allowed namespacesargocd cluster get production -o yaml | grep namespaces -A 10# Update namespace permissionsargocd cluster set production --namespace '*'# Or add specific namespaceargocd cluster set production --namespace existing-ns --namespace new-ns