Skip to content

Commit d2bbb22

Browse files
ericpaulsenKatie Horne
andauthored
clarify GKE cluster options (coder#236)
* clarify GKE cluster options * add option info * Edit options * Edit text * Update note Co-authored-by: Katie Horne <katie@coder.com>
1 parent a9ab409 commit d2bbb22

File tree

1 file changed

+56
-35
lines changed

1 file changed

+56
-35
lines changed

setup/kubernetes/google.md

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,33 @@ Before proceeding, make sure that the
1212
[gcloud CLI](https://cloud.google.com/sdk/docs/quickstarts) is installed on your
1313
machine and configured to interact with your Google Cloud Platform account.
1414

15+
Alternatively, you can
16+
[create your cluster using the Google Cloud Console](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-zonal-cluster#creating-a-cluster)
17+
instead of the gcloud CLI. Please refer to the sample CLI commands below for
18+
assistance selecting the correct options for your cluster.
19+
1520
## Set Up the GKE Cluster
1621

17-
The following will spin up a Kubernetes cluster using the `gcloud` command (be
18-
sure to replace the parameters (specifically `PROJECT_ID`, `NEW_CLUSTER_NAME`,
19-
and `ZONE`) as needed to reflect the needs of your environment).
22+
The following two sections will show you how to spin up a Kubernetes cluster
23+
using the `gcloud` command. See
24+
[Google's docs](https://cloud.google.com/sdk/gcloud/reference/beta/container/clusters/create)
25+
for more information on each parameter used.
2026

21-
```console
22-
gcloud beta container --project "$PROJECT_ID" \
23-
clusters create "$NEW_CLUSTER_NAME" \
24-
--zone "$ZONE" \
25-
--no-enable-basic-auth \
26-
--cluster-version "latest" \
27-
--machine-type "n1-highmem-4" \
28-
--image-type "COS" \
29-
--disk-type "pd-standard" \
30-
--disk-size "50" \
31-
--metadata disable-legacy-endpoints=true \
32-
--scopes "https://www.googleapis.com/auth/cloud-platform" \
33-
--num-nodes "2" \
34-
--enable-stackdriver-kubernetes \
35-
--enable-ip-alias \
36-
--network "projects/$PROJECT_ID/global/networks/default" \
37-
--subnetwork \
38-
"projects/$PROJECT_ID/regions/$ZONE/subnetworks/default" \
39-
--default-max-pods-per-node "110" \
40-
--addons HorizontalPodAutoscaling,HttpLoadBalancing \
41-
--enable-autoupgrade \
42-
--enable-autorepair \
43-
--enable-network-policy \
44-
--enable-autoscaling \
45-
--min-nodes "1" \
46-
--max-nodes "8"
47-
```
27+
Regardless of which option you choose, be sure to replace the following
28+
parameters to reflect the needs of your environment: `PROJECT_ID`,
29+
`NEW_CLUSTER_NAME`, `ZONE`.
30+
31+
> Both options include the use of the `enable-network-policy` flag, which
32+
> [creates a Calico cluster](https://kubernetes.io/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy/).
33+
> See
34+
> [Network Policies](https://codercom-lt03v3kjy-codercom.vercel.app/docs/setup/requirements#network-policies)
35+
> for more information.
4836
49-
> The example above includes the use of the `enable-network-policy` flag, which
50-
> will result in the
51-
> [creation of a Calico cluster](https://kubernetes.io/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy/).
37+
### Option 1: Cluster with full support of Coder features
5238

53-
To create clusters capable of supporting use of the
54-
[CVMs](../../admin/environment-management/cvms.md) deployment option:
39+
This option uses an Ubuntu node image to enable support of
40+
[Container-based Virtual Machines (CVMs)](../../admin/environment-management/cvms.md),
41+
allowing system-level functionalities such as Docker in Docker.
5542

5643
```console
5744
gcloud beta container --project "$PROJECT_ID" \
@@ -82,6 +69,40 @@ gcloud beta container --project "$PROJECT_ID" \
8269
--max-nodes "8"
8370
```
8471

72+
### Option 2: Cluster with minimum requirements for Coder
73+
74+
This option uses a Container-Optimized OS (COS) and meets Coder's minimum
75+
requirements. It does _not_ enable the use of
76+
[CVMs](../../admin/environment-management/cvms.md).
77+
78+
```console
79+
gcloud beta container --project "$PROJECT_ID" \
80+
clusters create "$NEW_CLUSTER_NAME" \
81+
--zone "$ZONE" \
82+
--no-enable-basic-auth \
83+
--cluster-version "latest" \
84+
--machine-type "n1-highmem-4" \
85+
--image-type "COS" \
86+
--disk-type "pd-standard" \
87+
--disk-size "50" \
88+
--metadata disable-legacy-endpoints=true \
89+
--scopes "https://www.googleapis.com/auth/cloud-platform" \
90+
--num-nodes "2" \
91+
--enable-stackdriver-kubernetes \
92+
--enable-ip-alias \
93+
--network "projects/$PROJECT_ID/global/networks/default" \
94+
--subnetwork \
95+
"projects/$PROJECT_ID/regions/$ZONE/subnetworks/default" \
96+
--default-max-pods-per-node "110" \
97+
--addons HorizontalPodAutoscaling,HttpLoadBalancing \
98+
--enable-autoupgrade \
99+
--enable-autorepair \
100+
--enable-network-policy \
101+
--enable-autoscaling \
102+
--min-nodes "1" \
103+
--max-nodes "8"
104+
```
105+
85106
This process may take ~15-30 minutes to complete.
86107

87108
## Access Control

0 commit comments

Comments
 (0)