Does Kubernetes mount an emtpyDir volume on the host?

前端 未结 2 1330
独厮守ぢ
独厮守ぢ 2021-01-02 08:10

Kubernetes features quite a few types of volumes, including emptyDir:

An emptyDir volume is first created when a Pod is assigned to a Node,

2条回答
  •  星月不相逢
    2021-01-02 09:16

    Yes it is also accessible on the node. It is bind mounted into the container (sort of). The source directories are under /var/lib/kubelet/pods/PODUID/volumes/kubernetes.io~empty-dir/VOLUMENAME

    You can find the location on the host like this:

    sudo ls -l /var/lib/kubelet/pods/`kubectl get pod -n mynamespace mypod -o 'jsonpath={.metadata.uid}'`/volumes/kubernetes.io~empty-dir
    

提交回复
热议问题