Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

GCPChaos allows you to inject faults into Google Cloud Platform services, including stopping instances, resetting instances, and detaching disks.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: GCPChaos

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the GCPChaos resource.
metadata.namespace
string
Namespace of the GCPChaos resource. Defaults to default.

Spec Fields

spec
GCPChaosSpec
required
Defines the behavior of the GCP chaos experiment.

GCPChaosSpec

action
GCPChaosAction
required
Specific GCP chaos action to perform.Enum values:
  • node-stop - Stop a Compute Engine instance
  • node-reset - Reset a Compute Engine instance (one-shot)
  • disk-loss - Detach a disk from a Compute Engine instance
Default: node-stop
duration
*string
Duration of the chaos action.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
secretName
*string
Name of Kubernetes secret containing GCP credentials.The secret should contain service account JSON key.
project
string
required
ID of the GCP project.Part of GCPSelector (inline).
project: "my-gcp-project"
zone
string
required
Zone of the GCP project.Part of GCPSelector (inline).
zone: "us-central1-a"
instance
string
required
Name of the Compute Engine instance.Part of GCPSelector (inline).
instance: "my-instance"
deviceNames
[]string
Device names of disks to detach. Required when action is disk-loss.Part of GCPSelector (inline).
deviceNames:
  - "persistent-disk-1"
  - "persistent-disk-2"
remoteCluster
string
Name of the remote cluster where the chaos will be deployed. If not specified, chaos is applied to the local cluster.

Status Fields

status
GCPChaosStatus
Current status of the chaos experiment.

GCPChaosStatus

conditions
[]ChaosCondition
Current global conditions. See ChaosStatus in Common Types.
experiment
ExperimentStatus
Last known experiment state including desired phase and container records.
attachedDiskStrings
[]string
Attached disk info strings. Needed when action is disk-loss.

Examples

Stop Instance

apiVersion: chaos-mesh.org/v1alpha1
kind: GCPChaos
metadata:
  name: node-stop
  namespace: chaos-mesh
spec:
  action: node-stop
  secretName: gcp-credentials
  project: my-project
  zone: us-central1-a
  instance: my-instance
  duration: 5m

Detach Disk

apiVersion: chaos-mesh.org/v1alpha1
kind: GCPChaos
metadata:
  name: disk-loss
  namespace: chaos-mesh
spec:
  action: disk-loss
  secretName: gcp-credentials
  project: my-project
  zone: us-west1-b
  instance: database-server
  deviceNames:
    - persistent-disk-1
  duration: 3m