Kubernetes persistent volume on Docker Desktop (Windows)

瘦欲@ 提交于 2020-01-15 12:07:35

问题


I'm using Docker Desktop on Windows 10. For the purposes of development, I want to expose a local folder to a container. When running the container in Docker, I do this by specifying the volume flag (-v).

How do I achieve the same when running the container in Kubernetes?


回答1:


You should use hostpath Volume type in your pod`s spec to mount a file or directory from the host node’s filesystem, where hostPath.path field should be of following format to accept Windows like paths:

  • /W/fooapp/influxdb
  • //W/fooapp/influxdb
  • /////W/fooapp/influxdb

Please check this github issue explaining peculiarities of Kubernetes Volumes on Windows. I assume also that you have enabled Shared Drives feature in your Docker for Windows installation.



来源:https://stackoverflow.com/questions/54073794/kubernetes-persistent-volume-on-docker-desktop-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!