Minikube volumes

Here is the answer from a Minikube contributer, confirming there was a problem in the documentation :

I've reworded the readme to make a little more sense.

The host is the computer you're running minikube on. This is only exposed to the VM through the mounted host folders https://github.com/kubernetes/minikube/blob/master/docs/host_folder_mount.md

The guest, or minikube VM, will persist certain folders to a disk stored on the host (something like ~/.minikube/machines/minikube/disk.vmdk). Files stored in certain directories in the minikube VM will persist between start/stops, but not deletes.

source : https://github.com/kubernetes/minikube/issues/1184


This is covered in the documentation. The relevant section starts right after the sentence that you've already quoted:

However, Minikube is configured to persist files stored under the following host directories:

  • /data
  • /var/lib/localkube
  • /var/lib/docker

Here is an example PersistentVolume config to persist data in the ‘/data’ directory:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv0001
spec:
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 5Gi
  hostPath:
    path: /data/pv0001/

Simply declare hostPath volumes that are mapped to any directory in /data on the host, and these should persist across reboots.