diff --git a/_topic_maps/_topic_map_rosa.yml b/_topic_maps/_topic_map_rosa.yml index cb236e8217..d797b11d48 100644 --- a/_topic_maps/_topic_map_rosa.yml +++ b/_topic_maps/_topic_map_rosa.yml @@ -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 diff --git a/cloud_experts_tutorials/cloud-experts-deploying-application/cloud-experts-deploying-application-storage.adoc b/cloud_experts_tutorials/cloud-experts-deploying-application/cloud-experts-deploying-application-storage.adoc new file mode 100644 index 0000000000..b62595871a --- /dev/null +++ b/cloud_experts_tutorials/cloud-experts-deploying-application/cloud-experts-deploying-application-storage.adoc @@ -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 +---- ++ +. 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]. \ No newline at end of file diff --git a/images/cloud-experts-storage-ostoy-createfile.png b/images/cloud-experts-storage-ostoy-createfile.png new file mode 100644 index 0000000000..c00ae06606 Binary files /dev/null and b/images/cloud-experts-storage-ostoy-createfile.png differ diff --git a/images/cloud-experts-storage-ostoy-existingfile.png b/images/cloud-experts-storage-ostoy-existingfile.png new file mode 100644 index 0000000000..30fde8c02b Binary files /dev/null and b/images/cloud-experts-storage-ostoy-existingfile.png differ diff --git a/images/cloud-experts-storage-ostoy-viewfile.png b/images/cloud-experts-storage-ostoy-viewfile.png new file mode 100644 index 0000000000..f6820cfe0b Binary files /dev/null and b/images/cloud-experts-storage-ostoy-viewfile.png differ