I am trying to create mongodb StatefulSet on Kubernetes. For auto provisioning of volume, i have created a StorageClass
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-standard
zone: us-east1-b
And to for PersistentVolumeClaim,Used below yaml file.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-1
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
resources:
requests:
storage: 10Gi
Here is the output of kubectl get pvc command
Pravins-MacBook-Pro:k8sdemo pravingosavi$ kubectl describe pvc
Name: pvc-1
Namespace: default
StorageClass: standard
Status: Pending
Volume:
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"pvc-1","namespace":"default"},"spec":{"accessModes":["ReadWriteO...
volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/gce-pd
Capacity:
Access Modes:
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
27s 27s 1 persistentvolume-controller Warning ProvisioningFailed Failed to provision volume with StorageClass "standard": Failed to get GCE GCECloudProvider with error <nil>
I am getting error- Failed to provision volume with StorageClass "standard": Failed to get GCE GCECloudProvider with error
Any help please?