From d2b0f9838e57867e81a0aec8685ac658703cd30b Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Tue, 26 Sep 2023 21:29:16 -0400 Subject: [PATCH] [stress] Change prod maintenance day. Fix stress watcher deploy (#7013) --- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 2 +- tools/stress-cluster/cluster/azure/cluster/cluster.bicep | 3 ++- tools/stress-cluster/cluster/azure/main.bicep | 2 ++ tools/stress-cluster/cluster/azure/parameters/prod.json | 3 +++ .../cluster/kubernetes/stress-infrastructure/Chart.lock | 6 +++--- .../cluster/kubernetes/stress-infrastructure/Chart.yaml | 2 +- .../stress-infrastructure/templates/stresswatcher.yaml | 2 ++ 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index e956508c439..dde43649a39 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -59,7 +59,7 @@ function Login([string]$subscription, [string]$clusterGroup, [switch]$skipPushIm $kubeContext = (RunOrExitOnFailure kubectl config view -o json) | ConvertFrom-Json -AsHashtable $defaultNamespace = $null $targetContext = $kubeContext.contexts.Where({ $_.name -eq $clusterName }) | Select -First 1 - if ($targetContext -ne $null -and $targetContext.Contains('context') -and $targetContext.Contains('namespace')) { + if ($targetContext -ne $null -and $targetContext.Contains('context') -and $targetContext.context.Contains('namespace')) { $defaultNamespace = $targetContext.context.namespace } diff --git a/tools/stress-cluster/cluster/azure/cluster/cluster.bicep b/tools/stress-cluster/cluster/azure/cluster/cluster.bicep index 84ec0aafecc..8106327adc5 100644 --- a/tools/stress-cluster/cluster/azure/cluster/cluster.bicep +++ b/tools/stress-cluster/cluster/azure/cluster/cluster.bicep @@ -6,6 +6,7 @@ param clusterName string param location string = resourceGroup().location param defaultAgentPoolMinNodes int = 6 param defaultAgentPoolMaxNodes int = 20 +param maintenanceWindowDay string = 'Monday' // AKS does not allow agentPool updates via existing managed cluster resources param updateNodes bool = false @@ -100,7 +101,7 @@ resource maintenanceConfig 'Microsoft.ContainerService/managedClusters/maintenan startTime: '02:00' schedule: { weekly: { - dayOfWeek: 'Monday' + dayOfWeek: maintenanceWindowDay intervalWeeks: 1 } } diff --git a/tools/stress-cluster/cluster/azure/main.bicep b/tools/stress-cluster/cluster/azure/main.bicep index a35840a96cd..1abe4033728 100644 --- a/tools/stress-cluster/cluster/azure/main.bicep +++ b/tools/stress-cluster/cluster/azure/main.bicep @@ -9,6 +9,7 @@ param staticTestKeyvaultGroup string param monitoringLocation string = 'centralus' param defaultAgentPoolMinNodes int = 6 param defaultAgentPoolMaxNodes int = 20 +param maintenanceWindowDay string = 'Monday' param tags object // AKS does not allow agentPool updates via existing managed cluster resources param updateNodes bool = false @@ -79,6 +80,7 @@ module cluster 'cluster/cluster.bicep' = { clusterName: clusterName defaultAgentPoolMinNodes: defaultAgentPoolMinNodes defaultAgentPoolMaxNodes: defaultAgentPoolMaxNodes + maintenanceWindowDay: maintenanceWindowDay tags: tags groupSuffix: groupSuffix workspaceId: logWorkspace.outputs.id diff --git a/tools/stress-cluster/cluster/azure/parameters/prod.json b/tools/stress-cluster/cluster/azure/parameters/prod.json index 1b89cdd2ad7..b9565c38566 100644 --- a/tools/stress-cluster/cluster/azure/parameters/prod.json +++ b/tools/stress-cluster/cluster/azure/parameters/prod.json @@ -29,6 +29,9 @@ "defaultAgentPoolMaxNodes": { "value": 10 }, + "maintenanceWindowDay": { + "value": "Friday" + }, "tags": { "value": { "environment": "Prod", diff --git a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.lock b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.lock index 4b7663d20f1..f2c2231f843 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.lock +++ b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 2.1.4 - name: stress-test-addons repository: https://stresstestcharts.blob.core.windows.net/helm/ - version: 0.2.0 -digest: sha256:f9f4b6fa01e634fe3842ed1d257a2618483b1f8972ed85b97fb9abf641c8084a -generated: "2022-11-15T20:35:48.4869487-05:00" + version: 0.3.0 +digest: sha256:dc42ee5bb2c0b0427c47ae898ddab359e05a3e224ea22002175f2d74d95a469b +generated: "2023-09-25T21:27:50.950627239-04:00" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml index 3dbe11a6dca..9054573f7e6 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/Chart.yaml @@ -29,5 +29,5 @@ dependencies: repository: https://charts.chaos-mesh.org condition: deploy.chaosmesh - name: stress-test-addons - version: ~0.2.0 + version: ~0.3.0 repository: "@stress-test-charts" diff --git a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/templates/stresswatcher.yaml b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/templates/stresswatcher.yaml index dae909fde90..53713d26fa2 100644 --- a/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/templates/stresswatcher.yaml +++ b/tools/stress-cluster/cluster/kubernetes/stress-infrastructure/templates/stresswatcher.yaml @@ -34,3 +34,5 @@ spec: {{- include "stress-test-addons.env-volumes" $ctx | nindent 8 }} # Volume template for mounting azure file share for debugging {{- include "stress-test-addons.debug-file-volumes" $ctx | nindent 8 }} + +{{- include "stress-test-addons.static-secrets" . }}