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.

Z2JH8(Zero to Jupyter Hub)のhubポッドに対するsqlitedbストレージ設定

Posted at

JupyterNotebookを使う環境を構築したく、Z2JH(Zero to JupyterHub)をhelmを使って導入していたらsqlitedbを格納するディレクトリ設定に悩んだのでメモを残しておきます。

対象バージョン

 jupyterhub : 0.10.2
 (https://jupyterhub.github.io/helm-chart/jupyterhub-0.10.2.tgz)

公式ガイドを見ても設定ファイルが見当たらない

ガイド(https://zero-to-jupyterhub.readthedocs.io/en/0.10.2/resources/reference.html)を見ても、annotationなどの間接的な指定方法は記載あるものの、直接的に設定できる方法が見当たらなかった。

hub.db.pvc
 Customize the Persistent Volume Claim used when hub.db.type is sqlite-pvc.

hub.db.pvc.annotations
 Annotations to apply to the PVC containing the sqlite database.
 See the Kubernetes documentation for more details about annotations.

hub.db.pvc.selector
 Label selectors to set for the PVC containing the sqlite database.
 Useful when you are using a specific PV, and want to bind to that and only that.
 See the Kubernetes documentation for more details about using a label selector for what PV to bind to.

hub.db.pvc.storage
 Size of disk to request for the database disk.

設定ファイルを探ってみる

helmでは設定内容をリストアップすることができるので、やってみます。

# helm inspect values jupyterhub/jupyterhub

コマンド実行結果。storageClass:が設定できる事が見つかりました。

hub:
 <途中略>
  db:
    type: sqlite-pvc
    upgrade:
    pvc:
      annotations: {}
      selector: {}
      accessModes:
        - ReadWriteOnce
      storage: 1Gi
      subPath:
      storageClassName: ←ココ!

helmの設定ファイルに記載します。

config.yaml
hub:
  db:
    pvc:
      storageClassName: local-jupyter-hub-storage
      accessModes:
        - ReadWriteOnce
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?