-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deployment for CS Integration MSI
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 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
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,7 @@ | ||
using '../templates/cs-integration-msi.bicep' | ||
|
||
param namespaceFormatString = 'sandbox-jenkins-{0}-aro-hcp' | ||
|
||
param clusterServiceManagedIdentityName = 'cs-integ-mgmt-cluster' | ||
|
||
param clusterName = take('cs-integ-svc-cluster-${uniqueString('svc-cluster')}', 63) |
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,34 @@ | ||
@description('The location for the resources') | ||
param location string = resourceGroup().location | ||
|
||
@description('The format string for the namespace') | ||
param namespaceFormatString string | ||
|
||
@description('The name of the user-assigned managed identity to create') | ||
param clusterServiceManagedIdentityName string | ||
|
||
@description('The name of the cluster to integrate with') | ||
param clusterName string | ||
|
||
resource uami 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { | ||
location: location | ||
name: clusterServiceManagedIdentityName | ||
} | ||
|
||
resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-04-02-preview' existing = { | ||
name: clusterName | ||
} | ||
|
||
resource uami_fedcred 'Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials@2023-01-31' = [ | ||
for i in range(0, 20): { | ||
parent: uami | ||
name: 'fedcred-${i}' | ||
properties: { | ||
audiences: [ | ||
'api://AzureADTokenExchange' | ||
] | ||
issuer: aksCluster.properties.oidcIssuerProfile.issuerURL | ||
subject: 'system:serviceaccount:${format(namespaceFormatString, i)}:cluster-service' | ||
} | ||
} | ||
] |