kubernetes で ContainerCreating (FailedMount) で Pod が起動しない時

投稿者: ytyng 4 年, 10 ヶ月 前

環境: kubernetes  v1.13.5 (rancher)

kubernetes で Pod が起動せず、

kubectl get pods を見てみると

$ kubectl get pods
NAME READY STATUS RESTARTS AGE
d-ytyng-com-deployment-755c9d8dcb-9j7dn 0/1 ContainerCreating 0 8m24s
php56-alpine-deployment-799dbf8d6f-x2gfj 0/1 ContainerCreating 0 8m24s

こんな感じで ContainerCreating で止まっている。

kubectl describe pods を見てみると

Warning FailedMount 6s (x7 over 38s) kubelet, <cluster-name> MountVolume.SetUp failed for volume "src" : hostPath type check failed: /xxx/xxx/src is not a directory

このように Warning が出ている。

ただし、/xxx/xxx/src のパスは存在する。

その時は、マニフェストyaml で

volumes:
- name: src
hostPath:
path: /xxx/xxx/src
type: Directory

こうなっているところの、

type: Directory

を消してしまうといい

参考:

docker - MountVolume.SetUp failed for volume "mongo" : hostPath type check failed: /mongo/data is not a directory - Stack Overflow
https://stackoverflow.com/questions/48927312/mountvolume-setup-failed-for-volume-mongo-hostpath-type-check-failed-mongo

現在の評価: 4

コメント

アーカイブ

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011