mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
OSDOCS-8392
This commit is contained in:
committed by
openshift-cherrypick-robot
parent
8587602216
commit
1335da54f8
@@ -190,6 +190,8 @@ Topics:
|
||||
File: cloud-experts-deploying-application-deployment
|
||||
- Name: Networking
|
||||
File: cloud-experts-deploying-application-networking
|
||||
- Name: Storage
|
||||
File: cloud-experts-deploying-application-storage
|
||||
---
|
||||
Name: Getting started
|
||||
Dir: rosa_getting_started
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
:_mod-docs-content-type: ASSEMBLY
|
||||
[id="cloud-experts-deploying-application-storage"]
|
||||
= Tutorial: Persistent volumes for cluster storage
|
||||
include::_attributes/attributes-openshift-dedicated.adoc[]
|
||||
:context: cloud-experts-deploying-application-storage
|
||||
|
||||
toc::[]
|
||||
|
||||
//rosaworkshop.io content metadata
|
||||
//Brought into ROSA product docs 2024-04-30
|
||||
|
||||
{rosa-classic-first} and Red Hat OpenShift Service on AWS (ROSA) support storing persistent volumes with either link:https://aws.amazon.com/ebs/[Amazon Web Services (AWS) Elastic Block Store (EBS)] or link:https://aws.amazon.com/efs/[AWS Elastic File System (EFS)].
|
||||
|
||||
== Using persistent volumes
|
||||
Use the following procedures to create a file, store it on a persistent volume in your cluster, and confirm that it still exists after pod failure and re-creation.
|
||||
|
||||
=== Viewing a persistent volume claim
|
||||
. Navigate to the cluster's OpenShift web console.
|
||||
. Click *Storage* in the left menu, then click *PersistentVolumeClaims* to see a list of all the persistent volume claims.
|
||||
. Click a persistence volume claim to see the size, access mode, storage class, and other additional claim details.
|
||||
+
|
||||
[NOTE]
|
||||
====
|
||||
The access mode is `ReadWriteOnce` (RWO). This means that the volume can only be mounted to one node and the pod or pods can read and write to the volume.
|
||||
====
|
||||
|
||||
=== Storing your file
|
||||
|
||||
. In the OSToy app console, click *Persistent Storage* in the left menu.
|
||||
. In the *Filename* box, enter a file name with a `.txt` extension, for example `test-pv.txt`.
|
||||
. In the *File contents* box, enter a sentence of text, for example `OpenShift is the greatest thing since sliced bread!`.
|
||||
. Click *Create file*.
|
||||
+
|
||||
image::cloud-experts-storage-ostoy-createfile.png[]
|
||||
+
|
||||
.Verification
|
||||
. Scroll to *Existing files* on the OSToy app console.
|
||||
. Click the file you created to see the file name and contents.
|
||||
+
|
||||
image::cloud-experts-storage-ostoy-viewfile.png[]
|
||||
|
||||
=== Crashing the pod
|
||||
|
||||
. On the OSToy app console, click *Home* in the left menu.
|
||||
. Click *Crash pod*.
|
||||
|
||||
=== Confirming persistent storage
|
||||
|
||||
. Wait for the pod to re-create.
|
||||
. On the OSToy app console, click *Persistent Storage* in the left menu.
|
||||
. Find the file you created, and open it to view and confirm the contents.
|
||||
+
|
||||
image::cloud-experts-storage-ostoy-existingfile.png[]
|
||||
|
||||
.Verification
|
||||
The deployment YAML file shows that we mounted link:https://github.com/openshift-cs/rosaworkshop/blob/master/rosa-workshop/ostoy/yaml/ostoy-frontend-deployment.yaml#L61[the directory] `/var/demo_files` to our persistent volume claim.
|
||||
|
||||
. Retrieve the name of your front-end pod by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc get pods
|
||||
----
|
||||
+
|
||||
. Start a secure shell (SSH) session in your container by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc rsh <pod_name>
|
||||
----
|
||||
+
|
||||
. Go to the directory by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ cd /var/demo_files
|
||||
----
|
||||
+
|
||||
. *Optional:* See all the files you created by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ ls
|
||||
----
|
||||
+
|
||||
. Open the file to view the contents by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ cat test-pv.txt
|
||||
----
|
||||
+
|
||||
. Verify that the output is the text you entered in the OSToy app console.
|
||||
+
|
||||
.Example terminal
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
ostoy-frontend-5fc8d486dc-wsw24 1/1 Running 0 18m
|
||||
ostoy-microservice-6cf764974f-hx4qm 1/1 Running 0 18m
|
||||
|
||||
$ oc rsh ostoy-frontend-5fc8d486dc-wsw24
|
||||
|
||||
$ cd /var/demo_files/
|
||||
|
||||
$ ls
|
||||
lost+found test-pv.txt
|
||||
|
||||
$ cat test-pv.txt
|
||||
OpenShift is the greatest thing since sliced bread!
|
||||
----
|
||||
|
||||
=== Ending the session
|
||||
|
||||
* Type `exit` in your terminal to quit the session and return to the CLI.
|
||||
|
||||
[role="_additional-resources"]
|
||||
== Additional resources
|
||||
* For more information about persistent volume storage, see xref:../../storage/understanding-persistent-storage.adoc#persistent-volumes_understanding-persistent-storage[Understanding persistent storage].
|
||||
* For more information about ROSA storage options, see xref:../../storage/index.adoc#storage-overview[Storage overview].
|
||||
BIN
images/cloud-experts-storage-ostoy-createfile.png
Normal file
BIN
images/cloud-experts-storage-ostoy-createfile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
images/cloud-experts-storage-ostoy-existingfile.png
Normal file
BIN
images/cloud-experts-storage-ostoy-existingfile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
BIN
images/cloud-experts-storage-ostoy-viewfile.png
Normal file
BIN
images/cloud-experts-storage-ostoy-viewfile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Reference in New Issue
Block a user