argocd cluster command manages cluster credentials, allowing Argo CD to deploy applications to multiple Kubernetes clusters.
Quick Examples
Understanding Cluster Management
Argo CD needs credentials to deploy applications to target clusters. The local cluster where Argo CD is installed is automatically configured ashttps://kubernetes.default.svc.
The cluster where Argo CD is running is called the “in-cluster” and doesn’t need to be added explicitly.
Subcommands
add
Add a cluster to Argo CD using your kubeconfig.- Basic
- With RBAC
- Namespaced
- With Labels
Add a cluster using kubectl context:
string
Cluster name (defaults to context name)
string
Service account for Argo CD to use
string[]
Allowed namespaces (can be repeated, use ’*’ for all)
string[]
Cluster labels in key=value format
string[]
Projects allowed to use this cluster
integer
Cluster shard number
boolean
Update cluster if it already exists
list
List all configured clusters.get
Get detailed information about a specific cluster.set
Update cluster settings.string
Update cluster name
string[]
Set allowed namespaces (replaces existing)
string[]
Set cluster labels (replaces existing)
string[]
Set allowed projects (replaces existing)
rm
Remove a cluster from Argo CD.rotate-auth
Rotate cluster authentication credentials.Common Workflows
Adding Multiple Clusters
Cluster Health Check
Organizing Clusters with Labels
Namespace Restrictions
Troubleshooting
Cluster Connection Issues
Permission Errors
If Argo CD can’t deploy to a namespace:Certificate Issues
Service Account Setup
When adding a cluster, Argo CD creates a service account with appropriate permissions:service-account.yaml
Best Practices
- Use descriptive cluster names that indicate environment and region
- Apply consistent labels across clusters for ApplicationSet generators
- Restrict namespace access where appropriate for security
- Regularly rotate cluster credentials
- Monitor cluster connection status
- Use project restrictions to control which teams can deploy to which clusters
Next Steps
App Commands
Deploy applications to clusters
ApplicationSets
Deploy to multiple clusters automatically