Customizing JupyterHub on Kubernetes

Thank you for your reply! I was using the same config file as yours shown below and in order to simplify, I only define two keys, proxy and hub. Then I was using the command helm upgrade --install jhub jupyterhub/jupyterhub --namespace jhub --version 0.9-2d435d6 --values config.yaml to activate this config file.

proxy:
  secretToken: "5799c72021f34facdf8c09c2f5def77f3117c9edd74d02b6cc04517829fbe878"

hub:
  # Clone custom JupyterHub templates into a volume
  initContainers:
    - name: git-clone-templates
      image: alpine/git
      args:
        - clone
        - --single-branch
        - --branch=master
        - --depth=1
        - --
        - https://github.com/LibreTexts/jupyterhub-templates.git
        - /home/test-templates/
      securityContext:
        runAsUser: 0
      volumeMounts:
        - name: custom-templates
          mountPath: /home/test-templates/
  extraVolumes:
    - name: custom-templates
      emptyDir: {}
  extraVolumeMounts:
    - name: custom-templates
      mountPath: /home/test-templates/

  extraConfig:
    templates: |
      c.JupyterHub.template_paths = ['/home/test-templates/']

Here is the output:

Release "jhub" has been upgraded.
LAST DEPLOYED: Tue Oct  1 21:07:04 2019
NAMESPACE: jhub
STATUS: DEPLOYED

RESOURCES:
==> v1/ClusterRole
NAME                               AGE
jhub-user-scheduler-complementary  12h

==> v1/ClusterRoleBinding
NAME                               AGE
jhub-user-scheduler-base           12h
jhub-user-scheduler-complementary  12h

==> v1/ConfigMap
NAME            DATA  AGE
hub-config      1     12h
user-scheduler  1     12h

==> v1/DaemonSet
NAME                     DESIRED  CURRENT  READY  UP-TO-DATE  AVAILABLE  NODE SELECTOR  AGE
continuous-image-puller  3        3        3      3           3          <none>         12h

==> v1/Deployment
NAME            READY  UP-TO-DATE  AVAILABLE  AGE
hub             1/1    1           1          12h
proxy           1/1    1           1          12h
user-scheduler  2/2    2           2          12h

==> v1/PersistentVolumeClaim
NAME        STATUS  VOLUME                                    CAPACITY  ACCESS MODES  STORAGECLASS  AGE
hub-db-dir  Bound   pvc-5f091726-e3e5-11e9-beb2-42010af00204  1Gi       RWO           standard      12h

==> v1/Pod(related)
NAME                            READY  STATUS   RESTARTS  AGE
continuous-image-puller-f567h   1/1    Running  0         12h
continuous-image-puller-jrlq8   1/1    Running  0         12h
continuous-image-puller-tjn56   1/1    Running  0         12h
hub-d56695869-h5m45             1/1    Running  0         12h
proxy-f54886f9d-rskwm           1/1    Running  0         12h
user-scheduler-b7db6b677-lv7kg  1/1    Running  0         12h
user-scheduler-b7db6b677-p9drn  1/1    Running  0         12h

==> v1/Role
NAME  AGE
hub   12h

==> v1/RoleBinding
NAME  AGE
hub   12h

==> v1/Secret
NAME        TYPE    DATA  AGE
hub-secret  Opaque  2     12h

==> v1/Service
NAME          TYPE          CLUSTER-IP   EXTERNAL-IP     PORT(S)                     AGE
hub           ClusterIP     10.0.10.209  <none>          8081/TCP                    12h
proxy-api     ClusterIP     10.0.10.213  <none>          8001/TCP                    12h
proxy-public  LoadBalancer  10.0.2.67    36.223.155.214  80:32237/TCP,443:32317/TCP  12h

==> v1/ServiceAccount
NAME            SECRETS  AGE
hub             1        12h
user-scheduler  1        12h

==> v1/StatefulSet
NAME              READY  AGE
user-placeholder  0/0    12h

==> v1beta1/PodDisruptionBudget
NAME              MIN AVAILABLE  MAX UNAVAILABLE  ALLOWED DISRUPTIONS  AGE
hub               1              N/A              0                    12h
proxy             1              N/A              0                    12h
user-placeholder  0              N/A              0                    12h
user-scheduler    1              N/A              1                    12h


NOTES:
Thank you for installing JupyterHub!

Your release is named jhub and installed into the namespace jhub.

You can find if the hub and proxy is ready by doing:

 kubectl --namespace=jhub get pod

and watching for both those pods to be in status 'Running'.

You can find the public IP of the JupyterHub by doing:

 kubectl --namespace=jhub get svc proxy-public

It might take a few minutes for it to appear!

Note that this is still an alpha release! If you have questions, feel free to
  1. Read the guide at https://z2jh.jupyter.org
  2. Chat with us at https://gitter.im/jupyterhub/jupyterhub
  3. File issues at https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues

Unfortunately, there is still nothing in /home/test-templates/ and there is nothing change with login page. BTW, I was using google cloud kubernetes. Any kind suggestions?

1 Like