From d283c1f5453d0c9ef03f08bbdf35d45ca152e2cc Mon Sep 17 00:00:00 2001 From: slayer321 Date: Mon, 25 Oct 2021 09:52:46 -0400 Subject: [PATCH] docs: add PV duplicate example --- .../configure-persistent-volume-storage.md | 6 ++++++ .../examples/pods/storage/pv-duplicate.yaml | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 content/en/examples/pods/storage/pv-duplicate.yaml diff --git a/content/en/docs/tasks/configure-pod-container/configure-persistent-volume-storage.md b/content/en/docs/tasks/configure-pod-container/configure-persistent-volume-storage.md index a53d278223..73755891ca 100644 --- a/content/en/docs/tasks/configure-pod-container/configure-persistent-volume-storage.md +++ b/content/en/docs/tasks/configure-pod-container/configure-persistent-volume-storage.md @@ -236,8 +236,14 @@ sudo rmdir /mnt/data You can now close the shell to your Node. +## Mounting the same persistentVolume in two places +{{< codenew file="pods/storage/pv-duplicate.yaml" >}} +You can perform 2 volume mounts on your nginx container: + +`/usr/share/nginx/html` for the static website +`/etc/nginx/nginx.conf` for the default config diff --git a/content/en/examples/pods/storage/pv-duplicate.yaml b/content/en/examples/pods/storage/pv-duplicate.yaml new file mode 100644 index 0000000000..15a48acbed --- /dev/null +++ b/content/en/examples/pods/storage/pv-duplicate.yaml @@ -0,0 +1,20 @@ + +apiVersion: v1 +kind: Pod +metadata: + name: test +spec: + containers: + - name: test + image: nginx + volumeMounts: + - name: site-data + mountPath: /usr/share/nginx/html + subPath: html + - name: config + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + volumes: + - name: config + persistentVolumeClaim: + claimName: test-nfs-claim \ No newline at end of file