<p>I have an mysql container I'm deploying through k8s in which I am mounting a directory which contains a script, once the pod is up and running the plan is to execute that script.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
spec:
   replicas: 1
   template:
      spec:
         volumes:
           - name: mysql-stuff
             hostPath:
                path: /home/myapp/scripts
                type: Directory
         containers:
           - name: mysql-db
             image: mysql:latest
             volueMounts:
               - name: mysql-stuff
                 mountPath: /scripts/
</code></pre>
<p>Once I have it up and running and run <code>kubectl exec -it mysql-db -- bin/sh</code> and <code>ls scripts</code> it returns nothing and the script that should be inside it is not there and I can't work out why.. For the sake of getting this working I have added no security context and am running the container as root. Any help would be greatly appreciated.</p>

SkinnyBetas
<p>Since you are running your pod in a minikube cluster. Minikube itself is running in a VM , so the path mapping here implies the path of minikube VMs not your actual host.</p>
<p>However you can map your actual host path to the minikube path and then it will become accessible.</p>
<pre><code>minikube mount /home/myapp/scripts:/home/myapp/scripts
</code></pre>
<p>See more here
<a href="https://minikube.sigs.k8s.io/docs/handbook/mount/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/mount/</a></p>
