What is OpenShift Container Storage (OCS)
Red Hat® OpenShift® Container Storage is software-defined storage for containers. Engineered as the data and storage services platform for Red Hat OpenShift, Red Hat OpenShift Container Storage helps teams develop and deploy applications quickly and efficiently across clouds.
What will you learn
In this tutorial you will learn how to create Persistent Volumes and use that for deploying Elasticsearch. You will then deploy a demo app which is a e-library search engin for 100 classic novels. Once the app is successfully deployed, you could search any word from 100 classic novels, the search is powered by Elasticsearch which is using persistent storage from OCS. The logical architecture of the app that you will deploy looks like this
Persistent Storage for Elasticsearch Powered by OpenShift Container Storage
Create Project and PVC
- You have been auto logged in as
adminuser, verify by running
oc whoamion the command line.
You can click on the above command (and all others in this scenario) to automatically copy it into the terminal and execute it.
- Create a new project, that we will use throughout this scenario and create a PersistentVolumeClaim on OCS storage class which will be used by Elasticsearch pod to persist data
oc create -f 1_create_ns_ocs_pvc.yaml
oc project e-library
- To verify get the Storage Class (SC) and PersistentVolumeClaim (PVC)
oc get pvc
oc get sc
- With just a few lines of YAML, you have created a PVC named
ocs-pv-claimon storage class
ocs-storagecluster-ceph-rbdwhich is provisioned from OpenShift Container Storage. Elasticsearch needs persistence for its data and OpenShift Container Storage is one of the simplest and reliable option that you can choose to persist data for you apps running on OpenShift Container Platform.
- Let's continue to the next section to deploy the Elasticsearch cluster.