Instantly share code, notes, and snippets.

@vfarcic /gke.sh
Last active Jan 24, 2019

Embed
What would you like to do?
######################
# Create The Cluster #
######################
gcloud auth login
REGION=us-east1
MACHINE_TYPE=n1-standard-1
gcloud container clusters \
create devops24 \
--region $REGION \
--machine-type $MACHINE_TYPE \
--enable-autoscaling \
--num-nodes 1 \
--max-nodes 3 \
--min-nodes 1
kubectl create clusterrolebinding \
cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml
#######################
# Destroy the cluster #
#######################
gcloud container clusters \
delete devops24 \
--zone $ZONE \
--quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment