Overview
The Cluster Service API manages Kubernetes cluster configurations. Clusters represent deployment targets for Applications and must be registered with Argo CD before use. Base Path:/api/v1/clusters
gRPC Service: cluster.ClusterService
Cluster Resource
A Cluster represents a Kubernetes cluster that can be used as an Application destination.Cluster Spec
string
required
Kubernetes API server URL
string
Cluster name (unique identifier, alternative to server)
ClusterConfig
required
Authentication and connection configuration
string[]
Allowed namespaces (empty = all namespaces)
boolean
Whether Argo CD can manage cluster-scoped resources
string
Project that owns this cluster
map[string]string
Labels for cluster selection in ApplicationSets
map[string]string
Cluster annotations
Example Cluster
API Operations
List Clusters
Retrieve a list of registered clusters.string
Filter by server URL
string
Filter by cluster name
Get Cluster
Retrieve a specific cluster by server URL or name.string
required
Cluster server URL or name (URL-encoded)
string
Identifier type: “server” (default) or “name”
Create Cluster
Register a new cluster with Argo CD.Cluster
required
Complete Cluster configuration
boolean
Update if already exists (default: false)
Update Cluster
Update an existing cluster configuration.string
required
Cluster server URL or name (URL-encoded)
Cluster
required
Updated Cluster configuration
string[]
List of fields to update (empty = update all)
Delete Cluster
Remove a cluster from Argo CD.string
required
Cluster server URL or name (URL-encoded)
string
Identifier type: “server” or “name”
Cluster Operations
Rotate Auth
Rotate the bearer token for a cluster.string
required
Cluster server URL or name
This operation creates a new service account token and updates the cluster configuration. The old token remains valid for a grace period.
Invalidate Cache
Clear cached cluster information and force reconnection.string
required
Cluster server URL or name
Authentication Methods
Bearer Token Authentication
Most common method using a Kubernetes service account token.TLS Client Certificate
Authenticate using client certificates.AWS EKS Authentication
For Amazon EKS clusters.External Credential Provider
Use exec-based credential plugins.Connection State
Clusters report their connection status:Successful: Cluster is reachable and authenticatedFailed: Connection or authentication failedUnknown: Status not yet determined
Cluster Labels
Labels are used by ApplicationSet generators to select clusters.Setting Labels
Using Labels in ApplicationSets
Namespace Restrictions
Limit which namespaces Argo CD can access:Security Best Practices
Use Dedicated Service Accounts
Use Dedicated Service Accounts
Create dedicated service accounts with minimal permissions for Argo CD.
Enable TLS Verification
Enable TLS Verification
Always verify TLS certificates in production:
Rotate Credentials Regularly
Rotate Credentials Regularly
Use the rotate-auth endpoint to refresh tokens periodically.
Restrict Cluster Resources
Restrict Cluster Resources
Set
clusterResources: false if cluster-scoped access isn’t needed.Use Namespace Restrictions
Use Namespace Restrictions
Limit accessible namespaces to reduce attack surface.
In-Cluster vs External
In-Cluster
Argo CD’s own cluster:- Automatically registered
- Uses in-cluster service account
- Cannot be deleted
External Clusters
Remote clusters:- Must be explicitly registered
- Requires authentication configuration
- Can be added via CLI or API
Next Steps
Application API
Deploy applications to clusters
ApplicationSet API
Use cluster generators
Project API
Configure cluster destinations in projects