Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 8278 (#1589)
Browse files Browse the repository at this point in the history
* Migrate stress cluster to use workload identity

* Only sleep to sync fed creds when namespace is new

---------

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp committed May 23, 2024
1 parent 29b02a0 commit 6c387aa
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,17 @@ function DeployStressPackage(
$imageTagBase += "/$($pkg.Namespace)/$($pkg.ReleaseName)"

if (!$Template) {
Write-Host "Creating namespace $($pkg.Namespace) if it does not exist..."
kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f -
if ($LASTEXITCODE) {exit $LASTEXITCODE}
Write-Host "Checking for namespace $($pkg.Namespace)"
kubectl get namespace $pkg.Namespace
if ($LASTEXITCODE) {
Write-Host "Creating namespace $($pkg.Namespace) ..."
kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f -
if ($LASTEXITCODE) {exit $LASTEXITCODE}
# Give a few seconds for stress watcher to initialize the federated identity credential
# and create the service account before we reference it
Write-Host "Waiting 15 seconds for namespace federated credentials to be created and synced"
Start-Sleep 15
}
Write-Host "Adding default resource requests to namespace/$($pkg.Namespace)"
$limitRangeSpec | kubectl apply -n $pkg.Namespace -f -
if ($LASTEXITCODE) {exit $LASTEXITCODE}
Expand Down

0 comments on commit 6c387aa

Please sign in to comment.