Skip to main content

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
Response:

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)
Example:

Delete Cluster

Remove a cluster from Argo CD.
string
required
Cluster server URL or name (URL-encoded)
string
Identifier type: “server” or “name”
Deleting a cluster does not affect the actual Kubernetes cluster, only Argo CD’s registration of it. Applications deployed to the cluster will remain.

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.
Example:

Invalidate Cache

Clear cached cluster information and force reconnection.
string
required
Cluster server URL or name
Example:

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:
Status Values:
  • Successful: Cluster is reachable and authenticated
  • Failed: Connection or authentication failed
  • Unknown: 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:
Empty list = all namespaces accessible.

Security Best Practices

Create dedicated service accounts with minimal permissions for Argo CD.
Always verify TLS certificates in production:
Use the rotate-auth endpoint to refresh tokens periodically.
Set clusterResources: false if cluster-scoped access isn’t needed.
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