docs/doc/source/storage/kubernetes/create-readwritemany-persistent-volume-claims.rst
Ron Stone 73acfbfdfb Fix step numbering
Numbered list resets mid-list are fixed.
Resolved merge conflict.
Fixed 'greybar' issue.

Signed-off-by: Ron Stone <ronald.stone@windriver.com>
Change-Id: I748039fb2680ec60f69b2928da219aff1da6b816
Signed-off-by: Ron Stone <ronald.stone@windriver.com>
2021-06-11 12:05:53 -04:00

2.0 KiB

Create ReadWriteMany Persistent Volume Claims

Container images have an ephemeral file system by default. For data to survive beyond the lifetime of a container, it can read and write files to a persistent volume obtained with a Persistent Volume Claim (PVC) created to provide persistent storage.

For multiple containers to mount the same , create a with accessMode of ReadWriteMany (RWX).

The following steps show an example of creating a 1GB with ReadWriteMany accessMode.

Create the rwx-test-claim Persistent Volume Claim.

  1. Create a yaml file defining the claim and its attributes.

    For example:

    ~(keystone_admin)]$
    cat <<EOF > rwx-claim.yaml
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: rwx-test-claim
    spec:
      accessModes:
      - ReadWriteMany
      resources:
        requests:
          storage: 1Gi
      storageClassName: cephfs
    EOF
  2. Apply the settings created above.

    ~(keystone_admin)]$ kubectl apply -f rwx-claim.yaml
    persistentvolumeclaim/rwx-test-claim created

This results in 1GB being created. You can view the using the following command.

~(keystone_admin)]$ kubectl get persistentvolumeclaims

NAME              STATUS   VOLUME       CAPACITY   ACCESS MODES   STORAGECLASS
rwx-test-claim    Bound    pvc-df9f..   1Gi        RWX            cephfs

~(keystone_admin)]$ kubectl get persistentvolume
NAME       CAPACITY ACCESS.. RECLAIM.. STATUS CLAIM                   STORAGECLASS
pvc-df9f.. 1Gi      RWX       Delete    Bound  default/rwx-test-claim  cephfs