Kubernetes Minikube hostPath mount not reloading

3/4/2017

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?

-- skunkwerk
kubernetes
minikube

1 Answer

3/6/2017

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.

-- Norbert van Nobelen
Source: StackOverflow