0

I have a GCE persistent disk formatted with a default partition. When I mount the disk to a VM, I use the device /dev/sdb1, for example.

Now I want to mount the same persistent disk to GKE. The docs page "Using preexisting Persistent Disks as PersistentVolumes" says to use the following yaml to configure your disk:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-demo
spec:
  storageClassName: ""
  capacity:
    storage: 500G
  accessModes:
    - ReadWriteOnce
  gcePersistentDisk:
    pdName: pd-name
    fsType: ext4

However, I can't find where to specify the partition to be mounted.

How do I request GKE to mount partition 1, instead of the "bare" disk with no partitions? Or do I have to reformat my disk so that it has no partitions?

sffc
  • 382

1 Answers1

0

you are right, you should use a disk with no partitions for mounting to a GKE pod. Trying to mount partition(s) to a GKE pod will most likely result in failure to mount. Please take a look at this GitHub thread that has a sample yaml which you may reference for mounting your PD partition to see if it works for you. We’ve noticed this issue internally, but an ETA can’t be provided.