Kubernetes Deep Dive

Sign Up Free or Log In to participate!

GKE: disk not found although it is created

I am getting below error when trying to create the pv:

kubectl apply -f ./gke-pv.yml   
Error from server (Forbidden): error when creating "./gke-pv.yml": persistentvolumes "pv1" is forbidden: error querying GCE PD volume uber-disk: disk is not found

Here is the output of all the disks:

 gcloud compute disks list  
NAME                                           ZONE           SIZE_GB  TYPE         STATUS  
uber-disk                                      us-east1-b     20       pd-ssd       READY  
gke-your-first-cluster-1-pool-1-1f7baff3-3dpm  us-central1-a  30       pd-standard  READY  
gke-your-first-cluster-1-pool-1-1f7baff3-4gmd  us-central1-a  30       pd-standard  READY  
gke-your-first-cluster-1-pool-1-1f7baff3-5gp9  us-central1-a  30       pd-standard  READY

I know it’s more related to gke than kubernetes but thought maybe someone else already faced this issue.

David Dreggors

I get same error, only listing does not show the disk uber-disk as Mohameds does. What I discovered is that we have to manually go create the persistent disk under compute engine -> disks. This is never actually mentioned in the video. It is only stated as it must exist and he moves right on past that. People new to google cloud and cloud in general will be LOST here as I was.

2 Answers

Hello Mohamed. Thanks for taking the course!

I think your problem is that uber-disk is in a different GCP zone than your cluster. If you create uber-disk in the us-central1-a zone it should probably work. I’m not a GCP expert, but my understanding is that block devices like pd-ssd must exist in the same regions and zones as the nodes trying to access them.

HTH

Mohamed Ramadan

Thanks a lot! that solved my issue 🙂

nigelpoulton

Magic!

Pantelis Karamolegkos

Hello, what happens in case in the case where the GKE spans two zones, and the PD gets created in one of them: https://stackoverflow.com/questions/59900266/kubernetes-persistent-volume-creation-failure-on-gke

Just create GCP persistent disk on the right zone (assuming us-central1-a) from Cloud Shell

gcloud compute disks create uber-disk --zone=us-central1-a --size=20

then check if disk is created


gcloud compute disks list
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?