Skip to main content
The 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 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.

Subcommands

add

Add a cluster to Argo CD using your kubeconfig.
Add a cluster using kubectl context:
Key Flags:
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.
Output:
With Wide Output:

get

Get detailed information about a specific cluster.
Output:

set

Update cluster settings.
Key Flags:
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.
Removing a cluster does not delete applications deployed to it, but Argo CD will no longer be able to sync them.

rotate-auth

Rotate cluster authentication credentials.
This regenerates the service account token used by Argo CD to access the cluster.

Common Workflows

Adding Multiple Clusters

Cluster Health Check

Organizing Clusters with Labels

These labels can be used in ApplicationSets:

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
For more restricted access, customize the ClusterRole before adding the cluster.

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