diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 new file mode 100644 index 00000000000..1d8d958a2cd --- /dev/null +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -0,0 +1,174 @@ +[CmdletBinding(DefaultParameterSetName = 'Default')] +param( + [string]$SearchDirectory, + [hashtable]$Filters, + [string]$Environment, + [string]$Repository, + [switch]$PushImages, + [string]$ClusterGroup, + [string]$DeployId, + + [Parameter(ParameterSetName = 'DoLogin', Mandatory = $true)] + [switch]$Login, + + [Parameter(ParameterSetName = 'DoLogin')] + [string]$Subscription +) + +$ErrorActionPreference = 'Stop' + +. $PSScriptRoot/find-all-stress-packages.ps1 +$FailedCommands = New-Object Collections.Generic.List[hashtable] + +if (!(Get-Module powershell-yaml)) { + Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser +} + +# Powershell does not (at time of writing) treat exit codes from external binaries +# as cause for stopping execution, so do this via a wrapper function. +# See https://github.com/PowerShell/PowerShell-RFC/pull/277 +function Run() { + Write-Host "`n==> $args`n" -ForegroundColor Green + $command, $arguments = $args + & $command $arguments + if ($LASTEXITCODE) { + Write-Error "Command '$args' failed with code: $LASTEXITCODE" -ErrorAction 'Continue' + $FailedCommands.Add(@{ command = "$args"; code = $LASTEXITCODE }) + } +} + +function RunOrExitOnFailure() { + run @args + if ($LASTEXITCODE) { + exit $LASTEXITCODE + } +} + +function Login([string]$subscription, [string]$clusterGroup, [boolean]$pushImages) { + Write-Host "Logging in to subscription, cluster and container registry" + az account show *> $null + if ($LASTEXITCODE) { + RunOrExitOnFailure az login --allow-no-subscriptions + } + + $clusterName = (az aks list -g $clusterGroup -o json| ConvertFrom-Json).name + + RunOrExitOnFailure az aks get-credentials ` + -n "$clusterName" ` + -g "$clusterGroup" ` + --subscription "$subscription" ` + --overwrite-existing + + if ($pushImages) { + $registry = (az acr list -g $clusterGroup -o json | ConvertFrom-Json).name + RunOrExitOnFailure az acr login -n $registry + } +} + +function DeployStressTests( + [string]$searchDirectory = '.', + [hashtable]$filters = @{}, + [string]$environment = 'test', + [string]$repository = 'images', + [boolean]$pushImages = $false, + [string]$clusterGroup = 'rg-stress-test-cluster-', + [string]$deployId = 'local', + [string]$subscription = 'Azure SDK Test Resources' +) { + if ($PSCmdlet.ParameterSetName -eq 'DoLogin') { + Login $subscription $clusterGroup $pushImages + } + + RunOrExitOnFailure helm repo add stress-test-charts https://stresstestcharts.blob.core.windows.net/helm/ + Run helm repo update + if ($LASTEXITCODE) { return $LASTEXITCODE } + + $pkgs = FindStressPackages $searchDirectory $filters + Write-Host "" "Found $($pkgs.Length) stress test packages:" + Write-Host $pkgs.Directory "" + foreach ($pkg in $pkgs) { + Write-Host "Deploying stress test at '$($pkg.Directory)'" + DeployStressPackage $pkg $deployId $environment $repository $pushImages + } + + Write-Host "Releases deployed by $deployId" + Run helm list --all-namespaces -l deployId=$deployId + + if ($FailedCommands) { + Write-Warning "The following commands failed:" + foreach ($cmd in $FailedCommands) { + Write-Error "'$($cmd.command)' failed with code $($cmd.code)" -ErrorAction 'Continue' + } + exit 1 + } +} + +function DeployStressPackage( + [object]$pkg, + [string]$deployId, + [string]$environment, + [string]$repository, + [boolean]$pushImages +) { + $registry = (az acr list -g $clusterGroup -o json | ConvertFrom-Json).name + if (!$registry) { + Write-Host "Could not find container registry in resource group $clusterGroup" + exit 1 + } + + if ($pushImages) { + Run helm dependency update $pkg.Directory + if ($LASTEXITCODE) { return $LASTEXITCODE } + + $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" + foreach ($dockerFile in $dockerFiles) { + # Infer docker image name from parent directory name, if file is named `Dockerfile` + # or from suffix, is file is named like `Dockerfile.myimage` (for multiple dockerfiles). + $prefix, $imageName = $dockerFile.Name.Split(".") + if (!$imageName) { + $imageName = $dockerFile.Directory.Name + } + $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 } + 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 + } + } + } + + Write-Host "Creating namespace $($pkg.Namespace) if it does not exist..." + kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f - + + Write-Host "Installing or upgrading stress test $($pkg.ReleaseName) from $($pkg.Directory)" + Run helm upgrade $pkg.ReleaseName $pkg.Directory ` + -n $pkg.Namespace ` + --install ` + --set repository=$registry.azurecr.io/$repository ` + --set tag=$deployId ` + --set stress-test-addons.env=$environment + if ($LASTEXITCODE) { + # Issues like 'UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress' + # 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 + } + + # Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around + # specific releases (thereby enabling filtering on `helm list`) is to label the underlying secret resources. + # There is not currently support for setting these labels via the helm cli. + $helmReleaseConfig = kubectl get secrets ` + -n $pkg.Namespace ` + -l status=deployed,name=$($pkg.ReleaseName) ` + -o jsonpath='{.items[0].metadata.name}' + + Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId +} + +DeployStressTests @PSBoundParameters diff --git a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 new file mode 100644 index 00000000000..4d567926f9f --- /dev/null +++ b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 @@ -0,0 +1,53 @@ +param( + [string]$searchDirectory = '.', + [hashtable]$filters = @{} +) + +class StressTestPackageInfo { + [string]$Namespace + [string]$Directory + [string]$ReleaseName +} + +function FindStressPackages([string]$directory, [hashtable]$filters = @{}) { + # Bare minimum filter for stress tests + $filters['stressTest'] = 'true' + + $packages = @() + $chartFiles = Get-ChildItem -Recurse -Filter 'Chart.yaml' $directory + foreach ($chartFile in $chartFiles) { + $chart = ParseChart $chartFile + if (matchesAnnotations $chart $filters) { + $packages += NewStressTestPackageInfo $chart $chartFile + } + } + + return $packages +} + +function ParseChart([string]$chartFile) { + return ConvertFrom-Yaml (Get-Content -Raw $chartFile) +} + +function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) { + foreach ($filter in $filters.GetEnumerator()) { + if (!$chart.annotations -or $chart.annotations[$filter.Key] -ne $filter.Value) { + return $false + } + } + + return $true +} + +function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile) { + return [StressTestPackageInfo]@{ + Namespace = $chart.annotations.namespace + Directory = $chartFile.DirectoryName + ReleaseName = $chart.name + } +} + +# Don't call functions when the script is being dot sourced +if ($MyInvocation.InvocationName -ne ".") { + FindStressPackages $searchDirectory $filters +} diff --git a/eng/pipelines/stress-test-release.yml b/eng/pipelines/stress-test-release.yml new file mode 100644 index 00000000000..60507f6c337 --- /dev/null +++ b/eng/pipelines/stress-test-release.yml @@ -0,0 +1,91 @@ +pr: none + +trigger: none + +parameters: + - name: Subscription + type: string + default: 'Azure SDK Test Resources' + - name: Environment + type: string + default: prod + - name: ClusterGroup + type: string + default: rg-stress-test-cluster-prod + - name: TestRepository + displayName: Stress Test Repository + type: string + default: all + values: + - all + - examples + - javascript + - java + - net + - python + - go + +jobs: +- job: + strategy: + matrix: + ${{ if or(eq(parameters.TestRepository, 'examples'), eq(parameters.TestRepository, 'all')) }}: + examples: + Repository: Azure/azure-sdk-tools + Filters: '@{ "example" = "true" }' + ${{ if or(eq(parameters.TestRepository, 'javascript'), eq(parameters.TestRepository, 'all')) }}: + javascript: + Repository: Azure/azure-sdk-for-js + Filters: '@{}' + ${{ if or(eq(parameters.TestRepository, 'java'), eq(parameters.TestRepository, 'all')) }}: + java: + Repository: Azure/azure-sdk-for-java + Filters: '@{}' + ${{ if or(eq(parameters.TestRepository, 'net'), eq(parameters.TestRepository, 'all')) }}: + net: + Repository: Azure/azure-sdk-for-net + Filters: '@{}' + ${{ if or(eq(parameters.TestRepository, 'python'), eq(parameters.TestRepository, 'all')) }}: + python: + Repository: Azure/azure-sdk-for-python + Filters: '@{}' + ${{ if or(eq(parameters.TestRepository, 'go'), eq(parameters.TestRepository, 'all')) }}: + go: + Repository: Azure/azure-sdk-for-go + Filters: '@{}' + pool: + vmImage: 'ubuntu-20.04' + #name: 'azsdk-pool-mms-ubuntu-2004-general' + #vmImage: 'MMSUbuntu20.04' + steps: + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + parameters: + Repositories: + - Name: Azure/azure-sdk-tools + Commitish: $(Build.SourceVersion) + WorkingDirectory: $(System.DefaultWorkingDirectory)/Azure/azure-sdk-tools + - Name: $(Repository) + Commitish: $(Build.SourceVersion) + WorkingDirectory: $(System.DefaultWorkingDirectory)/$(Repository) + Paths: + - '/tools' + - '!sdk/**/test-recordings' + - '!sdk/**/session-records' + - '!sdk/**/SessionRecords' + + - task: AzureCLI@2 + displayName: Build and Deploy Stress Tests + inputs: + azureSubscription: ${{ parameters.Subscription }} + scriptType: pscore + scriptPath: $(System.DefaultWorkingDirectory)/Azure/azure-sdk-tools/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 + arguments: + -SearchDirectory '$(System.DefaultWorkingDirectory)/$(Repository)' + -Filters $(Filters) + -Environment '${{ parameters.Environment }}' + -Repository '$(Agent.JobName)' + -PushImages + -ClusterGroup '${{ parameters.ClusterGroup }}' + -Login + -Subscription '${{ parameters.Subscription }}' + -DeployId '$(Build.BuildNumber)' diff --git a/tools/stress-cluster/chaos/README.md b/tools/stress-cluster/chaos/README.md index b5a516ff661..026a005164d 100644 --- a/tools/stress-cluster/chaos/README.md +++ b/tools/stress-cluster/chaos/README.md @@ -219,7 +219,7 @@ See the [Job Manifest section](#job-manifest) for an example spec containing con ### Helm Chart Dependencies -The `/chart/Chart.yaml` file should look something like below. It must include the `stress-test-addons` dependency: +The `/chart/Chart.yaml` file should look something like below. It must include the `stress-test-addons` dependency and the included annotations: ``` apiVersion: v2 @@ -227,6 +227,9 @@ name: description: version: 0.1.0 appVersion: v0.1 +annotations: + stressTest: 'true' + namespace: dependencies: - name: stress-test-addons @@ -341,14 +344,16 @@ Then install the stress test into the cluster: ``` kubectl create namespace kubectl label namespace owners= -helm install . +helm install -n . ``` To install into a different cluster (test, prod, or dev): ``` az aks get-credentials --subscription '' -g rg-stress-test-cluster- -n stress-test -helm install . --set stress-test-addons.env= +kubectl create namespace +kubectl label namespace owners= +helm install -n . --set stress-test-addons.env= ``` You can check the progress/status of your installation via: diff --git a/tools/stress-cluster/chaos/examples/network_stress_example/Chart.lock b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock similarity index 81% rename from tools/stress-cluster/chaos/examples/network_stress_example/Chart.lock rename to tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock index d244bc7804f..7b4d61db46f 100644 --- a/tools/stress-cluster/chaos/examples/network_stress_example/Chart.lock +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock @@ -3,4 +3,4 @@ dependencies: repository: https://stresstestcharts.blob.core.windows.net/helm/ version: 0.1.2 digest: sha256:b38f530a7f691eb3f11d48809ba7f86ea9d7b226c3ecb311d1ae47fbb0585466 -generated: "2021-07-06T18:41:20.4293087-04:00" +generated: "2021-07-28T22:23:31.0555163-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 similarity index 63% rename from tools/stress-cluster/chaos/examples/network_stress_example/Chart.yaml rename to tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml index 0659cbd04d5..ecfea179cab 100644 --- a/tools/stress-cluster/chaos/examples/network_stress_example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Chart.yaml @@ -1,8 +1,13 @@ apiVersion: v2 -name: network_example +name: network-example description: An example stress test chart with network chaos -version: 0.1.0 +version: 0.1.1 appVersion: v0.1 +annotations: + stressTest: 'true' + namespace: 'examples' + example: 'true' + test: 'true' dependencies: - name: stress-test-addons diff --git a/tools/stress-cluster/chaos/examples/network-stress-example/Dockerfile b/tools/stress-cluster/chaos/examples/network-stress-example/Dockerfile new file mode 100644 index 00000000000..5cefb5cc4b2 --- /dev/null +++ b/tools/stress-cluster/chaos/examples/network-stress-example/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.14 +RUN apk add --no-cache wget +RUN apk add --no-cache bash + +ADD ./poll.sh /poll.sh +RUN chmod +x /poll.sh + +CMD bash /poll.sh diff --git a/tools/stress-cluster/chaos/examples/network_stress_example/install.sh b/tools/stress-cluster/chaos/examples/network-stress-example/install.sh similarity index 100% rename from tools/stress-cluster/chaos/examples/network_stress_example/install.sh rename to tools/stress-cluster/chaos/examples/network-stress-example/install.sh diff --git a/tools/stress-cluster/chaos/examples/network_stress_example/poll.sh b/tools/stress-cluster/chaos/examples/network-stress-example/poll.sh similarity index 100% rename from tools/stress-cluster/chaos/examples/network_stress_example/poll.sh rename to tools/stress-cluster/chaos/examples/network-stress-example/poll.sh diff --git a/tools/stress-cluster/chaos/examples/network_stress_example/templates/network_loss.yaml b/tools/stress-cluster/chaos/examples/network-stress-example/templates/network_loss.yaml similarity index 100% rename from tools/stress-cluster/chaos/examples/network_stress_example/templates/network_loss.yaml rename to tools/stress-cluster/chaos/examples/network-stress-example/templates/network_loss.yaml 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 similarity index 81% rename from tools/stress-cluster/chaos/examples/network_stress_example/templates/testjob.yaml rename to tools/stress-cluster/chaos/examples/network-stress-example/templates/testjob.yaml index d37c6e57d70..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 @@ -8,7 +8,7 @@ metadata: spec: containers: - name: network-example - image: stresstestregistry.azurecr.io/example/networkexample:v1 command: ["bash", "poll.sh"] + image: {{ default "" .Values.repository }}/network-stress-example:{{ default "v1" .Values.tag }} {{- include "stress-test-addons.container-env" . | nindent 6 }} {{- end -}} diff --git a/tools/stress-cluster/chaos/examples/network_stress_example/Dockerfile b/tools/stress-cluster/chaos/examples/network_stress_example/Dockerfile deleted file mode 100644 index 5215ab24e0c..00000000000 --- a/tools/stress-cluster/chaos/examples/network_stress_example/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu -RUN apt-get update && apt-get install -y wget - -ADD ./poll.sh /poll.sh - -CMD bash /poll.sh diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/Chart.lock b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock similarity index 100% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/Chart.lock rename to tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/Chart.yaml b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml similarity index 67% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/Chart.yaml rename to tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml index 7977e6317a8..bd7c7e462c6 100644 --- a/tools/stress-cluster/chaos/examples/stress_deployment_example/Chart.yaml +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.yaml @@ -1,8 +1,12 @@ apiVersion: v2 -name: deployment_example +name: deployment-example description: An example stress test chart for performing azure resource deployments -version: 0.1.0 +version: 0.1.1 appVersion: v0.1 +annotations: + stressTest: 'true' + namespace: 'examples' + example: 'true' dependencies: - name: stress-test-addons diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/install.sh b/tools/stress-cluster/chaos/examples/stress-deployment-example/install.sh similarity index 100% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/install.sh rename to tools/stress-cluster/chaos/examples/stress-deployment-example/install.sh diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/parameters.json b/tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json similarity index 100% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/parameters.json rename to tools/stress-cluster/chaos/examples/stress-deployment-example/parameters.json diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/templates/deploy-job.yaml b/tools/stress-cluster/chaos/examples/stress-deployment-example/templates/deploy-job.yaml similarity index 100% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/templates/deploy-job.yaml rename to tools/stress-cluster/chaos/examples/stress-deployment-example/templates/deploy-job.yaml 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 similarity index 100% rename from tools/stress-cluster/chaos/examples/stress_deployment_example/test-resources.bicep rename to tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.bicep 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 new file mode 100644 index 00000000000..5a9462a27b9 --- /dev/null +++ b/tools/stress-cluster/chaos/examples/stress-deployment-example/test-resources.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.4.63.48766", + "templateHash": "658186316551815960" + } + }, + "parameters": { + "groupName": { + "type": "string" + }, + "location": { + "type": "string" + }, + "now": { + "type": "string", + "defaultValue": "[utcNow('u')]" + } + }, + "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')]" + } + } + ], + "outputs": { + "RESOURCE_GROUP": { + "type": "string", + "value": "[format('rg-{0}-{1}', parameters('groupName'), uniqueString(parameters('now')))]" + } + } +} \ No newline at end of file diff --git a/tools/stress-cluster/chaos/examples/stress_deployment_example/.gitignore b/tools/stress-cluster/chaos/examples/stress_deployment_example/.gitignore deleted file mode 100644 index 3f3338d82dc..00000000000 --- a/tools/stress-cluster/chaos/examples/stress_deployment_example/.gitignore +++ /dev/null @@ -1 +0,0 @@ -test-resources.json diff --git a/tools/stress-cluster/cluster/README.md b/tools/stress-cluster/cluster/README.md index 753461bbc14..c957217ddbd 100644 --- a/tools/stress-cluster/cluster/README.md +++ b/tools/stress-cluster/cluster/README.md @@ -98,6 +98,7 @@ To remove Azure resources: ``` az group delete +az keyvault purge -n ``` # Building out the Main/Prod Testing Cluster @@ -152,7 +153,7 @@ helm dependency update ./kubernetes/stress-infrastructure helm install stress-infra -n stress-infra --create-namespace ./kubernetes/stress-infrastructure ``` -Copy the deployment outputs to `./kubernetes/environments/` and check in the changes. +Update the values in `./kubernetes/stress-test-addons/values.yaml` to match the deployment outputs and check in the changes. ``` az deployment sub show -o json -n --query properties.outputs diff --git a/tools/stress-cluster/cluster/azure/parameters/prod.json b/tools/stress-cluster/cluster/azure/parameters/prod.json index 94a7d2524f9..711a854de79 100644 --- a/tools/stress-cluster/cluster/azure/parameters/prod.json +++ b/tools/stress-cluster/cluster/azure/parameters/prod.json @@ -14,6 +14,12 @@ "monitoringLocation": { "value": "centralus" }, + "staticTestSecretsKeyvaultName": { + "value": "StressTestSecrets" + }, + "staticTestSecretsKeyvaultGroup": { + "value": "rg-StressTestSecrets" + }, "enableMonitoring": { "value": true }, diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/.gitignore b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/.gitignore index 07062695067..aa1ec1ea061 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/.gitignore +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/.gitignore @@ -1,2 +1 @@ -index.yaml *.tgz 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 3c8413d0d33..076f38f282c 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,16 @@ export AZURE_STORAGE_ACCOUNT=stresstestcharts -# AZURE_STORAGE_KEY must be exported too +# 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' rm *.tgz -rm index.yaml helm package . helm repo index --url https://stresstestcharts.blob.core.windows.net/helm/ . az storage blob upload --container-name helm --file index.yaml --name index.yaml az storage blob upload --container-name helm --file *.tgz --name *.tgz + +# index.yaml must be kept up to date, otherwise when helm generates the file, it will not +# merge it with previous entries, and those packages will become inaccessible as they are no +# longer index. +echo "COMMIT CHANGES MADE TO `index.yaml`" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml new file mode 100644 index 00000000000..b08d3dad1d3 --- /dev/null +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/index.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +entries: + stress-test-addons: + - apiVersion: v2 + appVersion: v0.1 + created: "2021-07-28T22:24:58.3999792-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" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml index 2370f9f0025..27069a7ce4e 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml @@ -2,7 +2,7 @@ env: test appInsightsKeySecretName: test: appInsightsInstrumentationKey-uj7jqs4ukw2gi - prod: 'not-specified' + prod: appInsightsInstrumentationKey-dqojlttkovp2c dev: 'not-specified' staticTestSecretsKeyvaultName: test: StressTestSecrets @@ -10,11 +10,11 @@ staticTestSecretsKeyvaultName: dev: 'not-specified' clusterTestSecretsKeyvaultName: test: stress-kv-uj7jqs4ukw2gi - prod: 'not-specified' + prod: stress-kv-dqojlttkovp2c dev: 'not-specified' secretProviderIdentity: test: bc7712b9-1622-4b7f-9943-604c73cda131 - prod: 'not-specified' + prod: ea706f92-1d9a-4611-9cde-8305aa3d9e98 dev: 'not-specified' subscription: test: public