Skip to main content
Version: 2.5.2

Remote Cluster Management

Remote Cluster Introduction

Chaos Mesh provides the cluster scoped RemoteCluster resource to help you manage and inject faults into remote Kubernetes clusters. This document describes how to create a RemoteCluster object and use it to inject faults.


RemoteCluster is in an early stage. The configuration and function of it (for example, configuration migration, version management and authentication) will continue to improve. If you faced any problem, please open an issue in chaos-mesh/chaos-mesh to report.

Register a remote cluster

To register a remote cluster into the Chaos Mesh installed on the current cluster, you'll need to create a RemoteCluster resource. After creating such a resource, necessary components will be installed automatically in the remote cluster. The following is an example of a RemoteCluster resource:

kind: RemoteCluster
name: cluster-xxx
namespace: 'chaos-mesh'
name: remote-chaos-mesh.kubeconfig
namespace: default
key: kubeconfig

It will install the chaos-mesh helm chart with the KUBECONFIG provided in the .spec.kubeConfig field in the specified namespace.

Field description

ParameterTypeDescriptionDefault valueRequiredExample
namespacestringRepresent the namespace to install chaos-mesh components in the remote clusterNoneYeschaos-mesh
kubeConfig.secretRef.namestringThe name of the secret, which is used to store the kubeconfig of remote cluster. This kubeconfig will be used to install chaos-mesh components and inject errorsNoneYesremote-chaos-mesh.kubeconfig
kubeConfig.secretRef.namespacestringThe name of the namespace of the kubeconfig secret.NoneYesdefault
kubeConfig.secretRef.keystringThe key of the kubeconfig in the secret.NoneYeskubeconfig

Inject errors in the remote cluster

To inject the errors to a remote cluster using the registered RemoteCluster, you could use the remoteCluster field in the .spec of every chaos types. For example:

kind: StressChaos
name: burn-cpu
remoteCluster: cluster-xxx
mode: one
'': 'tikv'
workers: 1
load: 100
options: ['--cpu 2', '--timeout 600', '--hdd 1']
duration: '30s'

The Chaos Mesh will inject the errors to the remote cluster using the kubeconfig registered with the RemoteCluster named cluster-xxx. The corresponding StressChaos will be automatically created in the remote cluster, and the status is synchronized back to the current cluster, so that you can manage the chaos injection for multiple different clusters in a single kubernetes.