Skip to main content
The Cluster resource represents a Kubernetes cluster managed by Rancher. Clusters can be provisioned by Rancher (RKE, RKE2, K3s) or imported from existing infrastructure.

Cluster Resource

From pkg/apis/management.cattle.io/v3/cluster_types.go:97

Cluster Spec

string
required
Human-readable name displayed in the Rancher UI
string
Optional description of the cluster’s purpose
string
Desired Kubernetes version (for RKE2/K3s clusters)
Rke2Config
Configuration for RKE2 clusters. See RKE2 Configuration
K3sConfig
Configuration for K3s clusters
ImportedConfig
Configuration for imported clusters
string
Base64-encoded kubeconfig for cluster access
AKSClusterConfigSpec
Azure Kubernetes Service configuration
EKSClusterConfigSpec
Amazon Elastic Kubernetes Service configuration
GKEClusterConfigSpec
Google Kubernetes Engine configuration
boolean
default:false
Enable project network isolation using Kubernetes NetworkPolicy
LocalClusterAuthEndpoint
Configuration for local cluster authentication endpoint
boolean
Enable local authentication endpoint
string
Fully qualified domain name for the endpoint
string
CA certificates for the endpoint
array<EnvVar>
Environment variables for the cluster agent
AgentDeploymentCustomization
Customization options for cluster agent deployment
AgentDeploymentCustomization
Customization options for fleet agent deployment
string
Name of the Pod Security Admission configuration template

Cluster Status

array<ClusterCondition>
Current state conditions of the cluster
string
Cluster driver type: imported, rancherKubernetesEngine, rke2, k3s, AKS, EKS, GKE
string
Cloud provider: aws, azure, gcp, vsphere, etc.
string
Kubernetes API server endpoint URL
string
Base64-encoded CA certificate for the cluster
version.Info
Kubernetes version information
integer
Total number of nodes in the cluster
ResourceList
Total cluster capacity (CPU, memory, pods)
ResourceList
Allocatable resources in the cluster
string
Container image used for the cluster agent

Cluster Conditions

From pkg/apis/management.cattle.io/v3/cluster_types.go:39
condition
Cluster is ready to serve API requests (healthy when true)
condition
Cluster provisioning is in progress
condition
Cluster infrastructure has been provisioned
condition
Cluster configuration has been updated
condition
Cluster agent has been deployed successfully
condition
All nodes have sufficient disk space
condition
All nodes have sufficient memory

Create Cluster

Create a new Kubernetes cluster.

RKE2 Cluster

Import Existing Cluster

List Clusters

Retrieve all clusters:

Filter Clusters

Filter by labels:

Get Cluster

Retrieve a specific cluster:

Response Example

Update Cluster

Update cluster configuration:

Delete Cluster

Delete a cluster:
Deleting a cluster is irreversible and will remove all associated resources.

Cluster Actions

Generate Kubeconfig

Generate a kubeconfig file for cluster access:
string
Base64-encoded kubeconfig file content

Backup ETCD

Create an ETCD snapshot:

Restore from ETCD Backup

Restore cluster from an ETCD snapshot:

Rotate Certificates

Rotate cluster certificates:

Cluster Drivers

From pkg/apis/management.cattle.io/v3/cluster_types.go:76
Cluster imported from existing infrastructure
Local cluster running Rancher
Legacy RKE1 cluster (deprecated)
RKE2 cluster
K3s lightweight cluster
Azure Kubernetes Service
Amazon Elastic Kubernetes Service
Google Kubernetes Engine

Best Practices

Set meaningful displayName and description fields to identify cluster purpose and environment.
Regularly check cluster conditions to ensure health and catch issues early.
Set enableNetworkPolicy: true for production clusters to enable project isolation.
Define resource quotas at the project level to prevent resource exhaustion.
Schedule automated ETCD backups for disaster recovery.

Next Steps

Projects

Create multi-tenant projects

Nodes

Manage cluster nodes

Workloads

Deploy applications