Skip to content

Commit

Permalink
PR review fixes for bicep
Browse files Browse the repository at this point in the history
- make azd-hook scripts executable
- adding predeploy to bicep deployment
- remove k8s version and use aks default instead
- fix acrpull for kublet identity
- fix cosmos db account kind parameters
- add overwrite existing param for az aks get creds
  • Loading branch information
pauldotyu committed Feb 6, 2024
1 parent 544d80a commit 7098bac
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 17 deletions.
Empty file modified azd-hooks/postprovision.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion azd-hooks/predeploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo "Retrieving cluster credentials"
az aks get-credentials --resource-group ${AZURE_RESOURCEGROUP_NAME} --name ${AZURE_AKS_CLUSTER_NAME}
az aks get-credentials --resource-group ${AZURE_RESOURCEGROUP_NAME} --name ${AZURE_AKS_CLUSTER_NAME} --overwrite-existing

echo "Deploy Helm chart"
helm upgrade aks-store-demo ./charts/aks-store-demo \
Expand Down
Empty file modified azd-hooks/preprovision.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions azure-bicep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ hooks:
continueOnError: false
interactive: false
run: azd-hooks/postprovision.sh
predeploy: # This is a hack until Helm is supported in azd (https://github.com/Azure/azure-dev/issues/1618)
shell: sh
continueOnError: false
interactive: false
run: azd-hooks/predeploy.sh
infra:
provider: bicep
path: infra/bicep
2 changes: 1 addition & 1 deletion azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hooks:
continueOnError: false
interactive: false
run: azd-hooks/postprovision.sh
predeploy:
predeploy: # This is a hack until Helm is supported in azd (https://github.com/Azure/azure-dev/issues/1618)
shell: sh
continueOnError: false
interactive: false
Expand Down
13 changes: 0 additions & 13 deletions infra/bicep/app/aks-managed-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ param location string = resourceGroup().location
@description('Custom tags to apply to the AKS resources')
param tags object = {}

@description('Kubernetes Version')
param kubernetesVersion string = '1.28.3'

@description('Whether RBAC is enabled for local accounts')
param enableRbac bool = true

Expand Down Expand Up @@ -71,7 +68,6 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' = {
}
properties: {
nodeResourceGroup: !empty(nodeResourceGroupName) ? nodeResourceGroupName : 'rg-mc-${name}'
kubernetesVersion: kubernetesVersion
dnsPrefix: empty(dnsPrefix) ? '${name}-dns' : dnsPrefix
enableRBAC: enableRbac
aadProfile: enableAad ? {
Expand All @@ -88,11 +84,6 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' = {
}
disableLocalAccounts: disableLocalAccounts && enableAad
addonProfiles: addOns
ingressProfile: {
webAppRouting: {
enabled: webAppRoutingAddon
}
}
securityProfile:{
workloadIdentity: {
enabled: true
Expand All @@ -101,10 +92,6 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-03-02-preview' = {
oidcIssuerProfile: {
enabled: true
}
podIdentityProfile: {
enabled: true
allowNetworkPluginKubenet: true
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion infra/bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module acrPullRoleAssignment './core/security/registry-access.bicep' = if(deploy
scope: rg
params: {
containerRegistryName: deployAcr ? containerRegistry.outputs.name : ''
principalId: identity.outputs.principalId
principalId: kubernetes.outputs.clusterIdentity.objectId
}
}

Expand Down
2 changes: 1 addition & 1 deletion infra/bicep/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"value": "${DEPLOY_AZURE_CONTAINER_REGISTRY=false}"
},
"cosmosdbAccountKind": {
"value": "${COSMOSDB_ACCOUNT_KIND=MongoDB}"
"value": "${AZURE_COSMOSDB_ACCOUNT_KIND=MongoDB}"
}
}
}

0 comments on commit 7098bac

Please sign in to comment.