Chaos faults for GCP
Introduction
GCP faults disrupt resources that run on Google Cloud Platform: Compute Engine VM instances, persistent disks, and managed Cloud SQL instances. Each fault calls the GCP API (using a service account JSON key uploaded as a File Secret in Harness Secret Manager, or Workload Identity on GKE) to inject the disruption, then reverses it cleanly at the end of the configured duration. Go to Authentication options to set up credentials, and GCP IAM integration to use Workload Identity.
GCP SQL Instance Failover
GCP SQL instance failover triggers a failover on a high-availability Cloud SQL instance (SQL_INSTANCE_NAME in GCP_PROJECT_ID). The standby node becomes the new primary; the original primary becomes the new standby once the failover completes.
GCP VM disk loss
GCP VM disk loss detaches one or more named non-boot persistent disks (DISK_VOLUME_NAMES in ZONES/GCP_PROJECT_ID) from their attached VMs for TOTAL_CHAOS_DURATION seconds, then reattaches them on the same device path. Boot disks are excluded by design.
GCP VM disk loss by label
GCP VM disk loss by label resolves the set of non-boot persistent disks matching DISK_VOLUME_LABEL in ZONES/GCP_PROJECT_ID, picks DISK_AFFECTED_PERCENTAGE of them, detaches them from their attached VMs for TOTAL_CHAOS_DURATION seconds, then reattaches them.
GCP VM instance stop
GCP VM instance stop stops one or more Compute Engine VMs listed in VM_INSTANCE_NAMES (in ZONES/GCP_PROJECT_ID) for TOTAL_CHAOS_DURATION seconds, then starts them again. With MANAGED_INSTANCE_GROUP=enable, recovery is driven by the MIG auto-healer.
GCP VM instance stop by label
GCP VM instance stop by label resolves Compute Engine VMs matching INSTANCE_LABEL in ZONES/GCP_PROJECT_ID, picks INSTANCE_AFFECTED_PERCENTAGE of them, stops them for TOTAL_CHAOS_DURATION seconds, then starts them again (unless MANAGED_INSTANCE_GROUP=enable).
Last updated
Was this helpful?