2
votes

In kubernetes, is there a way to mount hostPath volume after pod got started?

1
I doubt. But why would you want to do that? what's the use case?Tarun Lalwani
Thanks Tarun, I am running my workflow scheduler on k8s, I want to allow application developers to deploy their apps at runtime. Some of the developers like to install application binaries on host(due to huge size) and mount it inside container.banjara
Updating the pod definition and running it would do it, but would restart the pod. Any reason that doesn't work for you?Tarun Lalwani
Thanks @TarunLalwani, this will also restart application processes running inside workflow scheduler.banjara

1 Answers

0
votes

There is no way to add a volume to a running Docker container, so Kubernetes has no way to add a volume to a running Pod. Modifying the Pod to include a new hostPath volume will recreate the container(s) in the Pod and mount the volumes as specified.