Skip to content

Commit 73c3020

Browse files
author
Robert Bailey
committed
Set the default GKE cluster type for jupyterhub to GKE Autopilot. (#599)
Also add instructions to use a standard cluster if preferred.
1 parent 68d8589 commit 73c3020

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

applications/jupyter/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ This module deploys the following resources, once per user:
2020
- iap.googleapis.com (required when using authentication with Identity Aware Proxy)
2121

2222
2. A functional GKE cluster.
23-
- To create a new standard or autopilot cluster, follow the instructions under `infrastructure/README.md`
23+
- To create a new standard or autopilot cluster, follow the instructions in [`infrastructure/README.md`](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/infrastructure/README.md)
24+
- Alternatively, you can set the `create_cluster` variable to true in `workloads.tfvars` to provision a new GKE cluster. This will default to creating a GKE Autopilot cluster; if you want to provision a standard cluster you must also set `autopilot_cluster` to false.
2425

2526
3. This module is configured to use Identity Aware Proxy (IAP) as default authentication method for JupyterHub. It expects the brand & the OAuth consent configured in your org. You can check the details here: [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent)
2627

@@ -116,7 +117,7 @@ gcloud auth application-default login
116117
1. Extract the randomly generated password for JupyterHub login
117118

118119
```
119-
terraform output password
120+
terraform output jupyterhub_password
120121
```
121122

122123
2. Setup port forwarding for the frontend: `kubectl port-forward service/proxy-public -n <namespace> 8081:80 &`, and open `localhost:8081` in a browser.
@@ -192,4 +193,4 @@ This module uses `<ip>.nip.io` as the domain name with a global static ipv4 addr
192193
193194
## Additional Information
194195
195-
For more information about JupyterHub profiles and the preset profiles visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/profiles.md)
196+
For more information about JupyterHub profiles and the preset profiles visit [here](https://github.com/GoogleCloudPlatform/ai-on-gke/blob/main/applications/jupyter/profiles.md)

applications/jupyter/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ variable "private_cluster" {
150150

151151
variable "autopilot_cluster" {
152152
type = bool
153-
default = false
153+
default = true
154154
}
155155

156156
variable "cpu_pools" {

applications/jupyter/workloads.tfvars

+10-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
# limitations under the License.
1414

1515
##common variables
16-
## Need to pull this variables from tf output from previous platform stage
16+
## Need to pull this variables from tf output from previous infrastructure stage
1717
project_id = "<your project ID>"
1818

19-
## this is required for terraform to connect to GKE master and deploy workloads
20-
create_cluster = false # this flag will create a new standard public gke cluster in default network
21-
cluster_name = "ml-cluster"
22-
cluster_location = "us-central1"
19+
## This is required for terraform to connect to GKE cluster and deploy workloads.
20+
cluster_name = "ml-cluster"
21+
cluster_location = "us-central1"
22+
23+
## If terraform should create a new GKE cluster, fill in this section as well.
24+
## By default, a public autopilot GKE cluster will be created in the default network.
25+
## Set the autopilot_cluster variable to false to create a standard cluster instead.
26+
create_cluster = false
27+
autopilot_cluster = true
2328
cluster_membership_id = "" # required for private cluster, defaults to `cluster_name`
2429

2530
#######################################################

infrastructure/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Setup Infra
22

3-
Platform module (to be renamed to Infra), creates the GKE cluster & other related resources for the AI applications / workloads to be deployed on them.
3+
The infrastructure module creates the GKE cluster and other related resources for the AI applications / workloads to be deployed on them.
44

55
1) Update the ```platform.tfvars``` file with the required configuration. Kindly refer to ```tfvars_examples``` for sample configuration.
66

@@ -21,12 +21,13 @@ Following service APIs are enabled,
2121

2222
if not already enabled, use the following command:
2323
```
24-
gcloud services enable container.googleapis.com gkehub.googleapis.com
24+
gcloud services enable container.googleapis.com gkehub.googleapis.com \
25+
servicenetworking.googleapis.com cloudresourcemanager.googleapis.com
2526
```
2627
## Network Connectivity
2728

2829
### Private GKE Cluster with internal endpoint
29-
Default config in ```platform.tfvars``` creates a private GKE cluster with internal endpoints & cluster is added to project-scoped Anthos fleet.
30+
The default configuration in ```platform.tfvars``` creates a private GKE cluster with internal endpoints and adds the cluster to a project-scoped Anthos fleet.
3031
For admin access to cluster, Anthos Connect Gateway is used.
3132

3233
### Private GKE Cluster with external endpoint

0 commit comments

Comments
 (0)