Scenario:
Example:
kube-system docker-registry-############################### 1/1 Running 0 529d ##.##.##.## ############################### <none> <none>kube-system docker-registry-############################### 0/1 ContainerCreating 0 6h51m ##.##.##.## ############################### <none> <none>kube-system docker-registry-############################### 1/1 Running 0 529d ##.##.##.## ############################### <none> <none>
Warning FailedMount 7m50s (x168 over 5h33m) kubelet MountVolume.SetUp failed for volume "storage-container-registry" : hostPath type check failed: /storage/container-registry is not a directory
ssh to the Supervisor control plane node and check for that directory it does not exist:$ ls -l /storage/container-registry
ls: cannot access '/storage/container-registry': No such file or directory
VMware vSphere Kubernetes Service
If there is a system-related issue or the registry was created manually or recreated, this behavior is by design:
The type: Directory option enforces that the path must already be a directory on the host; it will not create the directory for you.
If you want Kubernetes to create the directory automatically if it does not exist, you must use type: DirectoryOrCreate instead.
ssh to the affected Supervisor control plane node# sudo mkdir -p /storage/container-registry
# chmod 0755 /storage
# chmod 0755 /storage/container-registry
# kubectl delete pod -n kube-system docker-registry-###############################