From 21d14585a38747f614d44bf5d8628f63ca67232c Mon Sep 17 00:00:00 2001 From: Eli Holmes - NOAA Date: Wed, 8 May 2024 13:11:08 -0400 Subject: [PATCH] Update set-up-jh-gcp.Rmd --- posts/set-up-jh-gcp.Rmd | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/posts/set-up-jh-gcp.Rmd b/posts/set-up-jh-gcp.Rmd index 34b4012..b3980cc 100644 --- a/posts/set-up-jh-gcp.Rmd +++ b/posts/set-up-jh-gcp.Rmd @@ -12,6 +12,10 @@ description: | See examples of full `config.yaml` files in the `config` directory in the [nmfs-opensci/nmfs-jhub](https://github.com/nmfs-opensci/nmfs-jhub) GitHub repo. +## Just show me the code! + +Scroll to the bottom see the short version just to get the JHub set-up. + ## Set-up Google Cloud 1. Create a Google Cloud account. Activate Compute API. It'll be one of the options. @@ -188,3 +192,45 @@ See the post on [setting up authentication](set-up-authentication.html) for inst * Verify an external IP is provided for the k8s Service proxy-public. `kubectl --namespace=jhubk8 get service proxy-public` * If the external ip remains , diagnose with: `kubectl --namespace=jhubk8 describe service proxy-public` +## Just the code to set up + +``` +# Open a Cloud Shell and run these lines of code +gcloud container clusters create \ + --machine-type n1-standard-2 \ + --num-nodes 2 \ + --zone us-west1-a \ + --cluster-version latest \ + jhub + +kubectl create clusterrolebinding cluster-admin-binding \ + --clusterrole=cluster-admin \ + --user=yourname@gmail.com + +gcloud beta container node-pools create user-pool \ + --machine-type n1-standard-2 \ + --num-nodes 0 \ + --enable-autoscaling \ + --min-nodes 0 \ + --max-nodes 3 \ + --node-labels hub.jupyter.org/node-purpose=user \ + --node-taints hub.jupyter.org_dedicated=user:NoSchedule \ + --zone us-west1-a \ + --preemptible \ + --cluster jhub + +curl https://raw.githubusercontent.com/helm/helm/HEAD/scripts/get-helm-3 + +helm repo add jupyterhub https://hub.jupyter.org/helm-chart/ +helm repo update + +helm upgrade --cleanup-on-fail \ + --install jhub1 jupyterhub/jupyterhub \ + --namespace jhubk8 \ + --create-namespace \ + --version=3.3.4 \ + --values config.yaml + +# DONE!!! Now edit config.yaml by looking at some of the examples in the config directory in this repo. + +