File tree Expand file tree Collapse file tree
eng/common/scripts/stress-testing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,19 @@ $FailedCommands = New-Object Collections.Generic.List[hashtable]
55
66. (Join-Path $PSScriptRoot " ../Helpers" PSModule- Helpers.ps1)
77
8+ $limitRangeSpec = @"
9+ apiVersion: v1
10+ kind: LimitRange
11+ metadata:
12+ name: default-resource-request
13+ spec:
14+ limits:
15+ - defaultRequest:
16+ cpu: 100m
17+ memory: 100Mi
18+ type: Container
19+ "@
20+
821# Powershell does not (at time of writing) treat exit codes from external binaries
922# as cause for stopping execution, so do this via a wrapper function.
1023# See https://github.com/PowerShell/PowerShell-RFC/pull/277
@@ -191,6 +204,9 @@ function DeployStressPackage(
191204 Write-Host " Creating namespace $ ( $pkg.Namespace ) if it does not exist..."
192205 kubectl create namespace $pkg.Namespace -- dry- run= client - o yaml | kubectl apply -f -
193206 if ($LASTEXITCODE ) {exit $LASTEXITCODE }
207+ Write-Host " Adding default resource requests to namespace/$ ( $pkg.Namespace ) "
208+ $limitRangeSpec | kubectl apply - n $pkg.Namespace -f -
209+ if ($LASTEXITCODE ) {exit $LASTEXITCODE }
194210
195211 $dockerBuildConfigs = @ ()
196212
You can’t perform that action at this time.
0 commit comments