LoginSignup
0
0

More than 1 year has passed since last update.

hostPath type check failed: is not a directoryエラーの対処方法(type: Directoryの場合)

Posted at

Kubernetes (k8s)のDeploymentにてローカルドライブのディレクトリをPVとして指定した際に以下のエラーでPodが作成されなかった。

MountVolume.SetUp failed for volume "local-jupyter-dir" : hostPath type check failed: /home/xxxxxx/k8s/jupyter/drive is not a directory

エラーメッセージでは指定したパスはディレクトリではないと言っているが、実際にはちゃんとディレクトリであり、かつhostPathのtypeとして"Directory"を明記していた場合には、このtype: Directoryをコメントアウトするとうまく動いた。

具体的にはdeploymentのyaml該当箇所を以下のように変更(コメントアウト)。

      volumes:
      - name: local-jupyter-dir
        hostPath:
          path: /home/xxxxxx/k8s/jupyter/drive
          # type: Directory <-この行をコメントアウト
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