Kubernetes Minikube hostPath mount not reloading

半世苍凉 提交于 2019-12-11 04:03:21

问题


I have a Kubernetes cluster running locally via Minikube.

I have a local folder on my Mac mounted via the hostPath volume config and accessible to the Docker container at the location: /code/bot

I can create a service and load the webpage just fine. But when I change the code and reload the page, it does not update. I have to delete and re-create the deployment for the code to refresh.

Is there any way to have mount be "live", so it refreshes automatically?


回答1:


A remark: (compiled) Code should be part of the container. You are not following the container design laid out for this, so you should expect side effects.

Having said that: You might have to restart your container when you change your code since your code is clearly not reloaded by your container.

Auto refreshing the mount depends on the application you use. Some applications realize a file-system has a changed file and will reload, in others you will have to code this yourself effectively going back to my restart remark.



来源:https://stackoverflow.com/questions/42591367/kubernetes-minikube-hostpath-mount-not-reloading

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