Course Hero Logo

Do280 ocp 39 en 1 20181010 193 chapter 6 allocating

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 211 - 214 out of 412 pages.

DO280-OCP-3.9-en-1-20181010193
CHAPTER 6|Allocating Persistent Storage6.Verify the successful deployment of themysqldbapplication, and then modify thedeployment configuration to use a persistent volume by creating a persistent volume claim.6.1.Verify the successful deployment of themysqldbapplication:[[email protected] ~]$oc statusIn project persistent-storage on server svc/mysqldb - 172.30.183.123:3306dc/mysqldb deploys istag/mysqldb:latestdeployment #1 deployed 22 seconds ago - 1 pod2 infos identified, use 'oc status -v' to see details.6.2.Use theoc describe podcommand to confirm that the name of the volume ismysqldb-volume-1and that its type is currently set toEmptyDir:[[email protected] ~]$oc describe pod mysqldb | grep -A 2 'Volumes'Volumes:mysqldb-volume-1:Type:EmptyDir(a temporary directory that shares a pod's lifetime)6.3.Use theoc set volumecommand to modify the deployment configuration andcreate a persistent volume claim:[[email protected] ~]$oc set volume dc/mysqldb \--add --overwrite --name=mysqldb-volume-1 -t pvc \--claim-name=mysqldb-pvclaim \--claim-size=3Gi \--claim-mode='ReadWriteMany'persistentvolumeclaims/mysqldb-pvclaimdeploymentconfig "mysqldb" updated6.4.Use theoc describe podcommand to confirm that the pod is now using apersistent volume. The command output should displayVolumesasmysqldb-volume-1,TypeasPersistentVolumeClaim, andClaimNameasmysqldb-pvclaim.[[email protected] ~]$oc describe pod mysqldb | \grep -E -A 2 'Volumes|ClaimName'Volumes:mysqldb-volume-1:Type:EmptyDir (a temporary directory that shares a pod's lifetime)--Volumes:mysqldb-volume-1:Type:PersistentVolumeClaim (a reference to a PersistentVolumeClaim inthe same namespace)ClaimName:mysqldb-pvclaimReadOnly:falsedefault-token-h2dp4:--Volumes:deployer-token-6wwsd:194DO280-OCP-3.9-en-1-20181010
CHAPTER 6|Allocating Persistent StorageType:Secret (a volume populated by a Secret)7.On theworkstationhost, verify that the persistent volume claimmysqldb-pvclaimis bound to the persistent volume namedmysqldb-volumeby using theoc get pvccommand.[[email protected] ~]$oc get pvcNAMESTATUSVOLUMECAPACITYACCESSMODESAGEmysqldb-pvclaimBoundmysqldb-volume3GiRWX15m8.From theworkstationhost, populate the database using the SQL file available at/home/student/DO280/labs/deploy-volume/quote.sql. Use theoc port-forwardcommand to forward local port 3306 to pod port 3306. Use themysqlcommandto populate the database.8.1.Open two terminals. From the first one, run theoc get podscommand to retrievethe status of the pods. Ensure that themysqldbpod is ready and running. Run theoc port-forwardcommand to forward the local port 3306 to the pod port 3306.The command keeps the port open until the connection is manually terminated.[[email protected] ~]$oc get podsNAMEREADYSTATUSRESTARTSAGEmysqldb-2-k2vlh1/1Running01h[[email protected] ~]$oc port-forward mysqldb-2-k2vlh3306:3306Forwarding from 127.0.0.1:3306 -> 33068.2.From the second terminal, populate thequotesdatabase by using the providedquote.sqlfile.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 412 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Brian Brock
Tags
Containerization, Enterprise software, Red Hat, OpenShift

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture