Skip to Content
Learn OpenShift
book

Learn OpenShift

by Denis Zuev, Artemii Kropachev, Aleksey Usov
July 2018
Intermediate to advanced
504 pages
11h 34m
English
Packt Publishing
Content preview from Learn OpenShift

Using claims as volumes in pod definition

Previously, we requested a persistent storage by creating PVCs, and now we are going to create an application using corresponding PVCs, as they are now bound to PVs that are backed by real storage. OpenShift allows developers to create a Pod and use PVC as a volume. The following example shows how it can be used in order to create an Apache-based container:

# cat pod-webserver.yamlapiVersion: v1kind: Podmetadata:  name: mywebserverpod  labels:    name: webeserverspec:  containers:    - name: webserver      image: docker.io/centos/httpd      ports:        - name: web          containerPort: 80      volumeMounts:        - name: volume-webroot          mountPath: /var/www/html  volumes:    - name: volume-webroot      persistentVolumeClaim:        claimName: pvc-web

In the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Operating OpenShift

Operating OpenShift

Rick Rackow, Manuel Dewald
OpenShift for Developers, 2nd Edition

OpenShift for Developers, 2nd Edition

Joshua Wood, Brian Tannous
Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower

Publisher Resources

ISBN: 9781788992329Supplemental Content