0

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?

Nick Rak
  • 167
  • 7

1 Answers1

0

Looks like that there was the same problem and they found a solution in comments:

"Did you call upgrade? Here is about the config option - "Beginning with v1.8.0, kubeadm uploads the configuration of your cluster to a ConfigMap called kubeadm-config in the kube-system namespace, and later reads the ConfigMap when upgrading. This enables correct configuration of system components, and provides a seamless user experience." So, for apply new config you should update a cluster. "

So could you run the:

 kubeadm upgrade  

command, it should solve the issue.

Nick Rak
  • 167
  • 7