We have a use case in which we would like to mount a PV within other mounted volume as described in the snippet below
apiVersion: apps/v1
kind: Deployment
.....
.....
.....
spec:
containers:
- image: ubuntu:latest
name: mount-on-mount
volumeMounts:
- name: volume-1
mountPath: /external
- name: volume-2
mountPath: /external/internal
volumes:
- name: volume-1
persistentVolumeClaim:
claimName: volume-1-pvc
- name: volume-2
persistentVolumeClaim:
claimName: volume-2-pvc
The official Kubernetes document says that “Volumes cannot mount within other volumes” but we have tested the above configuration in a K8s cluster and it seems to work fine!
Does K8s support mounting volume within other volume and the official doc is not updated with this feature?
For the same purpose, there is an open issue present in github (edited)