0

I'm testing K8s with my custom cluster on GCP. I'm trying to create a StorageClass with this yaml:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: google-storage
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-ssd
  replication-type: none

But I'm having this error when I tried to create the resource:

Events:
  Type     Reason              Age                  From                         Message
  ----     ------              ----                 ----                         -------
  Warning  ProvisioningFailed  87s (x7 over 7m47s)  persistentvolume-controller  Failed to provision volume with StorageClass "google-storage": failed to get GCE GCECloudProvider with error <nil>

I'm not using GKE, but my own install and and installed everything by myself with kubeadm with the version 1.20 of kubernetes

NAME       STATUS   ROLES                  AGE   VERSION
master-1   Ready    control-plane,master   56m   v1.20.1
worker-1   Ready    <none>                 55m   v1.20.1
worker-2   Ready    <none>                 55m   v1.20.1

Everything is working properly when I create pods, but I'm having an issue with StorageClass. Did I miss something during the creation?

I have found this same issue on stackoverflow, but the answer does not seem to applied to me, as I'm running a more recent version of the K8s Cluster without this problem describe :
Container-VM Image with GPD Volumes fails with "Failed to get GCE Cloud Provider. plugin.host.GetCloudProvider returned <nil> instead"

Kevin
  • 4,823
  • 6
  • 36
  • 70
  • Try passing cloud-provider: gce to the controller manager as mentioned [here](https://github.com/kubernetes/kubernetes/issues/66564#issuecomment-407603777) – Mahboob Dec 31 '20 at 01:15
  • Have you edited your kubeadm config file ? Once done you also need to run `kubeadm upgrade`. Take a look at [this](https://stackoverflow.com/questions/50100219/kubernetes-failed-to-get-gce-gcecloudprovider-with-error-nil) thread. – mario Dec 31 '20 at 17:02

0 Answers0