diff --git a/helm-chart/images/binderhub/binderhub_config.py b/helm-chart/binderhub/files/binderhub_config.py similarity index 100% rename from helm-chart/images/binderhub/binderhub_config.py rename to helm-chart/binderhub/files/binderhub_config.py diff --git a/helm-chart/binderhub/templates/configmap.yaml b/helm-chart/binderhub/templates/configmap.yaml index 2948c6fb9..1cb9cf0f8 100644 --- a/helm-chart/binderhub/templates/configmap.yaml +++ b/helm-chart/binderhub/templates/configmap.yaml @@ -19,3 +19,6 @@ data: values.yaml: | {{- $values | toYaml | nindent 4 }} + {{- /* Glob files to allow them to be mounted by the binderhub pod */ -}} + {{- /* key=filename: value=content */ -}} + {{- (.Files.Glob "files/*").AsConfig | nindent 2 }} diff --git a/helm-chart/binderhub/templates/deployment.yaml b/helm-chart/binderhub/templates/deployment.yaml index 4abfd9d81..788527e43 100644 --- a/helm-chart/binderhub/templates/deployment.yaml +++ b/helm-chart/binderhub/templates/deployment.yaml @@ -64,6 +64,9 @@ spec: containers: - name: binder image: {{ .Values.image.name }}:{{ .Values.image.tag }} + args: + - --config + - /etc/binderhub/config/binderhub_config.py volumeMounts: - mountPath: /etc/binderhub/config/ name: config diff --git a/helm-chart/images/binderhub/Dockerfile b/helm-chart/images/binderhub/Dockerfile index 9e42b171c..d44135762 100644 --- a/helm-chart/images/binderhub/Dockerfile +++ b/helm-chart/images/binderhub/Dockerfile @@ -38,11 +38,7 @@ RUN pip install --no-cache-dir \ *.whl \ -r requirements.txt -# Copy the binderhub configuration to use. -# FUTURE: Follow the approach taken in Z2JH: -# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/pull/1478 -COPY helm-chart/images/binderhub/binderhub_config.py . - -CMD ["python3", "-m", "binderhub"] +ENTRYPOINT ["python3", "-m", "binderhub"] +CMD ["--config", "/etc/binderhub/config/binderhub_config.py"] ENV PYTHONUNBUFFERED=1 EXPOSE 8585