<p>I try to mount a linux directory as a shared directory for multiple containers in minikube.<br />
Here is my config:</p>
<p><code>minikube start --insecure-registry=&quot;myregistry.com:5000&quot; --mount --mount-string=&quot;/tmp/myapp/k8s/:/data/myapp/share/&quot;</code></p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: manual
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: myapp-share-storage
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  local:
    path: &quot;/data/myapp/share/&quot;
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - minikube
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: myapp-share-claim
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: myapp-server
  name: myapp-server
spec:
  selector:
    matchLabels:
      io.kompose.service: myapp-server
  template:
    metadata:
      labels:
        io.kompose.service: myapp-server
    spec:
      containers:
        - name: myapp-server
          image: myregistry.com:5000/server-myapp:alpine
          ports:
            - containerPort: 80
          resources: {}
          volumeMounts:
            - mountPath: /data/myapp/share
              name: myapp-share
          env:
            - name: storage__root_directory
              value: /data/myapp/share
      volumes:
        - name: myapp-share
          persistentVolumeClaim:
            claimName: myapp-share-claim
status: {}
</code></pre>
<p>It works with pitfalls: Statefulset are not supported, they bring deadlock errors :</p>
<ul>
<li>pending PVC: waiting for first consumer to be created before binding</li>
<li>pending POD: 0/1 nodes are available: 1 node(s) didn't find available persistent volumes to bind</li>
</ul>
<p>Another option is to use minikube persistentvolumeclaim without persistentvolume (it will be created automatically). However:</p>
<ul>
<li>The volume is created in /tmp (ex: /tmp/hostpath-provisioner/default/myapp-share-claim)</li>
<li>Minikube doesn't honor mount request</li>
</ul>
<p>How can I make it just work?</p>

Kiruahxh
<p>Using your yaml file I've managed to create the volumes and deploy it without issue, but i had to use the command <code>minikube mount /mydir/:/data/myapp/share/</code> after starting the minikube since <code>--mount --mount-strings=&quot;/mydir/:/data/myapp/share/&quot;</code> wasn't working.</p>
