I\'m trying to configure a hostPath to launch Mongodb pod.
I have only one node of kubernetes v1.8.5 installed with rancher last stable version.
I have creat
You are creating the docker container directly on the master node. As a result of this you could be able to run docker container with the newly created directory. But when you launch the kubernetes yaml file, it intends to run on a worker node. Since you create the directory on the master node, kubelet cannot find directory on worker node and failing. That's why "DirectoryorCreate" value on type flag is a kind of solution for this.