Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created September 24, 2018 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vfarcic/9c777487f7ebee6c09027d3a1df8663c to your computer and use it in GitHub Desktop.
Save vfarcic/9c777487f7ebee6c09027d3a1df8663c to your computer and use it in GitHub Desktop.
######################
# Create The Cluster #
######################
gcloud auth login
REGION=us-east1
ZONES=$(gcloud compute zones list \
--filter "region:($REGION)" \
| tail -n +2 \
| awk '{print $1}' \
| tr '\n' ',')
echo $ZONES
MACHINE_TYPE=n1-standard-1
gcloud container clusters \
create devops25 \
--region $REGION \
--node-locations $ZONES \
--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)
##################
# Install Tiller #
##################
kubectl create \
-f https://raw.githubusercontent.com/vfarcic/k8s-specs/master/helm/tiller-rbac.yml \
--record --save-config
helm init --service-account tiller
kubectl -n kube-system \
rollout status deploy tiller-deploy
#######################
# Destroy the cluster #
#######################
gcloud container clusters \
delete devops25 \
--region $REGION \
--quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment