Simulate Azure Faults
AzureChaos can help you simulate fault scenarios on the specified Azure instance. Currently, AzureChaos supports the following fault types:
- VM Stop: stops the specified VM instance.
- Disk Detach: uninstalls the data disk from the specified VM instance.
To easily connect to the Azure cluster, you can create a Kubernetes Secret
file to store the authentication information in advance.
A Secret
file sample is as follows:
- name means the Kubernetes Secret object.
- namespace means the namespace of the Kubernetes Secret object.
- client_id stores Application (client) ID of Azure App registrations.
- client_secret stores Application (client) secret value of Azure App registrations.
- tenant_id stores Directory (tenant) ID of Azure App registrations. For
client_id
andclient_secret
, please refer to Confidential client application.
Make sure that App registrations in the Secret file has been added as a contributor or owner to the access control (IAM) of the VM instance. :::
Before you create an experiment using Chaos Dashboard, make sure the following requirements are met:
Chaos Dashboard is installed.
Chaos Dashboard can be accessed via
kubectl port-forward
:kubectl port-forward -n chaos-testing svc/chaos-dashboard 2333:2333
Then you can access the dashboard via http://localhost:2333 in your browser.
:::
Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration.
Submit the experiment information.
Write the experiment configuration to the
azurechaos-vm-stop.yaml
file, as shown below:Based on this configuration example, Chaos Mesh will inject the
vm-stop
fault into the specified VM instance so that the VM instance will be unavailable in 5 minutes.For more information about stopping VM instances, refer to .
After the configuration file is prepared, use
kubectl
to create an experiment:kubectl apply -f azurechaos-vm-stop.yaml
-
Based on this configuration example, Chaos Mesh will inject
vm-restart
fault into the specified VM instance so that the VM instance will be restarted.For more information about restarting the VM instance, refer to the Azure documentation - Restart a VM.
After the configuration file is prepared, use
kubectl
to create an experiment:kubectl apply -f azurechaos-vm-restart.yaml
Write the experiment configuration to the
azurechaos-disk-detach.yaml
file:Based on this configuration example, Chaos Mesh will inject a
disk-detach
fault into the specified VM instance so that the VM instance is detached from the specified data disk within 5 minutes.For more information about detaching Azure date disk, refer to the .
After the configuration file is prepared, use
kubectl
to create an experiment:
The following table shows the fields in the YAML configuration file.