diff --git a/hub-templates/base-hub/Chart.yaml b/hub-templates/base-hub/Chart.yaml index 171f11658..0158d7566 100644 --- a/hub-templates/base-hub/Chart.yaml +++ b/hub-templates/base-hub/Chart.yaml @@ -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/ diff --git a/hub-templates/base-hub/templates/configurator.yaml b/hub-templates/base-hub/templates/configurator.yaml new file mode 100644 index 000000000..c2b3cc611 --- /dev/null +++ b/hub-templates/base-hub/templates/configurator.yaml @@ -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 diff --git a/hub-templates/base-hub/values.yaml b/hub-templates/base-hub/values.yaml index 4b0de6e60..8f4ae705f 100644 --- a/hub-templates/base-hub/values.yaml +++ b/hub-templates/base-hub/values.yaml @@ -81,9 +81,9 @@ 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: @@ -91,9 +91,9 @@ jupyterhub: - 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 @@ -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 @@ -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 @@ -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: @@ -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: @@ -191,6 +223,7 @@ jupyterhub: return super().start(*args, **kwargs) + c.JupyterHub.spawner_class = CustomSpawner 06-custom-authenticator: | diff --git a/hub-templates/chartpress.yaml b/hub-templates/chartpress.yaml new file mode 100644 index 000000000..a8796a24f --- /dev/null +++ b/hub-templates/chartpress.yaml @@ -0,0 +1,6 @@ +charts: + - name: base-hub + imagePrefix: quay.io/2i2c/pilot- + images: + hub: + valuesPath: jupyterhub.hub.image diff --git a/hub-templates/images/hub/Dockerfile b/hub-templates/images/hub/Dockerfile new file mode 100644 index 000000000..a000912d1 --- /dev/null +++ b/hub-templates/images/hub/Dockerfile @@ -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}