<p>Do you know if it is possible to mount a local folder to a Kubernetes running container.</p>

<p>Like <code>docker run -it -v .:/dev some-image bash</code> I am doing this on my local machine and then remote debug into the container from VS Code.</p>

<p>Update: This might be a solution: <code>telepresence</code>
Link: <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/local-debugging/" rel="noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/local-debugging/</a></p>

<p>Do you know it it is possible to mount a local computer to Kubernetes. This container should have access to a Cassandra IP address.</p>

<p>Do you know if it is possible?</p>

<h1>Kubernetes Volume</h1>
<p>Using <strong>hostPath</strong> would be a solution: <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#hostpath</a></p>
<p>However, it will only work if your cluster runs on the same machine as your mounted folder.</p>
<p>Another but probably slightly over-powered method would be to use a <strong>distributed or parallel filesystem</strong> and mount it into your container as well as to mount it on your local host machine. An example would be CephFS which allows multi-read-write mounts. You could start a ceph cluster with rook: <a href="https://github.com/rook/rook" rel="nofollow noreferrer">https://github.com/rook/rook</a></p>
<h1>Kubernetes Native Dev Tools with File Sync Functionality</h1>
<p>A solution would be to use a dev tool that allows you to sync the contents of the local folder to the folder inside a kubernetes pod. There, for example, is <strong>ksync</strong>: <a href="https://github.com/vapor-ware/ksync" rel="nofollow noreferrer">https://github.com/vapor-ware/ksync</a></p>
<p>I have tested ksync and many kubernetes native dev tools (e.g. telepresence, skaffold, draft) but I found them very hard to configure and time-consuming to use. That's why I created an open source project called <strong>DevSpace</strong> together with a colleague: <strong><a href="https://github.com/loft-sh/devspace" rel="nofollow noreferrer">https://github.com/loft-sh/devspace</a></strong></p>
<p>It allows you to configure a real-time two-way sync between local folders and folders within containers running inside k8s pods. It is the only tool that is able to let you use <strong>hot reloading</strong> tools such as nodemon for nodejs. It works with volumes as well as with ephemeral / non-persistent folders and lets you directly enter the containers similar to kubectl exec and much more. <strong>It works with minikube and any other self-hosted or cloud-based kubernetes clusters.</strong></p>
<p>Let me know if that helps you and feel free to open an issue if you are missing something you need for your optimal dev workflow with Kubernetes. We will be happy to work on it.</p>
