0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

コンテナ上のJupyterHubの死活監視について調べてみた

Last updated at Posted at 2020-12-21

JupyterHubをKubernetes上で動かすことになり、どのような死活監視できるか調べてみた。
こういった機能はAPIベースで提供することが求められており、yamlにてその定義が行われているようだ。

設定箇所を調べてみると、jupyterhubのdeployment.yamlに記載があった。
kubernetes用のパッケージマネージャであるhelm(version 0.10.0)の中を見てみる。

jupyterhub-0.10.0/jupyterhub/templates/hub/deployment.yaml

          # 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 }}
            timeoutSeconds: {{ .Values.hub.livenessProbe.timeoutSeconds }}
            failureThreshold: {{ .Values.hub.livenessProbe.failureThreshold }}
            httpGet:
              path: {{ .Values.hub.baseUrl | trimSuffix "/" }}/hub/health
              port: http
          {{- end }}
          {{- if .Values.hub.readinessProbe.enabled }}

http://サーバIP:ポート/hub/health で監視できるようだ。
やってみる。HTTPレスポンス200番で帰ってきた。

[xxxx@localhost container]$ curl http://localhost:32546/hub/health -v
> GET /hub/health HTTP/1.1
> Host: localhost:32546
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
< server: TornadoServer/6.0.4
< content-type: text/html
< date: Mon, 21 Dec 2020 07:55:48 GMT
< x-jupyterhub-version: 1.2.1
< access-control-allow-headers: accept, content-type, authorization
< content-security-policy: frame-ancestors 'self'; report-uri /hub/security/csp-report
< etag: "da39a3ee5e6b4b0d3255bfef95601890afd80709"
< content-length: 0
< connection: close
<
* Closing connection 0

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?