Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove imagesync setup from svc template #896

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ param serviceKeyVaultSoftDelete = {{ .serviceKeyVault.softDelete }}
param serviceKeyVaultPrivate = {{ .serviceKeyVault.private }}

param acrPullResourceGroups = ['{{ .serviceComponentAcrResourceGroups }}']
param imageSyncAcrResourceGroupNames = ['{{ .imageSync.acrRG }}']
param clustersServiceAcrResourceGroupNames = ['{{ .clusterService.acrRG }}']

param oidcStorageAccountName = '{{ .oidcStorageAccountName }}'
Expand Down
45 changes: 0 additions & 45 deletions dev-infrastructure/templates/svc-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ param serviceKeyVaultSoftDelete bool = true
@description('If true, make the service keyvault private and only accessible by the svc cluster via private link.')
param serviceKeyVaultPrivate bool = true

@description('Image sync ACR RG name')
param imageSyncAcrResourceGroupNames array = []

@description('OIDC Storage Account name')
param oidcStorageAccountName string

Expand Down Expand Up @@ -348,48 +345,6 @@ module csDnsZoneContributor '../modules/dns/zone-contributor.bicep' = {
}
}

//
// I M A G E S Y N C
//

var imageSyncManagedIdentityPrincipalId = filter(
svcCluster.outputs.userAssignedIdentities,
id => id.uamiName == 'image-sync'
)[0].uamiPrincipalID

module imageServiceKeyVaultAccess '../modules/keyvault/keyvault-secret-access.bicep' = {
name: guid(serviceKeyVaultName, 'imagesync', 'read')
scope: resourceGroup(serviceKeyVaultResourceGroup)
params: {
keyVaultName: serviceKeyVaultName
roleName: 'Key Vault Secrets User'
managedIdentityPrincipalId: imageSyncManagedIdentityPrincipalId
}
dependsOn: [
serviceKeyVault
svcCluster
]
}

resource imageSyncAcrResourceGroups 'Microsoft.Resources/resourceGroups@2023-07-01' existing = [
for rg in imageSyncAcrResourceGroupNames: {
name: rg
scope: subscription()
}
]

module acrPushRole '../modules/acr-permissions.bicep' = [
for (_, i) in imageSyncAcrResourceGroupNames: {
name: guid(imageSyncAcrResourceGroups[i].id, resourceGroup().name, 'image-sync', 'push')
scope: imageSyncAcrResourceGroups[i]
params: {
principalId: imageSyncManagedIdentityPrincipalId
grantPushAccess: true
acrResourceGroupid: imageSyncAcrResourceGroups[i].id
}
}
]

resource clustersServiceAcrResourceGroups 'Microsoft.Resources/resourceGroups@2023-07-01' existing = [
for rg in clustersServiceAcrResourceGroupNames: {
name: rg
Expand Down