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.
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.
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