Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.1 KB

02-gke-setup.md

File metadata and controls

44 lines (33 loc) · 1.1 KB

GKE cluster setup

Create a cluster with three nodes using the latest Kubernetes version:

k8s_version=$(gcloud container get-server-config --format=json \
| jq -r '.validMasterVersions[0]')

gcloud container clusters create istio \
--cluster-version=${k8s_version} \
--zone=europe-west3-a \
--num-nodes=3 \
--machine-type=n1-highcpu-4 \
--preemptible \
--no-enable-cloud-logging \
--disk-size=50 \
--enable-autorepair \
--scopes=gke-default

The above command will create a default node pool consisting of n1-highcpu-4 (vCPU: 4, RAM 3.60GB, DISK: 30GB) preemptible VMs. Preemptible VMs are up to 80% cheaper than regular instances and are terminated and replaced after a maximum of 24 hours.

Set up credentials for kubectl:

gcloud container clusters get-credentials istio -z=europe-west3-a

Create a cluster admin role binding:

kubectl create clusterrolebinding "cluster-admin-$(whoami)" \
--clusterrole=cluster-admin \
--user="$(gcloud config get-value core/account)"

Validate your setup with:

kubectl get nodes -o wide

Next: Cloud DNS setup