<p>I am trying to copy some directories into the minikube VM to be used by some of the pods that are running. These include API credential files and template files used at run time by the application. I have found you can copy files using scp into the <code>/home/docker/</code> directory, however these files are not persisted over reboots of the VM. I have read files/directories are persisted if stored in the <code>/data/</code> directory on the VM (among others) however I get <code>permission denied</code> when trying to copy files to these directories.</p>

<p>Are there:</p>

<p>A: Any directories in minikube that will persist data that aren't protected in this way</p>

<p>B: Any other ways of doing the above without running into this issue (could well be going about this the wrong way)</p>

<p>To clarify, I have already been able to mount the files from <code>/home/docker/</code> into the pods using volumes, so it's just the persisting data I'm unclear about.</p>

Sam White
<p>Kubernetes has dedicated object types for these sorts of things.  API credential files you might store in a <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">Secret</a>, and template files (if they aren't already built into your Docker image) could go into a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMap</a>.  Both of them can either get translated to environment variables or mounted as artificial volumes in running containers.</p>

<p>In my experience, trying to store data directly on a node isn't a good practice.  It's common enough to have multiple nodes, to not directly have login access to those nodes, and for them to be created and destroyed outside of your direct control (imagine an autoscaler running on a cloud provider that creates a new node when all of the existing nodes are 90% scheduled).  There's a good chance your data won't (or can't) be on the host where you expect it.</p>

<p>This does lead to a proliferation of Kubernetes objects and associated resources, and you might find a <a href="https://helm.sh" rel="nofollow noreferrer">Helm</a> chart to be a good resource to tie them together.  You can check the chart into source control along with your application, and deploy the whole thing in one shot.  While it has a couple of useful features beyond just packaging resources together (a deploy-time configuration system, a templating language for the Kubernetes YAML itself) you can ignore these if you don't need them and just write a bunch of YAML files and a small control file.</p>
