mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
50 lines
1.1 KiB
Plaintext
50 lines
1.1 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * microshift_storage/microshift-storage-plugin-overview.adoc
|
|
|
|
:_content-type: CONCEPT
|
|
[id="using-lvms_{context}"]
|
|
= Using the LVMS
|
|
|
|
The LVMS `StorageClass` is deployed with a default `StorageClass`. Any `PersistentVolumeClaim` objects without a `.spec.storageClassName` defined automatically has a `PersistentVolume` provisioned from the default `StorageClass`.
|
|
|
|
Use the following procedure to provision and mount a logical volume to a pod.
|
|
|
|
.Procedure
|
|
|
|
* Enter the following command to provision and mount a logical volume to a pod:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ cat <<'EOF' | oc apply -f -
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: my-lv-pvc
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1G
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: my-pod
|
|
spec:
|
|
containers:
|
|
- name: nginx
|
|
image: nginx
|
|
command: ["/usr/bin/sh", "-c"]
|
|
args: ["sleep", "1h"]
|
|
volumeMounts:
|
|
- mountPath: /mnt
|
|
name: my-volume
|
|
volumes:
|
|
- name: my-volume
|
|
persistentVolumeClaim:
|
|
claimName: my-lv-pvc
|
|
EOF
|
|
----
|