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

WIP: Allow BinderHub to work with an existing JupyterHub #1862

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ jobs:
--values tools/templates/lint-and-validate-values.yaml \
--set imageBuilderType=pink

- name: "Helm template --validate for standalone jupyterhub (with lint-and-validate-values.yaml)"
if: matrix.test == 'helm'
run: |
helm template --validate binderhub-test helm-chart/binderhub \
--values tools/templates/lint-and-validate-values.yaml \
--set jupyterhub.enabled=false

- name: Validate the chart against the k8s API
if: matrix.test == 'helm'
run: |
Expand Down
1 change: 1 addition & 0 deletions helm-chart/binderhub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- name: jupyterhub
version: "3.3.7"
repository: "https://jupyterhub.github.io/helm-chart"
condition: jupyterhub.enabled
description: |-
BinderHub is like a JupyterHub that automatically builds environments for the
users based on repo2docker. A BinderHub is by default not configured to
Expand Down
8 changes: 8 additions & 0 deletions helm-chart/binderhub/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ spec:
{{- . | toYaml | nindent 8 }}
{{- end }}
spec:
{{- if .Values.jupyterhub.enabled }}
{{- with include "jupyterhub.imagePullSecrets" (dict "root" . "image" .Values.image) }}
imagePullSecrets: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- . | toYaml | nindent 8 }}
Expand Down Expand Up @@ -119,11 +121,13 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.jupyterhub.enabled }}
- name: JUPYTERHUB_API_TOKEN
valueFrom:
secretKeyRef:
name: "{{ include "jupyterhub.hub.fullname" . }}"
key: hub.services.binder.apiToken
{{- end }}
{{- if .Values.config.BinderHub.auth_enabled }}
- name: JUPYTERHUB_SERVICE_NAME
value: binder
Expand All @@ -142,9 +146,13 @@ spec:
value: {{ .Values.jupyterhub.hub.namedServerLimitPerUser | quote }}
{{- end }}
{{- end }}
{{- if .Values.jupyterhub.enabled }}
{{- with .Values.extraEnv }}
{{- include "jupyterhub.extraEnv" . | nindent 8 }}
{{- end }}
{{- else }}
{{ . | toYaml | nindent 8 }}
{{- end }}
ports:
- containerPort: 8585
name: binder
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/binderhub/templates/image-cleaner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ spec:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- if .Values.jupyterhub.enabled }}
{{- with include "jupyterhub.imagePullSecrets" (dict "root" . "image" .Values.imageCleaner.image) }}
imagePullSecrets: {{ . }}
{{- end }}
{{- end }}
tolerations:
- effect: NoSchedule
key: hub.jupyter.org/dedicated
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/binderhub/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ stringData:
{{- /* key=filename: value=content */}}
{{- (.Files.Glob "files/*").AsConfig | nindent 2 }}

{{- if .Values.jupyterhub.enabled }}
{{- with include "jupyterhub.extraFiles.stringData" .Values.extraFiles }}
{{- . | nindent 2 }}
{{- end }}
Expand All @@ -30,6 +31,7 @@ stringData:
data:
{{- . | nindent 2 }}
{{- end }}
{{- end }}
---
{{- if or .Values.config.BinderHub.use_registry .Values.config.BinderHub.buildDockerConfig }}
kind: Secret
Expand Down
1 change: 1 addition & 0 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extraPodSpec: {}
# likely want to set both of those to the same value.

jupyterhub:
enabled: true
# Deprecated values, kept here so we can provide useful error messages
custom:
cors: {}
Expand Down
1 change: 1 addition & 0 deletions tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extraConfig:
dummy binderhub python code ...

jupyterhub:
enabled: true
cull:
enabled: true
users: true
Expand Down
Loading