Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

gcePersistentDisk

gcePersistentDisk volume mounts a Google Compute Engine (GCE) Persistent Disk (PD) into a Pod. If you provision it statically, you'll have to create it first with the gcloud command or in the GCE console. The following is an example:

# cat 2-6-8_gce/static_mount.yamlapiVersion: v1kind: Podmetadata:  name: gce-pd-podspec:  containers:  - image: nginx    name: gce-pd-example    volumeMounts:    - mountPath: /mount-path      name: gce-pd      ports:        - containerPort: 80  volumes:  - name: gce-pd    gcePersistentDisk:      pdName: example      fsType: ext4

Alternatively, and more cost-effectively, we could use dynamic provisioning. Then we don't need to provision PD beforehand. For enabling dynamic provisioning, the DefaultStorageClass admission controller has ...

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

Kubernetes Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content