diff --git a/.github/workflows/advanced-scenario.yml b/.github/workflows/advanced-scenario.yml index 2174bb6..d0dd00c 100644 --- a/.github/workflows/advanced-scenario.yml +++ b/.github/workflows/advanced-scenario.yml @@ -121,8 +121,8 @@ jobs: helm upgrade $RELEASE_NAME_LOWERCASE . --install echo "CLUSTERIP=$(kubectl get service "nginx-ingress-nginx-controller" -n default -o jsonpath="{.status.loadBalancer.ingress[0].ip}")" >> $GITHUB_ENV - # Deploy Prometheus service to Kubernetes - - name: Deploy Prometheus service to Kubernetes + # Deploy Prometheus and grafana service to Kubernetes + - name: Deploy Prometheus and Grafana services to Kubernetes run: | helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update @@ -143,11 +143,11 @@ jobs: $RESOURCE_GROUP = "${{ secrets.AZURE_RG }}" $SUBSCRIPTION_ID = "${{ secrets.AZURE_SUBSCRIPTION }}" $TARGET_TYPE = "Microsoft-AzureKubernetesServiceChaosMesh" - - # echo resolved command - echo az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerService/managedClusters/$AKS_NAME/providers/Microsoft.Chaos?api-version=2023-11-01" --body '{\"properties\":{\"enabled\":true}}' - - az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerService/managedClusters/$AKS_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2023-11-01" --body '{\"properties\":{}}' + $jsonBody = @{ + properties = @{} + } | ConvertTo-Json -Compress + + az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerService/managedClusters/$AKS_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh?api-version=2023-11-01" --body $jsonBody --headers "Content-Type=application/json" # Create The Capabilities On The Target - name: Create The Capabilities On The Target @@ -156,8 +156,11 @@ jobs: $AKS_NAME = "${{ env.KUBERNETESSERVICENAME }}" $RESOURCE_GROUP = "${{ secrets.AZURE_RG }}" $SUBSCRIPTION_ID = "${{ secrets.AZURE_SUBSCRIPTION }}" + $jsonBody = @{ + properties = @{} + } | ConvertTo-Json -Compress - az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerService/managedClusters/$AKS_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/StressChaos-2.1?api-version=2023-11-01" --body '{\"properties\":{}}' + az rest --method put --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ContainerService/managedClusters/$AKS_NAME/providers/Microsoft.Chaos/targets/Microsoft-AzureKubernetesServiceChaosMesh/capabilities/StressChaos-2.1?api-version=2023-11-01" --body $jsonBody --headers "Content-Type=application/json" # Deploy Bicep file Azure Load Testing --- TODO Param northeurope - name: Deploy Bicep file Azure Load Testing diff --git a/Bicep/ACS/mainACS.bicep b/Bicep/ACS/mainACS.bicep index 48a794a..d8d1fa6 100644 --- a/Bicep/ACS/mainACS.bicep +++ b/Bicep/ACS/mainACS.bicep @@ -23,7 +23,7 @@ param experimentSteps array = [ { type: 'continuous' selectorId: guid('Selector1') - duration: 'PT6M' + duration: experimentConfiguration.duration parameters: [ { key: 'jsonSpec' diff --git a/Bicep/ACS/parameters.json b/Bicep/ACS/parameters.json index dd7a6bc..9e43856 100644 --- a/Bicep/ACS/parameters.json +++ b/Bicep/ACS/parameters.json @@ -4,9 +4,9 @@ "parameters": { "experimentConfiguration": { "value": { - "duration": "30s", + "duration": "PT6M", "namespace": "demo-performance" } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 50f8a64..afe0afc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This project contains a pipeline that deploys all the previous components to an - the Nginx Ingress Controller - the web app to be tested - Prometheus and Grafana to monitor the web app metrics -- the Chaos Mesh to simulate random faults +- the Chaos Mesh to simulate faults Finally creates and runs the JMeter load test and the Chaos Experiment during the load test, to cause really high CPU usage in your app pods.