Skip to content

Instantly share code, notes, and snippets.

@gititreach
Forked from vfarcic/gke.sh
Created March 23, 2020 00:44
Show Gist options
  • Select an option

  • Save gititreach/e3fe5109f42ee3294c22da2ecc959497 to your computer and use it in GitHub Desktop.

Select an option

Save gititreach/e3fe5109f42ee3294c22da2ecc959497 to your computer and use it in GitHub Desktop.
######################
# 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/1cd17cd12c98563407ad03812aebac46ca4442f2/deploy/mandatory.yaml
kubectl apply \
-f https://raw.githubusercontent.com/kubernetes/ingress-nginx/1cd17cd12c98563407ad03812aebac46ca4442f2/deploy/provider/cloud-generic.yaml
#######################
# Destroy the cluster #
#######################
gcloud container clusters \
delete devops24 \
--region $REGION \
--quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment