Why cant I mount the same PVC twice with different subpaths to single pod?

Sourabh Ninawe

Why cant I have a setup like below. I want to map vol1 to a pod with different subpath has xyz and vol2 to the same pod with subpath abc.

  volumes:
  - name:vol1
    persistentVolumeClaim:
      claimName: testclaim
  - name: vol2
    persistentVolumeClaim:
      claimName: testclaim

containers volume mounts:

  volumeMounts:
    - name: vol1
      mountPath: /test/
      subPath: abc
    - name: vol2
      mountPath: /test2/
      subPath: xyz

What is the alternative for this kind of setup?

Vasili Angapov

Try this

  volumeMounts:
    - name: vol1
      mountPath: /test
      subPath: abc
    - name: vol1
      mountPath: /test2
      subPath: xyz
volumes:
- name: vol1
  persistentVolumeClaim:
    claimName: testclaim

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

function add() with select, but i cant select the same number twice

Why I cant access a kubernetes pod from other Nodes IP?

Why cant I separate <Switch> to a different module?

Why do different partitions on the same disk not have the same mount point?

Why do I get twice the same message?

Selecting same column twice from a single table but with different conditions

TensorFlow: Why does I get different result even though I run this code twice at same place without updata any parameters?

Angular - Two different lazy loaded modules associated to subpaths of the same path

How can I configure different storage mount for different pod in Elasticsearch cluster in K8S?

Cant access redis from fastapi api when they are in a same cluster, same pod, using a single node cluster via docker desktop

Kubernetes multiple pvc with statefulset for each pod vs single pvc for all pods?

Skycons, cant display the same icon twice?

Why cant I see the all 3 ImageButtons on the same row?

OpenShift runs same container twice when it should run two different ones inside pod

Can I declare the same variable twice in different for loops in JavaScript?

Can I initialize the same image twice in different functions in Android studio

Why I have several mount point with the same name?

Why i cant getFft

Why cant I center this?

Kubernetes PVC volume mount

Why do i need same using twice in razor?

Why can't I iterate twice over the same data?

Why can't I iterate twice over the same data?

Why can't I use the same parser twice in a tuple()?

Why I can't reuse WebClient to make the same request twice?

Why can't i receive twice from the same client

Why can't i use same file channel twice in TCL

Why can I free memory twice, but can't in different situations?

Cant call same function twice in same php page