Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 00:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vfarcic/c7c9a8603c560eaf88d28db16b14768c to your computer and use it in GitHub Desktop.
Save vfarcic/c7c9a8603c560eaf88d28db16b14768c to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/c7c9a8603c560eaf88d28db16b14768c
######################
# Create The Cluster #
######################
az login
az provider register -n Microsoft.Network
az provider register -n Microsoft.Storage
az provider register -n Microsoft.Compute
az provider register -n Microsoft.ContainerService
export CLUSTER_NAME=chaos
az group create \
--name $CLUSTER_NAME \
--location eastus
az aks create \
--resource-group $CLUSTER_NAME \
--name $CLUSTER_NAME \
--node-count 1 \
--node-vm-size Standard_D4s_v3 \
--generate-ssh-keys
az aks get-credentials \
--resource-group $CLUSTER_NAME \
--name $CLUSTER_NAME
#######################
# Destroy the cluster #
#######################
az group delete \
--name $CLUSTER_NAME \
--yes
kubectl config delete-cluster $CLUSTER_NAME
kubectl config delete-context $CLUSTER_NAME
kubectl config unset \
users.clusterUser_$CLUSTER_NAME_$CLUSTER_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment