-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate stress cluster to use workload identity (#8278)
* Migrate stress cluster to use workload identity * Update stress watcher tests and chart lock files * Only sleep to sync fed creds when namespace is new * Skip stress provision env outputs in what if mode
- Loading branch information
Showing
41 changed files
with
719 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/network-stress-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.3.1 | ||
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d | ||
generated: "2024-01-17T15:38:17.871619598-05:00" | ||
version: 0.3.2 | ||
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764 | ||
generated: "2024-05-23T11:38:32.810490735-04:00" |
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/network-stress-scenarios-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.3.1 | ||
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d | ||
generated: "2024-01-17T15:39:38.364921715-05:00" | ||
version: 0.3.2 | ||
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764 | ||
generated: "2024-05-23T11:38:01.807752664-04:00" |
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/parallel-pod-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.3.1 | ||
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d | ||
generated: "2024-01-17T15:40:00.504665427-05:00" | ||
version: 0.3.2 | ||
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764 | ||
generated: "2024-05-23T11:38:47.628996062-04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/stress-debug-share-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.3.1 | ||
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d | ||
generated: "2024-01-17T15:39:47.856708817-05:00" | ||
version: 0.3.2 | ||
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764 | ||
generated: "2024-05-23T11:38:19.251210631-04:00" |
6 changes: 3 additions & 3 deletions
6
tools/stress-cluster/chaos/examples/stress-deployment-example/Chart.lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: stress-test-addons | ||
repository: https://stresstestcharts.blob.core.windows.net/helm/ | ||
version: 0.3.1 | ||
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d | ||
generated: "2024-01-17T15:39:23.757382734-05:00" | ||
version: 0.3.2 | ||
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764 | ||
generated: "2024-05-23T11:37:41.371010465-04:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
tools/stress-cluster/cluster/azure/cluster/static-vault-access-policy.bicep
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
tools/stress-cluster/cluster/azure/cluster/workloadappidentities.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
param groupSuffix string | ||
param location string | ||
|
||
param infraNamespace string | ||
param infraWorkloadServiceAccountName string | ||
param workloadAppIssuer string | ||
param workloadAppPoolCount int | ||
|
||
resource infraWorkloadApp 'Microsoft.ManagedIdentity/userAssignedIdentities@2022-01-31-preview' = { | ||
name: 'stress-infra-workload-${groupSuffix}' | ||
location: location | ||
|
||
resource creds 'federatedIdentityCredentials' = { | ||
name: 'stress-infra-federated-${groupSuffix}' | ||
properties: { | ||
issuer: workloadAppIssuer | ||
audiences: ['api://AzureADTokenExchange'] | ||
subject: 'system:serviceaccount:${infraNamespace}:${infraWorkloadServiceAccountName}' | ||
} | ||
} | ||
} | ||
|
||
resource workloadApps 'Microsoft.ManagedIdentity/userAssignedIdentities@2022-01-31-preview' = [for i in range(0, workloadAppPoolCount): { | ||
name: 'stress-app-workload-${groupSuffix}-${i}' | ||
location: location | ||
}] | ||
|
||
output infraWorkloadAppClientId string = infraWorkloadApp.properties.clientId | ||
output infraWorkloadAppObjectId string = infraWorkloadApp.properties.principalId | ||
|
||
output workloadAppInfo array = [for i in range(0, workloadAppPoolCount): { | ||
name: 'stress-app-workload-${groupSuffix}-${i}' | ||
clientId: workloadApps[i].properties.clientId | ||
objectId: workloadApps[i].properties.principalId | ||
}] |
54 changes: 54 additions & 0 deletions
54
tools/stress-cluster/cluster/azure/cluster/workloadapproles.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
targetScope = 'subscription' | ||
|
||
param infraWorkloadAppObjectId string | ||
param workloadApps array | ||
|
||
var serviceBusDataOwnerRoleId = '090c5cfd-751d-490a-894a-3ce6f1109419' | ||
var eventHubsDataOwnerRoleId = 'f526a384-b230-433a-b45c-95f59c4a2dec' | ||
var contributorRoleId = 'b24988ac-6180-42a0-ab88-20f7382dd24c' | ||
var userAccessAdministratorRoleId = '18d7d88d-d35e-4fb5-a5c3-7773c20a72d9' | ||
|
||
resource infraWorkloadAppContrib 'Microsoft.Authorization/roleAssignments@2021-04-01-preview' = { | ||
name: guid('infraWorkloadAppContrib', subscription().id, infraWorkloadAppObjectId) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', contributorRoleId) | ||
principalId: infraWorkloadAppObjectId | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource infraWorkloadAppUA 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { | ||
name: guid('infraWorkloadAppUA', subscription().id, infraWorkloadAppObjectId) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', userAccessAdministratorRoleId) | ||
principalId: infraWorkloadAppObjectId | ||
principalType: 'ServicePrincipal' | ||
} | ||
} | ||
|
||
resource workloadAppContrib 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for i in range(0, length(workloadApps)): { | ||
name: guid('workloadAppContrib', subscription().id, workloadApps[i].objectId) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', contributorRoleId) | ||
principalId: workloadApps[i].objectId | ||
principalType: 'ServicePrincipal' | ||
} | ||
}] | ||
|
||
resource workloadAppEHDataOwner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for i in range(0, length(workloadApps)): { | ||
name: guid('workloadAppEHDataOwner', subscription().id, workloadApps[i].objectId) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', eventHubsDataOwnerRoleId) | ||
principalId: workloadApps[i].objectId | ||
principalType: 'ServicePrincipal' | ||
} | ||
}] | ||
|
||
resource workloadAppSBDataOwner 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = [for i in range(0, length(workloadApps)): { | ||
name: guid('workloadAppSBDataOwner', subscription().id, workloadApps[i].objectId) | ||
properties: { | ||
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', serviceBusDataOwnerRoleId) | ||
principalId: workloadApps[i].objectId | ||
principalType: 'ServicePrincipal' | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tools/stress-cluster/cluster/kubernetes/stress-infrastructure/templates/infra-svc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{- $addons := get .Values "stress-test-addons" -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
annotations: | ||
azure.workload.identity/client-id: {{ get $addons.infraWorkloadAppClientId $addons.env }} | ||
name: {{ get $addons.infraWorkloadAppServiceAccountName $addons.env }} | ||
namespace: {{ .Release.Namespace }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ rules: | |
- get | ||
- list | ||
- watch | ||
- create | ||
- update | ||
- patch |
Oops, something went wrong.