Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ams0/96623d99babe581b80aee73c1353bf5a to your computer and use it in GitHub Desktop.
Save ams0/96623d99babe581b80aee73c1353bf5a to your computer and use it in GitHub Desktop.
CLUSTER=prd-gp-cluster
RG=prd-northeurope-gp-rg
CLOUD_SHELL_IP=`curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
PREVIOUS_ADDRESSES=`az aks show -g $RG -n $CLUSTER --query apiServerAccessProfile.authorizedIpRanges -o tsv | sed -z 's/\n/,/g;s/,$/\n/'`
az aks update -g $RG -n $CLUSTER --api-server-authorized-ip-ranges $PREVIOUS_ADDRESSES,$CLOUD_SHELL_IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment