k8s提供多種volume接口,其中local 和host path是容易混淆的兩個接口。下面這篇文章解釋了兩者的區別:
https://groups.google.com/forum/#!topic/kubernetes-users/68Yvm8ZkztI
關鍵內容:
Both use local disks available on a machine. But! Imagine you have a cluster of three machines and have a Deployment with a replica of 1. If your pod is scheduled on node A, writes to a host path, then the pod is destroyed. At this point the scheduler will need to create a new pod, and this pod might be scheduled to node C which doesn't have the data. Oops!
Local volumes fix this by ensuring a pod is scheduled to the machine where the data exists.