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"