Skip to content

Commit 0e5361e

Browse files
Merge pull request #273476 from nikhilkaul-msft/AKS-updates
Aks updates
2 parents 4a5a5c0 + 9ac2bd1 commit 0e5361e

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

articles/chaos-studio/chaos-studio-fault-library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ These sample values produced ~100% disk pressure when tested on a `Standard_D2s_
817817
| Prerequisites | **Linux**: The **stress-ng** utility needs to be installed. Installation happens automatically as part of agent installation, using the default package manager, on several operating systems including Debian-based (like Ubuntu), Red Hat Enterprise Linux, and OpenSUSE. For other distributions, including Azure Linux, you must install **stress-ng** manually. For more information, see the [upstream project repository](https://github.com/ColinIanKing/stress-ng). |
818818
| Urn | urn:csci:microsoft:agent:stressNg/1.0 |
819819
| Parameters (key, value) | |
820-
| stressNgArguments | One or more arguments to pass to the stress-ng process. For information on possible stress-ng arguments, see the [stress-ng](https://wiki.ubuntu.com/Kernel/Reference/stress-ng) article. |
820+
| stressNgArguments | One or more arguments to pass to the stress-ng process. For information on possible stress-ng arguments, see the [stress-ng](https://wiki.ubuntu.com/Kernel/Reference/stress-ng) article. **NOTE: Do NOT include the "-t " argument because it will cause an error. Experiment length is defined directly in the Azure chaos experiment UI, NOT in the stressNgArguments.** |
821821

822822
#### Sample JSON
823823

articles/chaos-studio/chaos-studio-tutorial-aks-cli.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Create a chaos experiment using a Chaos Mesh fault with Azure CLI
33
description: Create an experiment that uses an AKS Chaos Mesh fault by using Azure Chaos Studio with the Azure CLI.
44
author: prasha-microsoft
55
ms.topic: how-to
6-
ms.date: 04/21/2022
6+
ms.date: 04/25/2024
77
ms.author: abbyweisberg
8-
ms.reviewer: prashabora
8+
ms.reviewer: nikhilkaul
99
ms.service: chaos-studio
1010
ms.custom: template-how-to, devx-track-azurecli
1111
ms.devlang: azurecli
@@ -75,25 +75,27 @@ You can also [use the installation instructions on the Chaos Mesh website](https
7575

7676
Chaos Studio can't inject faults against a resource unless that resource is added to Chaos Studio first. To add a resource to Chaos Studio, create a [target and capabilities](chaos-studio-targets-capabilities.md) on the resource. AKS clusters have only one target type (service-direct), but other resources might have up to two target types. One target type is for service-direct faults. Another target type is for agent-based faults. Each type of Chaos Mesh fault is represented as a capability like PodChaos, NetworkChaos, and IOChaos.
7777

78-
1. Create a target by replacing `$RESOURCE_ID` with the resource ID of the AKS cluster you're adding.
78+
1. Create a target by replacing `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME` with the relevant strings of the AKS cluster you're adding.
7979

8080
```azurecli-interactive
81-
az rest --method put --url "https://management.azure.com/$RESOURCE_ID/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2023-11-01" --body "{\"properties\":{}}"
81+
az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2024-01-01" --body "{\"properties\":{}}"
8282
```
8383
84-
1. Create the capabilities on the target by replacing `$RESOURCE_ID` with the resource ID of the AKS cluster you're adding. Replace `$CAPABILITY` with the [name of the fault capability you're enabling](chaos-studio-fault-library.md).
84+
2. Create the capabilities on the target by replacing `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME` with the relevant strings of the AKS cluster you're adding.
85+
86+
Replace `$CAPABILITY` with the ["Capability Name" of the fault you're adding](chaos-studio-fault-library.md).
8587
86-
```azurecli-interactive
87-
az rest --method put --url "https://management.azure.com/$RESOURCE_ID/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/$CAPABILITY?api-version=2023-11-01" --body "{\"properties\":{}}"
88-
```
88+
```azurecli-interactive
89+
az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/$CAPABILITY?api-version=2024-01-01" --body "{\"properties\":{}}"
90+
```
8991

90-
For example, if you're enabling the `PodChaos` capability:
92+
**Here's an example of enabling the `PodChaos` capability for your reference:**
9193

92-
```azurecli-interactive
93-
az rest --method put --url "https://management.azure.com/subscriptions/b65f2fec-d6b2-4edd-817e-9339d8c01dc4/resourceGroups/myRG/providers/Microsoft.ContainerService/managedClusters/myCluster/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/PodChaos-2.1?api-version=2023-11-01" --body "{\"properties\":{}}"
94-
```
94+
```azurecli-interactive
95+
az rest --method put --url "https://management.azure.com/subscriptions/b65f2fec-d6b2-4edd-817e-9339d8c01dc4/resourceGroups/myRG/providers/Microsoft.ContainerService/managedClusters/myCluster/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/PodChaos-2.1?api-version=2024-01-01" --body "{\"properties\":{}}"
96+
```
9597

96-
This step must be done for each capability you want to enable on the cluster.
98+
This step must be done for **each*** capability you want to enable on the cluster.
9799

98100
You've now successfully added your AKS cluster to Chaos Studio.
99101

@@ -202,10 +204,17 @@ Now you can create your experiment. A chaos experiment defines the actions you w
202204
## Give the experiment permission to your AKS cluster
203205
When you create a chaos experiment, Chaos Studio creates a system-assigned managed identity that executes faults against your target resources. This identity must be given [appropriate permissions](chaos-studio-fault-providers.md) to the target resource for the experiment to run successfully.
204206

205-
Give the experiment access to your resources by using the following command. Replace `$EXPERIMENT_PRINCIPAL_ID` with the principal ID from the previous step. Replace `$RESOURCE_ID` with the resource ID of the target resource. In this case, it's the AKS cluster resource ID. Run this command for each resource targeted in your experiment.
207+
1. Retrieve the `$EXPERIMENT_PRINCIPAL_ID` by running the following command and copying the `PrincipalID` from the response. Replace `$SUBSCRIPTION_ID`, `$RESOURCE_GROUP`, and `$EXPERIMENT_NAME` with the properties for your experiment.
208+
209+
```azurecli-interactive
210+
az rest --method get --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME?api-version=2024-01-01
211+
```
212+
213+
2. Give the experiment access to your resources by using the following command. Replace `$EXPERIMENT_PRINCIPAL_ID` with the principal ID from the previous step. Replace `$SUBSCRIPTION_ID`, `$resourceGroupName`, and `$AKS_CLUSTER_NAME` with the relevant strings of the AKS cluster.
214+
206215

207216
```azurecli-interactive
208-
az role assignment create --role "Azure Kubernetes Service Cluster Admin Role" --assignee-object-id $EXPERIMENT_PRINCIPAL_ID --scope $RESOURCE_ID
217+
az role assignment create --role "Azure Kubernetes Service Cluster Admin Role" --assignee-object-id $EXPERIMENT_PRINCIPAL_ID --scope subscriptions/$SUBSCRIPTION_ID/resourceGroups/$resourceGroupName/providers/Microsoft.ContainerService/managedClusters/$AKS_CLUSTER_NAME
209218
```
210219

211220
## Run your experiment
@@ -214,7 +223,7 @@ You're now ready to run your experiment. To see the effect, we recommend that yo
214223
1. Start the experiment by using the Azure CLI. Replace `$SUBSCRIPTION_ID`, `$RESOURCE_GROUP`, and `$EXPERIMENT_NAME` with the properties for your experiment.
215224

216225
```azurecli-interactive
217-
az rest --method post --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME/start?api-version=2023-11-01
226+
az rest --method post --uri https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Chaos/experiments/$EXPERIMENT_NAME/start?api-version=2024-01-01
218227
```
219228

220229
1. The response includes a status URL that you can use to query experiment status as the experiment runs.

articles/chaos-studio/troubleshooting.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ This error might happen if you added the agent by using the Azure portal, which
132132
133133
To resolve this problem, go to the VM or virtual machine scale set in the Azure portal and go to **Identity**. Open the **User assigned** tab and add your user-assigned identity to the VM. After you're finished, you might need to reboot the VM for the agent to connect.
134134
135+
### My agent-based fault failed with the error "Agent is already performing another task"
136+
137+
This error will happen if you try to run multiple agent faults at the same time. Today the agent only supports running a single agent-fault at a time, and will fail if you define an experiment that runs multiple agent faults at the same time.
138+
135139
## Problems when setting up a managed identity
136140
137141
### When I try to add a system-assigned/user-assigned managed identity to my existing experiment, it fails to save.

0 commit comments

Comments
 (0)