Skip to content

Instantly share code, notes, and snippets.

@yanniszark
Created June 13, 2019 11:03
Show Gist options
  • Save yanniszark/f11ad2a602dd40ed3dc957948df49790 to your computer and use it in GitHub Desktop.
Save yanniszark/f11ad2a602dd40ed3dc957948df49790 to your computer and use it in GitHub Desktop.
Simple script to deploy a GKE cluster for Kubeflow
#!/bin/bash
set -e
# Edit according to your preference
GCP_USER="$(gcloud config list account --format "value(core.account)")"
GCP_PROJECT="$(gcloud config list project --format "value(core.project)")"
GCP_ZONE="us-west1-b"
CLUSTER_NAME="kubeflow"
############################
# Create and setup cluster #
############################
gcloud beta container clusters create ${CLUSTER_NAME} \
--project ${GCP_PROJECT} \
--zone ${GCP_ZONE} \
--cluster-version "1.13.6-gke.6" \
--machine-type "n1-standard-8" --num-nodes "1" \
--image-type "UBUNTU" \
--disk-type "pd-ssd" --disk-size "50" \
--no-enable-cloud-logging --no-enable-cloud-monitoring \
--no-enable-ip-alias \
--enable-autoupgrade --enable-autorepair
echo "Getting credentials for newly created cluster..."
gcloud container clusters get-credentials ${CLUSTER_NAME} --zone=${GCP_ZONE}
echo "Setting up GKE RBAC..."
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=${GCP_USER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment