Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GKE Autopilot with a nodes with a volume

What's the suggested method for a pod to mount a compute engine disk in GKE AutoPilot. In the past, when using GKE Standard, the cluster has been in the same region as the disk, so the pod to volume mount is straightforward. With Autopilot, the pod and disk could be in a different zone. I've tried setting the podAffinity value to the same zone, but this results in the pod being left in a pending state.

Solved Solved
0 6 1,291
1 ACCEPTED SOLUTION

@bcf_ant 

  1. Create a PersistentVolumeClaim (PVC): In Autopilot mode, you create a PVC to request storage. Autopilot automatically provisions the storage and associates it with the PVC. This abstraction simplifies the process of attaching disks manually.

  2. Use the PVC in your Deployment or StatefulSet: Deploy your application using a Deployment or StatefulSet that references the PVC you've created. The deployment controller takes care of mapping the PVC to an appropriate volume.

View solution in original post

6 REPLIES 6

@bcf_ant 

  1. Create a PersistentVolumeClaim (PVC): In Autopilot mode, you create a PVC to request storage. Autopilot automatically provisions the storage and associates it with the PVC. This abstraction simplifies the process of attaching disks manually.

  2. Use the PVC in your Deployment or StatefulSet: Deploy your application using a Deployment or StatefulSet that references the PVC you've created. The deployment controller takes care of mapping the PVC to an appropriate volume.

Are you trying to mount an existing disk or just create a new PV for your pod(s)?

@garisingh I don't know if you remember me. I chatted and exchanged emails as a Googler with you (Googler from 2012 - July 2023). Good to see you on this channel.

Ah ... very cool.  And glad to see you are still using Google Cloud!

I am all in Google Cloud. I joined a premier partner  who's exclusive to GCP.

All sorted, @g_munish suggestion worked.

Top Labels in this Space