<p>I am trying to create a Kubernetes pod with a single container which has two external volumes mounted on it. My .yml pod file is:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: my-project
  labels:
    name: my-project
spec:
  containers:
    - image: my-username/my-project
      name: my-project
      ports:
        - containerPort: 80
          name: nginx-http
        - containerPort: 443
          name: nginx-ssl-https
      imagePullPolicy: Always
      volumeMounts:
        - mountPath: /home/projects/my-project/media/upload
          name: pd-data
        - mountPath: /home/projects/my-project/backups
          name: pd2-data
  imagePullSecrets:
    - name: vpregistrykey
  volumes:
    - name: pd-data
      persistentVolumeClaim:
        claimName: pd-claim
    - name: pd2-data
      persistentVolumeClaim:
        claimName: pd2-claim
</code></pre>

<p>I am using Persistent Volumes and Persisten Volume Claims, as such:
<code>PV</code></p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: pd-disk
  labels:
    name: pd-disk
spec:
  capacity:
    storage: 250Gi
  accessModes:
    - ReadWriteOnce
  gcePersistentDisk:
    pdName: "pd-disk"
    fsType: "ext4"
</code></pre>

<p><code>PVC</code></p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pd-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 250Gi
</code></pre>

<p>I have initially created my disks using the command:
<code>$ gcloud compute disks create --size 250GB pd-disk</code>
Same goes for the second disk and second PV and PVC. Everything seems to work ok when I create the pod, no errors are thrown. Now comes the weird part: one of the paths is being mounted correctly (and is therefor persistent) and the other one is being erased every time I restart the pod...</p>

<p>I have tried re-creating everything from scratch, but nothing changes. Also, from the pod description, both volumes seem to be correctly mounted:</p>

<pre><code>$ kubectl describe pod my-project
Name:       my-project
...
Volumes:
  pd-data:
    Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  pd-claim
    ReadOnly: false
  pd2-data:
    Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  pd2-claim
    ReadOnly: false
</code></pre>

<p>Any help is appreciated. Thanks.</p>

<p>The Kubernetes <a href="https://kubernetes.io/docs/concepts/storage/volumes/" rel="noreferrer">documentation</a> states:</p>

<blockquote>
  <p>Volumes can not mount onto other volumes or have hard links to other
  volumes</p>
</blockquote>

<p>I had the same issue and in my case the problem was that both volume mounts had overlapping mountPaths, i.e. both started with /var/. </p>

<p>They mounted without issues after fixing that.</p>
