Skip to content

Instantly share code, notes, and snippets.

@berceanu
Last active September 30, 2022 20:24
Show Gist options
  • Save berceanu/01258d61b82b4a63d00f5db811e8d877 to your computer and use it in GitHub Desktop.
Save berceanu/01258d61b82b4a63d00f5db811e8d877 to your computer and use it in GitHub Desktop.
Zero to JupyterHub with Kubernetes: main configuration file
# This file can update the JupyterHub Helm chart's default configuration values.
#
# For reference see the configuration reference and default values, but make
# sure to refer to the Helm chart version of interest to you!
#
# Introduction to YAML: https://www.youtube.com/watch?v=cdLNKUoMc6c
# Chart config reference: https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# Chart default values: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# Available chart versions: https://jupyterhub.github.io/helm-chart/
#
proxy:
service:
loadBalancerIP: 192.168.1.176
hub:
config:
Authenticator:
admin_users:
- berceanu
allowed_users:
- vadimbim
DummyAuthenticator:
password: 10WcvtE2WkW9boL
JupyterHub:
authenticator_class: dummy
singleuser:
# Defines the default image
image:
name: jupyter/scipy-notebook
tag: x86_64-73d25bd3d557
profileList:
- display_name: "Scipy environment"
description: "Includes popular packages from the scientific Python ecosystem."
default: true
- display_name: "Machine Learning environment"
description: "Additional ML libraries and GPU support."
kubespawner_override:
extra_resource_limits:
nvidia.com/gpu: "1"
image: berceanu/bayesian-notebook:43b5bc53dd2a
# use microk8s 1.24
# to install jupyterhub
microk8s.helm3 upgrade --cleanup-on-fail \
--install jupyterhub-release jupyterhub/jupyterhub \
--namespace jupyter-hub-ns \
--create-namespace \
--version=2.0.0 \
--values config.yaml \
--timeout=20m
# to monitor
microk8s.kubectl get pod --namespace jupyter-hub-ns
# after each update of config.yaml, run:
microk8s.helm3 upgrade --cleanup-on-fail \
jupyterhub-release jupyterhub/jupyterhub \
--namespace jupyter-hub-ns \
--version=2.0.0 \
--values config.yaml \
--timeout=20m
# to delete
microk8s.helm3 delete jupyterhub-release
microk8s.kubectl delete namespace jupyter-hub-ns
## local-storage-dir.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage-dir
annotations:
storageclass.kubernetes.io/is-default-class: "true"
openebs.io/cas-type: local
cas.openebs.io/config: |
- name: StorageType
value: hostpath
- name: BasePath
value: /home/berceanu/storage
provisioner: openebs.io/local
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment