Skip to content

Commit

Permalink
fix configure-values.sh missing AZURE_SUBSCRIPTION_ID (#342)
Browse files Browse the repository at this point in the history
* Update configure-values.sh

chmod +x ./configure-values.sh && ./configure-values.sh ${CLUSTER_NAME} ${RG} karpenter-sa karpentermsi
Configuring karpenter-values.yaml for cluster karpenter in resource group karpenter ...

Error: variable ${AZURE_SUBSCRIPTION_ID} not set

configure-values.sh missing AZURE_SUBSCRIPTION_ID, fix this bug.

* Update configure-values.sh

fix configure-values.sh missing AZURE_SUBSCRIPTION_ID

* Update hack/deploy/configure-values.sh

---------

Co-authored-by: Alex Leites <[email protected]>
  • Loading branch information
ottodeng and tallaxes authored Oct 23, 2024
1 parent f7b6f9d commit 5f9edc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hack/deploy/configure-values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AZURE_KARPENTER_USER_ASSIGNED_IDENTITY_NAME=$4
AKS_JSON=$(az aks show --name "$CLUSTER_NAME" --resource-group "$AZURE_RESOURCE_GROUP" -o json)
AZURE_LOCATION=$(jq -r ".location" <<< "$AKS_JSON")
AZURE_RESOURCE_GROUP_MC=$(jq -r ".nodeResourceGroup" <<< "$AKS_JSON")
AZURE_SUBSCRIPTION_ID=$(az account show --query 'id' -otsv)

CLUSTER_ENDPOINT=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')

Expand All @@ -45,7 +46,8 @@ NODE_IDENTITIES=$(jq -r ".identityProfile.kubeletidentity.resourceId" <<< "$AKS_
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 NODE_IDENTITIES NETWORK_PLUGIN NETWORK_PLUGIN_MODE NETWORK_POLICY
CLUSTER_ENDPOINT BOOTSTRAP_TOKEN SSH_PUBLIC_KEY VNET_SUBNET_ID KARPENTER_USER_ASSIGNED_CLIENT_ID NODE_IDENTITIES AZURE_SUBSCRIPTION_ID NETWORK_PLUGIN NETWORK_PLUGIN_MODE NETWORK_POLICY

# get karpenter-values-template.yaml, if not already present (e.g. outside of repo context)
if [ ! -f karpenter-values-template.yaml ]; then
curl -sO https://raw.githubusercontent.com/Azure/karpenter/main/karpenter-values-template.yaml
Expand Down

0 comments on commit 5f9edc0

Please sign in to comment.