From fc24cfa02c306c07a8e99bc9db0e2692269d9a24 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Fri, 30 Jul 2021 03:20:00 -0400 Subject: [PATCH 1/6] [stress test] Support scenario name injection into job/volume properties --- .../examples/network-stress-example/templates/testjob.yaml | 3 ++- .../stress-test-addons/templates/_container_env.tpl | 2 +- .../stress-test-addons/templates/_env_volumes.tpl | 2 +- .../kubernetes/stress-test-addons/templates/_init_env.tpl | 2 +- .../stress-test-addons/templates/_stress_test.tpl | 6 ++++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml b/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml index c4448ef19a0..4603a120239 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml +++ b/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml @@ -1,4 +1,5 @@ -{{- include "stress-test-addons.env-job-template.from-pod" (list . "stress.network-example") -}} +{{- $ctx := merge . (dict "Scenario" "bbp" ) -}} +{{- include "stress-test-addons.env-job-template.from-pod" (list $ctx "stress.network-example") -}} {{- define "stress.network-example" -}} metadata: labels: diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl index 7f0da617816..876d0dcbf18 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl @@ -3,6 +3,6 @@ env: - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ .Release.Name }} + - name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs {{- end -}} diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl index a6bd40f9706..e0f9fee2318 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl @@ -1,5 +1,5 @@ {{ define "stress-test-addons.env-volumes" }} -- name: test-env-{{ .Release.Name }} +- name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} emptyDir: {} - name: cluster-secrets-{{ .Release.Name }} csi: diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl index 7c409473bcc..caf667fb4e4 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl @@ -9,7 +9,7 @@ - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ .Release.Name }} + - name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs - name: static-secrets-{{ .Release.Name }} mountPath: "/mnt/secrets/static" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl index 3a77e1ab0e5..38f3de689d2 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl @@ -8,7 +8,7 @@ spec: apiVersion: batch/v1 kind: Job metadata: - name: "{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ default "" .Scenario }}{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} @@ -53,16 +53,18 @@ spec: apiVersion: batch/v1 kind: Job metadata: - name: "{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} + scenario: {{ default "" .Scenario }} spec: backoffLimit: 0 template: metadata: labels: release: {{ .Release.Name }} + scenario: {{ default "" .Scenario }} spec: restartPolicy: Never volumes: From 79b487ecc4ed9078ba9a30d16a743faf9a2544c3 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Fri, 30 Jul 2021 07:37:47 -0400 Subject: [PATCH 2/6] Deploy for stress tests at resource group scope --- .../stress-testing/deploy-stress-tests.ps1 | 3 ++- .../network-stress-example/Chart.lock | 6 +++--- .../network-stress-example/Chart.yaml | 2 +- .../stress-deployment-example/Chart.yaml | 2 +- .../templates/_container_env.tpl | 2 +- .../templates/_env_volumes.tpl | 2 +- .../templates/_init_deploy.tpl | 20 ++++++++++++------- .../templates/_init_env.tpl | 2 +- .../templates/_stress_test.tpl | 6 ++++-- 9 files changed, 27 insertions(+), 18 deletions(-) diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index 1d8d958a2cd..c95b0ebbd9b 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -116,8 +116,9 @@ function DeployStressPackage( exit 1 } + Run helm dependency update $pkg.Directory + if ($pushImages) { - Run helm dependency update $pkg.Directory if ($LASTEXITCODE) { return $LASTEXITCODE } $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock index 7b4d61db46f..2b6ed0575bb 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: stress-test-addons - repository: https://stresstestcharts.blob.core.windows.net/helm/ + repository: file:///home/ben/sdk/azure-sdk-tools/tools/stress-cluster/cluster/kubernetes/stress-test-addons version: 0.1.2 -digest: sha256:b38f530a7f691eb3f11d48809ba7f86ea9d7b226c3ecb311d1ae47fbb0585466 -generated: "2021-07-28T22:23:31.0555163-04:00" +digest: sha256:6fc833e8148db822cbf6c52a166d1fcfec9599b9b057655009f3147cd5752498 +generated: "2021-07-30T03:14:09.1898505-04:00" diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml index ecfea179cab..ab6c86d896a 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml @@ -11,5 +11,5 @@ annotations: dependencies: - name: stress-test-addons - version: 0.1.2 + version: 0.1.3 repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml index bd7c7e462c6..83d31b3b34e 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml @@ -10,5 +10,5 @@ annotations: dependencies: - name: stress-test-addons - version: 0.1.2 + version: 0.1.3 repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl index 876d0dcbf18..ce0b27829dd 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl @@ -3,6 +3,6 @@ env: - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} + - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs {{- end -}} diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl index e0f9fee2318..89482d70d32 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl @@ -1,5 +1,5 @@ {{ define "stress-test-addons.env-volumes" }} -- name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} +- name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} emptyDir: {} - name: cluster-secrets-{{ .Release.Name }} csi: diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl index 0d3e0d14748..feb2f1738bb 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl @@ -7,13 +7,19 @@ source /mnt/secrets/static/* && az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID && az account set -s $AZURE_SUBSCRIPTION_ID && - az deployment sub create \ - -n {{ .Release.Name }} \ - -l westus2 \ + groupName='{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }}' + az group create -l westus2 -g $groupName && + group=$(az group show -g $groupName -o tsv --query "id") && + az tag create --resource-id $group --tags DeleteAfter="$(date -d '+192:00:00' -Iseconds -u)" && + az deployment group create \ + -g $groupName \ + -n $groupName \ -f /mnt/testresources/test-resources.json \ - --parameters /mnt/testresources/parameters.json && - az deployment sub show \ - -n {{ .Release.Name }} \ + --parameters /mnt/testresources/parameters.json \ + --parameters testApplicationOid=$AZURE_CLIENT_OID && + az deployment group show \ + -g $groupName \ + -n $groupName \ -o json \ --query properties.outputs \ | jq -r 'keys[] as $k | "\($k | ascii_upcase)=\(.[$k].value)"' >> /mnt/outputs/.env @@ -23,7 +29,7 @@ volumeMounts: - name: "{{ .Release.Name }}-test-resources" mountPath: /mnt/testresources - - name: "test-env-{{ .Release.Name }}" + - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs - name: "static-secrets-{{ .Release.Name }}" mountPath: "/mnt/secrets/static" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl index caf667fb4e4..57634fcac87 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl @@ -9,7 +9,7 @@ - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }} + - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs - name: static-secrets-{{ .Release.Name }} mountPath: "/mnt/secrets/static" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl index 38f3de689d2..b70f70816f6 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl @@ -8,16 +8,18 @@ spec: apiVersion: batch/v1 kind: Job metadata: - name: "{{ default "" .Scenario }}{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} + scenario: {{ default "" .Scenario }} spec: backoffLimit: 0 template: metadata: labels: release: {{ .Release.Name }} + scenario: {{ default "" .Scenario }} spec: restartPolicy: Never volumes: @@ -53,7 +55,7 @@ spec: apiVersion: batch/v1 kind: Job metadata: - name: "{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} From d856e282af5801155c3fe1b87d446cef5ba037c4 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Fri, 30 Jul 2021 07:49:53 -0400 Subject: [PATCH 3/6] Bump stress-test-addons helm version --- .../examples/network-stress-example/Chart.lock | 8 ++++---- .../network-stress-example/templates/testjob.yaml | 3 +-- .../examples/stress-deployment-example/Chart.yaml | 2 +- .../kubernetes/stress-test-addons/Chart.yaml | 2 +- .../kubernetes/stress-test-addons/index.yaml | 13 +++++++++++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock index 2b6ed0575bb..26b6f7aaa04 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: stress-test-addons - repository: file:///home/ben/sdk/azure-sdk-tools/tools/stress-cluster/cluster/kubernetes/stress-test-addons - version: 0.1.2 -digest: sha256:6fc833e8148db822cbf6c52a166d1fcfec9599b9b057655009f3147cd5752498 -generated: "2021-07-30T03:14:09.1898505-04:00" + repository: https://stresstestcharts.blob.core.windows.net/helm/ + version: 0.1.3 +digest: sha256:48c3b260a14e6b605e43503479ae897fe93e85b29160820ce7aefb2ddd9e8808 +generated: "2021-07-30T07:49:25.1668196-04:00" diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml b/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml index 4603a120239..c4448ef19a0 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml +++ b/tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml @@ -1,5 +1,4 @@ -{{- $ctx := merge . (dict "Scenario" "bbp" ) -}} -{{- include "stress-test-addons.env-job-template.from-pod" (list $ctx "stress.network-example") -}} +{{- include "stress-test-addons.env-job-template.from-pod" (list . "stress.network-example") -}} {{- define "stress.network-example" -}} metadata: labels: diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml index 83d31b3b34e..bd7c7e462c6 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml @@ -10,5 +10,5 @@ annotations: dependencies: - name: stress-test-addons - version: 0.1.3 + version: 0.1.2 repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml index d3bad08f873..3ff0b429111 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: stress-test-addons description: Baseline resources and templates for stress testing clusters -version: 0.1.2 +version: 0.1.3 appVersion: v0.1 diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml index b08d3dad1d3..8b56f842aae 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml @@ -3,11 +3,20 @@ entries: stress-test-addons: - apiVersion: v2 appVersion: v0.1 - created: "2021-07-28T22:24:58.3999792-04:00" + created: "2021-07-28T22:21:27.6697515-04:00" description: Baseline resources and templates for stress testing clusters digest: cce228906811f1b39db7bcd031c94192751caa0a94f7c6035e21e3de8fc5858d name: stress-test-addons urls: - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.2.tgz version: 0.1.2 -generated: "2021-07-28T22:24:58.3988616-04:00" + - apiVersion: v2 + appVersion: v0.1 + created: "2021-07-30T07:38:55.4331073-04:00" + description: Baseline resources and templates for stress testing clusters + digest: 8adc1ae609fda0d0c4c54937876363ac97979485ac2802884409e67e207327b0 + name: stress-test-addons + urls: + - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.3.tgz + version: 0.1.3 +generated: "2021-07-30T07:38:56.4331073-04:00" From 6f4e2abbc7713616565e1315883fbf73b2d286d9 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Tue, 10 Aug 2021 12:06:09 -0400 Subject: [PATCH 4/6] Add built-in Values.scenario list handling for stress-test-addons --- tools/stress-cluster/chaos/README.md | 36 ++++++++++++++- .../kubernetes/stress-test-addons/Chart.yaml | 2 +- .../kubernetes/stress-test-addons/index.yaml | 19 +++++--- .../templates/_container_env.tpl | 2 +- .../templates/_container_image.tpl | 7 +++ .../templates/_env_volumes.tpl | 2 +- .../templates/_init_deploy.tpl | 4 +- .../templates/_init_env.tpl | 2 +- .../templates/_stress_test.tpl | 45 ++++++++++--------- 9 files changed, 86 insertions(+), 33 deletions(-) create mode 100644 tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl diff --git a/tools/stress-cluster/chaos/README.md b/tools/stress-cluster/chaos/README.md index 026a005164d..f98d112387d 100644 --- a/tools/stress-cluster/chaos/README.md +++ b/tools/stress-cluster/chaos/README.md @@ -14,6 +14,7 @@ The chaos environment is an AKS cluster (Azure Kubernetes Service) with several * [Helm Chart Dependencies](#helm-chart-dependencies) * [Job Manifest](#job-manifest) * [Chaos Manifest](#chaos-manifest) + * [Scenarios and values.yaml](#scenarios-and-valuesyaml) * [Deploying a Stress Test](#deploying-a-stress-test) * [Configuring faults](#configuring-faults) * [Faults via Dashboard](#faults-via-dashboard) @@ -154,7 +155,7 @@ The basic layout for a stress test is the following (see `examples/stress_deploy # Optional files/directories - values.yaml # Any default helm template values for this chart + values.yaml # Any default helm template values for this chart, e.g. a `scenarios` list # Any language specific files for building/running/deploying the test # Directories containing code for stress tests # Any additional bicep module files/directories referenced by test-resources.bicep @@ -306,6 +307,39 @@ For more detailed examples, see: - `./examples/network_stress_example/chart/templates/network_loss.yaml` for an example network loss manifest within a helm chart - The [Faults via Dashboard section](#faults-via-dashboard) for generating the configs from the UI +### Scenarios and values.yaml + +For cases where the same job config must be run for multiple instances, a `scenarios` list can be specified in a file called `values.yaml`. + +For example, given a stress test package with multiple tests represented as separate files: + +``` +values.yaml +templates/ +app/ + scenarioLongRunning.js + scenarioPeekMessages.js + scenarioBatchReceive.js +... +``` + +The pod command in the job manifest could be configured to run a variable file name: + +``` +command: ["node", "app/{{ .Scenario }}.js"] +``` + +In order to accomplish this, add the scenarios list to `values.yaml` + +``` +scenarios: + - scenarioLongRunning + - scenarioPeekMessages + - scenarioBatchReceive +``` + +The underlying `stress-test-addons` helm library will handle a scenarios list automatically, and deploy multiple instances of the stress test job, one for each scenario. + ## Deploying a Stress Test To build and deploy the stress test, first log in to access the cluster resources if not already set up: diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml index 3ff0b429111..b66a628b04e 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: stress-test-addons description: Baseline resources and templates for stress testing clusters -version: 0.1.3 +version: 0.1.4 appVersion: v0.1 diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml index 8b56f842aae..6cc624763da 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml @@ -3,13 +3,13 @@ entries: stress-test-addons: - apiVersion: v2 appVersion: v0.1 - created: "2021-07-28T22:21:27.6697515-04:00" + created: "2021-08-10T12:25:32.7932615-04:00" description: Baseline resources and templates for stress testing clusters - digest: cce228906811f1b39db7bcd031c94192751caa0a94f7c6035e21e3de8fc5858d + digest: 40c564cf2fdc37d4cccdd8529b4df0a4f4acabb4d81f9e86d738e7a88cd26081 name: stress-test-addons urls: - - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.2.tgz - version: 0.1.2 + - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.4.tgz + version: 0.1.4 - apiVersion: v2 appVersion: v0.1 created: "2021-07-30T07:38:55.4331073-04:00" @@ -19,4 +19,13 @@ entries: urls: - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.3.tgz version: 0.1.3 -generated: "2021-07-30T07:38:56.4331073-04:00" + - apiVersion: v2 + appVersion: v0.1 + created: "2021-07-28T22:21:27.6697515-04:00" + description: Baseline resources and templates for stress testing clusters + digest: cce228906811f1b39db7bcd031c94192751caa0a94f7c6035e21e3de8fc5858d + name: stress-test-addons + urls: + - https://stresstestcharts.blob.core.windows.net/helm/stress-test-addons-0.1.2.tgz + version: 0.1.2 +generated: "2021-08-10T12:25:32.7923949-04:00" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl index ce0b27829dd..5354973fb2e 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_env.tpl @@ -3,6 +3,6 @@ env: - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} + - name: test-env-{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs {{- end -}} diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl new file mode 100644 index 00000000000..3e16f57f1a3 --- /dev/null +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl @@ -0,0 +1,7 @@ +{{- define "stress-test-addons.container-image" -}} +{{- $context := (first .).Values | dict -}} +{{- $env := dig "stress-test-addons" "env" $context -}} +{{- $registry := get $context.registry $env -}} +{{- $repository := "repo" -}} +image: {{ $env }}.azurecr.io/{{ $repository }}/{{ (index . 1) }} +{{- end -}} diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl index 89482d70d32..fb69139e231 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_env_volumes.tpl @@ -1,5 +1,5 @@ {{ define "stress-test-addons.env-volumes" }} -- name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} +- name: test-env-{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }} emptyDir: {} - name: cluster-secrets-{{ .Release.Name }} csi: diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl index feb2f1738bb..d0d1f6a8956 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_deploy.tpl @@ -7,7 +7,7 @@ source /mnt/secrets/static/* && az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID && az account set -s $AZURE_SUBSCRIPTION_ID && - groupName='{{ default "" (printf "%s-" .Scenario) }}{{ .Release.Name }}-{{ .Release.Revision }}' + groupName='{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }}' az group create -l westus2 -g $groupName && group=$(az group show -g $groupName -o tsv --query "id") && az tag create --resource-id $group --tags DeleteAfter="$(date -d '+192:00:00' -Iseconds -u)" && @@ -29,7 +29,7 @@ volumeMounts: - name: "{{ .Release.Name }}-test-resources" mountPath: /mnt/testresources - - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} + - name: test-env-{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs - name: "static-secrets-{{ .Release.Name }}" mountPath: "/mnt/secrets/static" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl index 57634fcac87..c1c83ed515a 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_init_env.tpl @@ -9,7 +9,7 @@ - name: ENV_FILE value: /mnt/outputs/.env volumeMounts: - - name: test-env-{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }} + - name: test-env-{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }} mountPath: /mnt/outputs - name: static-secrets-{{ .Release.Name }} mountPath: "/mnt/secrets/static" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl index b70f70816f6..c0aabc26229 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl @@ -8,18 +8,18 @@ spec: apiVersion: batch/v1 kind: Job metadata: - name: "{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ lower .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} - scenario: {{ default "" .Scenario }} + scenario: {{ .Scenario }} spec: backoffLimit: 0 template: metadata: labels: release: {{ .Release.Name }} - scenario: {{ default "" .Scenario }} + scenario: {{ .Scenario }} spec: restartPolicy: Never volumes: @@ -35,38 +35,37 @@ spec: {{- include "stress-test-addons.init-deploy" . | nindent 8 }} {{- end -}} -{{- define "stress-test-addons.deploy-job-template" -}} -# Configmap template that adds the stress test ARM template for mounting -{{- include "stress-test-addons.deploy-configmap" (first .) }} ---- -{{- include "stress-test-addons.util.merge" (append . "stress-test-addons.deploy-job-template.tpl") -}} -{{- end -}} - {{- define "stress-test-addons.deploy-job-template.from-pod" -}} +{{- $global := index . 0 -}} +{{- $podDefinition := index . 1 -}} # Configmap template that adds the stress test ARM template for mounting -{{- include "stress-test-addons.deploy-configmap" (first .) }} +{{- include "stress-test-addons.deploy-configmap" $global }} +{{- range (default (list "default") $global.Values.scenarios) }} --- -{{- $jobOverride := fromYaml (include "stress-test-addons.job-wrapper.tpl" .) -}} -{{- $tpl := fromYaml (include "stress-test-addons.deploy-job-template.tpl" (first .)) -}} +{{- /* Copy scenario name into top level key of global context */}} +{{ $instance := deepCopy $global | merge (dict "Scenario" . ) -}} +{{- $jobOverride := fromYaml (include "stress-test-addons.job-wrapper.tpl" (list $instance $podDefinition)) -}} +{{- $tpl := fromYaml (include "stress-test-addons.deploy-job-template.tpl" $instance) -}} {{- toYaml (merge $jobOverride $tpl) -}} +{{- end }} {{- end -}} {{- define "stress-test-addons.env-job-template.tpl" -}} apiVersion: batch/v1 kind: Job metadata: - name: "{{ default "" (printf "%s-" (lower .Scenario)) }}{{ .Release.Name }}-{{ .Release.Revision }}" + name: "{{ .Scenario }}-{{ .Release.Name }}-{{ .Release.Revision }}" namespace: {{ .Release.Namespace }} labels: release: {{ .Release.Name }} - scenario: {{ default "" .Scenario }} + scenario: {{ .Scenario }} spec: backoffLimit: 0 template: metadata: labels: release: {{ .Release.Name }} - scenario: {{ default "" .Scenario }} + scenario: {{ .Scenario }} spec: restartPolicy: Never volumes: @@ -78,12 +77,16 @@ spec: {{- include "stress-test-addons.init-env" . | nindent 8 }} {{- end -}} -{{- define "stress-test-addons.env-job-template" -}} -{{- include "stress-test-addons.util.merge" (append . "stress-test-addons.env-job-template.tpl") -}} -{{- end -}} {{- define "stress-test-addons.env-job-template.from-pod" -}} -{{- $jobOverride := fromYaml (include "stress-test-addons.job-wrapper.tpl" .) -}} -{{- $tpl := fromYaml (include "stress-test-addons.env-job-template.tpl" (first .)) -}} +{{- $global := index . 0 -}} +{{- $podDefinition := index . 1 -}} +{{- range (default (list "default") $global.Values.scenarios) }} +--- +{{- /* Copy scenario name into top level key of global context */}} +{{ $instance := deepCopy $global | merge (dict "Scenario" . ) -}} +{{- $jobOverride := fromYaml (include "stress-test-addons.job-wrapper.tpl" (list $instance $podDefinition)) -}} +{{- $tpl := fromYaml (include "stress-test-addons.env-job-template.tpl" $instance) -}} {{- toYaml (merge $jobOverride $tpl) -}} +{{- end }} {{- end -}} From 2dea045b02fc4039c672a77c758088734e72b650 Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Tue, 10 Aug 2021 12:31:46 -0400 Subject: [PATCH 5/6] [stress test] Fix helm repo indexing to merge with previous index --- .../cluster/kubernetes/stress-test-addons/deploy.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/deploy.sh b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/deploy.sh index 076f38f282c..ceae8e1a940 100755 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/deploy.sh +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/deploy.sh @@ -1,11 +1,13 @@ export AZURE_STORAGE_ACCOUNT=stresstestcharts -# AZURE_STORAGE_KEY must be exported too, run the below command to get the key: -# az storage account keys list --account-name stresstestcharts -o json --query '[0].value' +export AZURE_STORAGE_KEY=$(az storage account keys list --account-name $AZURE_STORAGE_ACCOUNT -o tsv --query '[0].value') rm *.tgz helm package . -helm repo index --url https://stresstestcharts.blob.core.windows.net/helm/ . +helm repo index --url https://stresstestcharts.blob.core.windows.net/helm/ --merge index.yaml . + +# The index.yaml in git should be synced with the index.yaml already in blob storage +# az storage blob download -c helm -n index.yaml -f index.yaml az storage blob upload --container-name helm --file index.yaml --name index.yaml az storage blob upload --container-name helm --file *.tgz --name *.tgz From 5dde4b0dcd24bbda8ed5551a2f5bb00c221bfc8c Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Tue, 10 Aug 2021 13:26:54 -0400 Subject: [PATCH 6/6] [stress test] Automatically compile bicep files in stress test deploy script --- .../stress-testing/deploy-stress-tests.ps1 | 14 +++++--- .../network-stress-example/Chart.lock | 6 ++-- .../network-stress-example/Chart.yaml | 4 +-- .../stress-deployment-example/Chart.lock | 6 ++-- .../stress-deployment-example/Chart.yaml | 3 +- .../stress-deployment-example/parameters.json | 9 +----- .../test-resources.bicep | 22 ++++++------- .../test-resources.json | 32 +++++++++---------- .../templates/_container_image.tpl | 7 ---- .../templates/_stress_test.tpl | 4 +-- 10 files changed, 47 insertions(+), 60 deletions(-) delete mode 100644 tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index c95b0ebbd9b..25af8c9edd7 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -117,10 +117,14 @@ function DeployStressPackage( } Run helm dependency update $pkg.Directory + if ($LASTEXITCODE) { return } - if ($pushImages) { - if ($LASTEXITCODE) { return $LASTEXITCODE } + if (Test-Path "$($pkg.Directory)/test-resources.bicep") { + Run az bicep build -f "$($pkg.Directory)/test-resources.bicep" + if ($LASTEXITCODE) { return } + } + if ($pushImages) { $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" foreach ($dockerFile in $dockerFiles) { # Infer docker image name from parent directory name, if file is named `Dockerfile` @@ -132,13 +136,13 @@ function DeployStressPackage( $imageTag = "${registry}.azurecr.io/$($repository.ToLower())/$($imageName):$deployId" Write-Host "Building and pushing stress test docker image '$imageTag'" Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName - if ($LASTEXITCODE) { return $LASTEXITCODE } + if ($LASTEXITCODE) { return } Run docker push $imageTag if ($LASTEXITCODE) { if ($PSCmdlet.ParameterSetName -ne 'DoLogin') { Write-Warning "If docker push is failing due to authentication issues, try calling this script with '-Login'" } - return $LASTEXITCODE + return } } } @@ -158,7 +162,7 @@ function DeployStressPackage( # can be the result of cancelled `upgrade` operations (e.g. ctrl-c). # See https://github.com/helm/helm/issues/4558 Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'" - return $LASTEXITCODE + return } # Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock index 26b6f7aaa04..3a6f450b0d1 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: stress-test-addons repository: https://stresstestcharts.blob.core.windows.net/helm/ - version: 0.1.3 -digest: sha256:48c3b260a14e6b605e43503479ae897fe93e85b29160820ce7aefb2ddd9e8808 -generated: "2021-07-30T07:49:25.1668196-04:00" + version: 0.1.4 +digest: sha256:c463bfc41e22ce2d3e6ae19279297b3727fa1d76866fbcbd93dd4744c7b768bd +generated: "2021-08-10T13:03:46.0104659-04:00" diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml index ab6c86d896a..ba6194bf789 100644 --- a/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml @@ -7,9 +7,9 @@ annotations: stressTest: 'true' namespace: 'examples' example: 'true' - test: 'true' + hasChaos: 'true' dependencies: - name: stress-test-addons - version: 0.1.3 + version: 0.1.4 repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock index c2ececd5701..76674aa9f90 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: stress-test-addons repository: https://stresstestcharts.blob.core.windows.net/helm/ - version: 0.1.2 -digest: sha256:b38f530a7f691eb3f11d48809ba7f86ea9d7b226c3ecb311d1ae47fbb0585466 -generated: "2021-07-06T18:42:04.6255273-04:00" + version: 0.1.4 +digest: sha256:c463bfc41e22ce2d3e6ae19279297b3727fa1d76866fbcbd93dd4744c7b768bd +generated: "2021-08-10T13:10:34.5201711-04:00" diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml index bd7c7e462c6..be6e2452443 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml @@ -7,8 +7,9 @@ annotations: stressTest: 'true' namespace: 'examples' example: 'true' + hasDeploy: 'true' dependencies: - name: stress-test-addons - version: 0.1.2 + version: 0.1.4 repository: https://stresstestcharts.blob.core.windows.net/helm/ diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json b/tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json index c8f13cd4cfb..24dce001ce6 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json @@ -1,12 +1,5 @@ { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", - "parameters": { - "groupName": { - "value": "stress-test-deploy-example" - }, - "location": { - "value": "westus2" - } - } + "parameters": { } } diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep b/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep index 608c3f0acfc..1b4fa2061a8 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep @@ -1,15 +1,13 @@ -targetScope = 'subscription' +// Dummy parameter to handle defaults the script passes in +param testApplicationOid string = '' -param groupName string -param location string -param now string = utcNow('u') - -resource group 'Microsoft.Resources/resourceGroups@2020-10-01' = { - name: 'rg-${groupName}-${uniqueString(now)}' - location: location - tags: { - DeleteAfter: dateTimeAdd(now, 'PT8H') - } +resource config 'Microsoft.AppConfiguration/configurationStores@2020-07-01-preview' = { + name: 'config-${resourceGroup().name}' + location: resourceGroup().location + sku: { + name: 'Standard' + } } -output RESOURCE_GROUP string = group.name +output RESOURCE_GROUP string = resourceGroup().name +output AZURE_CLIENT_OID string = testApplicationOid diff --git a/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json b/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json index 5a9462a27b9..39a7199b56a 100644 --- a/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json @@ -1,41 +1,39 @@ { - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": { "_generator": { "name": "bicep", "version": "0.4.63.48766", - "templateHash": "658186316551815960" + "templateHash": "13987799099034517242" } }, "parameters": { - "groupName": { - "type": "string" - }, - "location": { - "type": "string" - }, - "now": { + "testApplicationOid": { "type": "string", - "defaultValue": "[utcNow('u')]" + "defaultValue": "" } }, "functions": [], "resources": [ { - "type": "Microsoft.Resources/resourceGroups", - "apiVersion": "2020-10-01", - "name": "[format('rg-{0}-{1}', parameters('groupName'), uniqueString(parameters('now')))]", - "location": "[parameters('location')]", - "tags": { - "DeleteAfter": "[dateTimeAdd(parameters('now'), 'PT8H')]" + "type": "Microsoft.AppConfiguration/configurationStores", + "apiVersion": "2020-07-01-preview", + "name": "[format('config-{0}', resourceGroup().name)]", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard" } } ], "outputs": { "RESOURCE_GROUP": { "type": "string", - "value": "[format('rg-{0}-{1}', parameters('groupName'), uniqueString(parameters('now')))]" + "value": "[resourceGroup().name]" + }, + "AZURE_CLIENT_OID": { + "type": "string", + "value": "[parameters('testApplicationOid')]" } } } \ No newline at end of file diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl deleted file mode 100644 index 3e16f57f1a3..00000000000 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_container_image.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{{- define "stress-test-addons.container-image" -}} -{{- $context := (first .).Values | dict -}} -{{- $env := dig "stress-test-addons" "env" $context -}} -{{- $registry := get $context.registry $env -}} -{{- $repository := "repo" -}} -image: {{ $env }}.azurecr.io/{{ $repository }}/{{ (index . 1) }} -{{- end -}} diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl index c0aabc26229..8f85715398f 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/templates/_stress_test.tpl @@ -40,7 +40,7 @@ spec: {{- $podDefinition := index . 1 -}} # Configmap template that adds the stress test ARM template for mounting {{- include "stress-test-addons.deploy-configmap" $global }} -{{- range (default (list "default") $global.Values.scenarios) }} +{{- range (default (list "stress") $global.Values.scenarios) }} --- {{- /* Copy scenario name into top level key of global context */}} {{ $instance := deepCopy $global | merge (dict "Scenario" . ) -}} @@ -81,7 +81,7 @@ spec: {{- define "stress-test-addons.env-job-template.from-pod" -}} {{- $global := index . 0 -}} {{- $podDefinition := index . 1 -}} -{{- range (default (list "default") $global.Values.scenarios) }} +{{- range (default (list "stress") $global.Values.scenarios) }} --- {{- /* Copy scenario name into top level key of global context */}} {{ $instance := deepCopy $global | merge (dict "Scenario" . ) -}}