diff --git a/jupyterhub/templates/hub/deployment.yaml b/jupyterhub/templates/hub/deployment.yaml index f20962a8ab..d678ca1386 100644 --- a/jupyterhub/templates/hub/deployment.yaml +++ b/jupyterhub/templates/hub/deployment.yaml @@ -194,19 +194,26 @@ spec: ports: - containerPort: 8081 name: hub - ## livenessProbe notes: - ## We don't know how long hub database upgrades could take - ## so having a liveness probe could be a bit risky unless we put - ## a initialDelaySeconds value with long enough margin for that - ## to not be an issue. If it is too short, we could end up aborting - ## database upgrades midway or ending up in an infinite restart - ## loop. - # livenessProbe: - # initialDelaySeconds: 30 - # httpGet: - # path: {{ .Values.hub.baseUrl }}hub/health - # port: hub + {{- if .Values.hub.livenessProbe.enabled }} + # livenessProbe notes: + # We don't know how long hub database upgrades could take + # so having a liveness probe could be a bit risky unless we put + # a initialDelaySeconds value with long enough margin for that + # to not be an issue. If it is too short, we could end up aborting + # database upgrades midway or ending up in an infinite restart + # loop. + livenessProbe: + initialDelaySeconds: {{ .Values.hub.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.hub.livenessProbe.periodSeconds }} + httpGet: + path: {{ .Values.hub.baseUrl }}hub/health + port: hub + {{- end }} + {{- if .Values.hub.readinessProbe.enabled }} readinessProbe: + initialDelaySeconds: {{ .Values.hub.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.hub.readinessProbe.periodSeconds }} httpGet: path: {{ .Values.hub.baseUrl }}hub/health port: hub + {{- end }} diff --git a/jupyterhub/templates/proxy/deployment.yaml b/jupyterhub/templates/proxy/deployment.yaml index 13543b4454..b53f181456 100644 --- a/jupyterhub/templates/proxy/deployment.yaml +++ b/jupyterhub/templates/proxy/deployment.yaml @@ -105,7 +105,10 @@ spec: name: proxy-public - containerPort: 8001 name: api + {{- if .Values.proxy.chp.livenessProbe.enabled }} livenessProbe: + initialDelaySeconds: {{ .Values.proxy.chp.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.proxy.chp.livenessProbe.periodSeconds }} httpGet: path: /_chp_healthz {{- if or $manualHTTPS $manualHTTPSwithsecret }} @@ -115,7 +118,11 @@ spec: port: proxy-public scheme: HTTP {{- end }} + {{- end }} + {{- if .Values.proxy.chp.readinessProbe.enabled }} readinessProbe: + initialDelaySeconds: {{ .Values.proxy.chp.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.proxy.chp.readinessProbe.periodSeconds }} httpGet: path: /_chp_healthz {{- if or $manualHTTPS $manualHTTPSwithsecret }} @@ -125,3 +132,4 @@ spec: port: proxy-public scheme: HTTP {{- end }} + {{- end }} diff --git a/jupyterhub/values.yaml b/jupyterhub/values.yaml index 76a12271e3..ecc6574822 100644 --- a/jupyterhub/values.yaml +++ b/jupyterhub/values.yaml @@ -79,7 +79,14 @@ hub: shutdownOnLogout: templatePaths: [] templateVars: {} - + livenessProbe: + enabled: false + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + enabled: true + initialDelaySeconds: 0 + periodSeconds: 10 rbac: enabled: true @@ -125,6 +132,14 @@ proxy: image: name: jupyterhub/configurable-http-proxy tag: 4.2.0 + livenessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + enabled: true + initialDelaySeconds: 0 + periodSeconds: 10 resources: requests: cpu: 200m