---
slug: "kubernetes-ContainerCreating-FailedMount"
title: "kubernetes で ContainerCreating (FailedMount) で Pod が起動しない時"
description: "Kubernetes で Pod が `ContainerCreating` のまま進まず、`FailedMount` イベントが出ているときに確認すべき設定 (Secret / ConfigMap / PVC の参照ミスや RBAC 不足)。"
url: "https://www.ytyng.com/blog/kubernetes-ContainerCreating-FailedMount"
publish_date: "2019-05-18T16:14:49Z"
created: "2019-05-18T16:14:49Z"
updated: "2026-05-11T13:21:27.966Z"
categories: []
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/228744ee7a18420e8a42e04e60a8cb80.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "ja"
---

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

<p>環境: kubernetes&nbsp;&nbsp;<span>v1.13.5 (rancher)</span></p>
<p></p>
<p>kubernetes で Pod が起動せず、</p>
<p>kubectl get pods を見てみると</p>
<pre>$ kubectl get pods<br />NAME READY STATUS RESTARTS AGE<br />d-ytyng-com-deployment-755c9d8dcb-9j7dn 0/1 ContainerCreating 0 8m24s<br />php56-alpine-deployment-799dbf8d6f-x2gfj 0/1 ContainerCreating 0 8m24s</pre>
<p>こんな感じで ContainerCreating で止まっている。</p>
<p>kubectl describe pods を見てみると</p>
<p></p>
<pre>Warning FailedMount 6s (x7 over 38s) kubelet, &lt;cluster-name&gt; MountVolume.SetUp failed for volume "src" : hostPath type check failed: /xxx/xxx/src is not a directory</pre>
<p>このように Warning が出ている。</p>
<p>ただし、/xxx/xxx/src のパスは存在する。</p>
<p></p>
<p>その時は、マニフェストyaml で</p>
<pre><span>volumes</span>:<br />  - <span>name</span>: src<br />    <span>hostPath</span>:<br />      <span>path</span>: <span>/xxx/xxx/src</span><br />      <span>type</span>: Directory</pre>
<p>こうなっているところの、</p>
<pre><span>type</span>: Directory</pre>
<p>を消してしまうといい</p>
<p></p>
<p>参考:</p>
<p>docker - MountVolume.SetUp failed for volume "mongo" : hostPath type check failed: /mongo/data is not a directory - Stack Overflow<br /><a href="https://stackoverflow.com/questions/48927312/mountvolume-setup-failed-for-volume-mongo-hostpath-type-check-failed-mongo">https://stackoverflow.com/questions/48927312/mountvolume-setup-failed-for-volume-mongo-hostpath-type-check-failed-mongo</a></p>
<p></p>
