diff --git a/hack/deploy/configure-values.sh b/hack/deploy/configure-values.sh index bdeec0ca5..b384cad69 100755 --- a/hack/deploy/configure-values.sh +++ b/hack/deploy/configure-values.sh @@ -35,10 +35,12 @@ if [[ ! -v VNET_SUBNET_ID ]]; then VNET_SUBNET_ID=$(jq -r ".subnets[0].id" <<< "$VNET_JSON") fi +NODE_IDENTITIES=$(jq -r ".identityProfile.kubeletidentity.resourceId" <<< "$AKS_JSON") + KARPENTER_USER_ASSIGNED_CLIENT_ID=$(az identity show --resource-group "${AZURE_RESOURCE_GROUP}" --name "${AZURE_KARPENTER_USER_ASSIGNED_IDENTITY_NAME}" --query 'clientId' -otsv) export CLUSTER_NAME AZURE_LOCATION AZURE_RESOURCE_GROUP_MC KARPENTER_SERVICE_ACCOUNT_NAME \ - CLUSTER_ENDPOINT BOOTSTRAP_TOKEN SSH_PUBLIC_KEY VNET_SUBNET_ID KARPENTER_USER_ASSIGNED_CLIENT_ID + CLUSTER_ENDPOINT BOOTSTRAP_TOKEN SSH_PUBLIC_KEY VNET_SUBNET_ID KARPENTER_USER_ASSIGNED_CLIENT_ID NODE_IDENTITIES # get karpenter-values-template.yaml, if not already present (e.g. outside of repo context) if [ ! -f karpenter-values-template.yaml ]; then diff --git a/karpenter-values-template.yaml b/karpenter-values-template.yaml index e4cbe123e..5da0107d4 100644 --- a/karpenter-values-template.yaml +++ b/karpenter-values-template.yaml @@ -26,6 +26,8 @@ controller: value: "" - name: VNET_SUBNET_ID value: ${VNET_SUBNET_ID} + - name: NODE_IDENTITIES + value: ${NODE_IDENTITIES} # Azure client settings - name: ARM_SUBSCRIPTION_ID