From 11d0ffa24507d3f944dea83be17a2e062632a0b4 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 27 Apr 2023 12:52:01 +0200 Subject: [PATCH 1/5] maint: don't use low-numbered container port for binderhub --- binderhub-service/templates/deployment.yaml | 2 +- binderhub-service/values.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/binderhub-service/templates/deployment.yaml b/binderhub-service/templates/deployment.yaml index 8a05b1a..af93367 100644 --- a/binderhub-service/templates/deployment.yaml +++ b/binderhub-service/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: {{- end }} ports: - name: http - containerPort: {{ .Values.service.port }} + containerPort: {{ .Values.config.BinderHub.port }} volumeMounts: - name: secret mountPath: /etc/binderhub/mounted-secret/ diff --git a/binderhub-service/values.yaml b/binderhub-service/values.yaml index f909ead..56b3f83 100644 --- a/binderhub-service/values.yaml +++ b/binderhub-service/values.yaml @@ -21,6 +21,7 @@ global: {} config: BinderHub: base_url: / + port: 8585 use_registry: true KubernetesBuildExecutor: docker_host: /var/run/docker-api/docker-api.sock From d5a0abe498388cdf072f7e335756ac2f95c21d38 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 27 Apr 2023 12:52:32 +0200 Subject: [PATCH 2/5] maint: set docker-api path from file-system root --- binderhub-service/templates/docker-api/daemonset.yaml | 2 +- binderhub-service/values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/binderhub-service/templates/docker-api/daemonset.yaml b/binderhub-service/templates/docker-api/daemonset.yaml index f0c7f46..92811d8 100644 --- a/binderhub-service/templates/docker-api/daemonset.yaml +++ b/binderhub-service/templates/docker-api/daemonset.yaml @@ -27,7 +27,7 @@ spec: - dockerd - --data-root=/var/lib/docker-api - --exec-root=/var/run/docker-api - - --host=unix://var/run/docker-api/docker-api.sock + - --host=unix:///var/run/docker-api/docker-api.sock volumeMounts: - name: data mountPath: /var/lib/docker-api diff --git a/binderhub-service/values.yaml b/binderhub-service/values.yaml index 56b3f83..ef64fc7 100644 --- a/binderhub-service/values.yaml +++ b/binderhub-service/values.yaml @@ -24,6 +24,8 @@ config: port: 8585 use_registry: true KubernetesBuildExecutor: + # docker_host must not be updated, assumptions about it are hardcoded in + # docker-api/daemonset.yaml docker_host: /var/run/docker-api/docker-api.sock extraConfig: {} From ed8a7c7255ed8e6f615b43c9ab1814c2362e9d13 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 27 Apr 2023 12:53:26 +0200 Subject: [PATCH 3/5] Add comment about config that both software and chart consumes --- binderhub-service/values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/binderhub-service/values.yaml b/binderhub-service/values.yaml index ef64fc7..94e5549 100644 --- a/binderhub-service/values.yaml +++ b/binderhub-service/values.yaml @@ -18,6 +18,12 @@ global: {} # config.X.y sets c.X.y where X is a class and y is a configurable traitlet on # the class. # +# Some config must be set here, and not via extraConfig, as its referenced by +# the chart's template directly. +# +# - BinderHub.base_url (readinessProbe) +# - BinderHub.port (containerPort) +# config: BinderHub: base_url: / From 34e010311a9fa9b293f90220d1fc09998432d796 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 27 Apr 2023 12:54:12 +0200 Subject: [PATCH 4/5] Set BinderHub.require_build_only=true by default --- binderhub-service/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/binderhub-service/values.yaml b/binderhub-service/values.yaml index 94e5549..e650747 100644 --- a/binderhub-service/values.yaml +++ b/binderhub-service/values.yaml @@ -29,6 +29,7 @@ config: base_url: / port: 8585 use_registry: true + require_build_only: true KubernetesBuildExecutor: # docker_host must not be updated, assumptions about it are hardcoded in # docker-api/daemonset.yaml From 8b6f8fcc0876f5cb001b6954495082f84197c5c1 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 27 Apr 2023 13:09:38 +0200 Subject: [PATCH 5/5] Add startupProbe for binderhub-service pod --- binderhub-service/templates/deployment.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/binderhub-service/templates/deployment.yaml b/binderhub-service/templates/deployment.yaml index af93367..15c7962 100644 --- a/binderhub-service/templates/deployment.yaml +++ b/binderhub-service/templates/deployment.yaml @@ -42,6 +42,12 @@ spec: {{- .Values.resources | toYaml | nindent 12 }} securityContext: {{- .Values.securityContext | toYaml | nindent 12 }} + startupProbe: + periodSeconds: 1 + failureThreshold: 60 + httpGet: + path: {{ .Values.config.BinderHub.base_url }}/versions + port: http {{- with .Values.image.pullSecrets }} imagePullSecrets: {{- . | toYaml | nindent 8 }}