Kubernetes - PersistentVolumeClaim failed

8/30/2017

I have a GKE based Kubernetes setup and a POD that requires a storage volume. I attempt to use the config below:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-scratch-space
spec:
  accessModes:
  - ReadWriteOnce
resources:
  requests:
    storage: 2000Gi
storageClassName: standard

This PVC is not provisioned. I get the below error:

Failed to provision volume with StorageClass "standard": googleapi: Error 503: The zone 'projects/p01/zones/europe-west2-b' does not have enough resources available to fulfill the request.  Try a different zone, or try again later.

Looking at GKE quotas page, I don't see any issues. Deleting other PVCs also is not solving the issue. Can anyone help? Thanks.

-- Prasanna K Rao
google-kubernetes-engine
kubernetes

1 Answer

8/30/2017

There is no configuration problem at your side - there are actually not enough resources in the europe-west2-b zone to create a 2T persistent disk. Either try for a smaller volume or use a different zone.

There is an example for GCE in the docs. Create a new StorageClass specifying say the europe-west1-b zone (which is actually cheaper than europe-west2-b) like this:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: gce-pd-europe-west1-b
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-standard
  zones: europe-west1-b

And modify your PVC:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-scratch-space
spec:
  accessModes:
  - ReadWriteOnce
resources:
  requests:
    storage: 2000Gi
storageClassName: gce-pd-europe-west1-b
-- Janos Lenart
Source: StackOverflow