We use cookies to make your experience better.
Learn how to set up a GKE cluster for your Coder deployment.
This guide shows you how to set up a Google Kubernetes Engine (GKE) cluster to which Coder can deploy.
You can set up a GKE cluster:
Before proceeding, make sure that the gcloud CLI is installed on your machine.
The following will spin up a Kubernetes cluster using the gcloud
command (be
sure to replace the parameters and environment variables as needed to reflect
the needs of your environment):
PROJECT_ID="MY_PROJECT_ID" CLUSTER_NAME="MY_CLUSTER_NAME" \
gcloud beta container --project "$PROJECT_ID" \
clusters create "$CLUSTER_NAME"
--zone "us-central1-a" \
--no-enable-basic-auth \
--cluster-version "1.14.7-gke.14" \
--machine-type "n1-standard-4" \
--image-type "COS" \
--disk-type "pd-standard" \
--disk-size "100" \
--metadata disable-legacy-endpoints=true \
--scopes "https://www.googleapis.com/auth/cloud-platform" \
--num-nodes "2" \
--enable-stackdriver-kubernetes \
--enable-ip-alias \
--network "projects/${PROJECT_ID}/global/networks/default" \
--subnetwork \
"projects/${PROJECT_ID}/regions/us-central1/subnetworks/default" \
--default-max-pods-per-node "110" \
--addons HorizontalPodAutoscaling,HttpLoadBalancing \
--enable-autoupgrade \
--enable-autorepair \
--enable-network-policy \
--enable-autoscaling
--min-nodes "2"
--max-nodes "8" \
--region "us-central1-c"
After you deploy your cluster, you must configure kubectl to point to your cluster:
Install the gcloud CLI (if you haven't already)
Install kubectl: gcloud components install kubectl
Initialize kubectl with the cluster credentials: gcloud container clusters get-credentials [CLUSTER_NAME]
We recommend running Coder in a separate namespace; to do so, run
kubectl create namespace coder
Next, change the kubectl context to point to your newly created namespace:
kubectl config set-context --current --namespace=coder
At this point, you're ready to proceed to Installation.
Our docs are open source. See something wrong or unclear? Make an edit.