Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy jupyterhub-configurator #316

Merged
merged 4 commits into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hub-templates/base-hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ appVersion: '1.0'
description: Deployment Chart for JupyterHub
name: base-hub
# Let's keep this constant so other charts in this repo can depend on this easily
version: 0.0.1
version: 0.0.1-n534.h0a5b959
dependencies:
- name: jupyterhub
- name: jupyterhub
# REMEMBER TO CHANGE BASE IMAGE OF images/hub/ WHEN CHANGING THIS
version: 0.11.1-n277.h61b0e003
repository: https://jupyterhub.github.io/helm-chart/
version: 0.11.1-n277.h61b0e003
repository: https://jupyterhub.github.io/helm-chart/
16 changes: 16 additions & 0 deletions hub-templates/base-hub/templates/configurator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: configurator
labels:
app: jupyterhub
component: configurator
spec:
type: ClusterIP
ports:
- name: http
port: 10101
targetPort: 10101
selector:
app: jupyterhub
component: hub
55 changes: 44 additions & 11 deletions hub-templates/base-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ jupyterhub:
singleuser:
admin:
extraVolumeMounts:
- name: home
mountPath: /home/jovyan/shared-readwrite
subPath: _shared
- name: home
mountPath: /home/jovyan/shared-readwrite
subPath: _shared
startTimeout: 600 # 10 mins, because sometimes we have too many new nodes coming up together
defaultUrl: /tree
extraNodeAffinity:
preferred:
- weight: 100
preference:
matchExpressions:
- key: hub.jupyter.org/pool-name
operator: In
values: [user-pool]
- key: hub.jupyter.org/pool-name
operator: In
values: [user-pool]
image:
name: set_automatically_by_automation
tag: 638350c
Expand All @@ -103,10 +103,10 @@ jupyterhub:
pvcName: home-nfs
subPath: '{username}'
extraVolumeMounts:
- name: home
mountPath: /home/jovyan/shared
subPath: _shared
readOnly: true
- name: home
mountPath: /home/jovyan/shared
subPath: _shared
readOnly: true
memory:
guarantee: 256M
limit: 1G
Expand All @@ -127,6 +127,16 @@ jupyterhub:
- port: 443
protocol: TCP
hub:
services:
configurator:
url: http://configurator:10101
command:
- python3
- -m
- jupyterhub_configurator.app
image:
name: quay.io/2i2c/pilot-hub
tag: '0.0.1-n534.h0a5b959'
config:
JupyterHub:
authenticator_class: oauthenticator.generic.GenericOAuthenticator
Expand All @@ -135,6 +145,26 @@ jupyterhub:
networkPolicy:
enabled: true
ingress:
- from:
- podSelector:
matchLabels:
app: jupyterhub
component: hub
ports:
- port: 8081
protocol: TCP
- from:
- podSelector:
matchLabels:
app: jupyterhub
component: proxy
- podSelector:
matchLabels:
app: jupyterhub
component: hub
ports:
- port: 10101
protocol: TCP
- from:
- namespaceSelector:
matchLabels:
Expand Down Expand Up @@ -179,7 +209,9 @@ jupyterhub:
05-custom-admin: |
from z2jh import get_config
from kubespawner import KubeSpawner
class CustomSpawner(KubeSpawner):
from jupyterhub_configurator.mixins import ConfiguratorSpawnerMixin

class CustomSpawner(ConfiguratorSpawnerMixin, KubeSpawner):
def start(self, *args, **kwargs):
custom_admin = get_config('singleuser.admin', {})
if custom_admin and self.user.admin:
Expand All @@ -191,6 +223,7 @@ jupyterhub:

return super().start(*args, **kwargs)


c.JupyterHub.spawner_class = CustomSpawner

06-custom-authenticator: |
Expand Down
6 changes: 6 additions & 0 deletions hub-templates/chartpress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
charts:
- name: base-hub
imagePrefix: quay.io/2i2c/pilot-
images:
hub:
valuesPath: jupyterhub.hub.image
7 changes: 7 additions & 0 deletions hub-templates/images/hub/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Should match the hub image used by version of chart in hub/requirements.yaml
# If that changes, this should be changed too!
FROM jupyterhub/k8s-hub:0.11.1-n298.hd9d7403b

ENV CONFIGURATOR_VERSION 746e7285af40b9bafd227dae3f2e41d1a631a301

RUN pip install --no-cache git+https://github.com/yuvipanda/jupyterhub-configurator@${CONFIGURATOR_VERSION}