May 2018
Intermediate to advanced
554 pages
13h 51m
English
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 ...