Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Created September 20, 2024 04:52
Show Gist options
  • Save lvnilesh/ba6a92c78205334cb0cebc3d0d30f4fb to your computer and use it in GitHub Desktop.
Save lvnilesh/ba6a92c78205334cb0cebc3d0d30f4fb to your computer and use it in GitHub Desktop.
create-aks-k8s.sh
```
export RANDOM_ID="$(openssl rand -hex 3)"
export MY_RESOURCE_GROUP_NAME="CGRG$RANDOM_ID"
export REGION="westus"
export MY_AKS_CLUSTER_NAME="andromeda$RANDOM_ID"
export MY_DNS_LABEL="cgdns$RANDOM_ID"
az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
az aks create --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --node-count 1 --generate-ssh-keys
az aks get-credentials --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME
kubectl get nodes
# az group list --query "[?location=='westus']".name -o tsv | xargs -ot -n 1 az group delete -y --no-wait -n
az group list
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment