PVC 事件:等待由外部配置程序“csi.vsphere.vmware.com”或由系统管理员手动创建卷

Tan*_*mee 9 vsphere kubernetes kubernetes-pvc

尝试按照以下文档设置 vsphere-CSI-driver。

后续文档: https: //www.definit.co.uk/2019/06/lab-guide-kubernetes-and-storage-with-the-vsphere-cloud-provider-step-by-step/

与 VSAN 和 VCenter 关联的用户/权限已存在。

[root@sni-k8s-Test-01 ~]# kubectl get CSIDriver
NAME                     CREATED AT
csi.vsphere.vmware.com   2021-01-15T17:39:25Z
[root@sni-k8s-Test-01 ~]# kubectl get CSINode
NAME              CREATED AT
sni-k8s-test-01   2020-08-15T18:38:36Z
sni-k8s-test-02   2020-08-15T18:52:39Z
sni-k8s-test-03   2020-08-16T16:30:44Z
Run Code Online (Sandbox Code Playgroud)

这是我的存储类清单和存储类输出。

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: csi-sc
  annotations:
    storageclass.kubernetes.io/is-default-class: "false"
provisioner: csi.vsphere.vmware.com
parameters:
   storagepolicyname: "k8s-view-k8s-spbm-profile"
   datastoreUrl :  "ds:///vmfs/volumes/5c8a4ebb-d030b1e9-cb39-484d7e0a2431"
Run Code Online (Sandbox Code Playgroud)
[root@sni-k8s-Test-01 ~]# kubectl get sc
NAME     PROVISIONER              RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
csi-sc   csi.vsphere.vmware.com   Delete          Immediate           false                  4d13h
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试创建 PVC 时,这是以下清单并描述与 PVC 相关的输出。

[root@sni-k8s-Test-01 vmdktest]# cat example-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: example-vanilla-block-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: csi-sc
Run Code Online (Sandbox Code Playgroud)
[root@sni-k8s-Test-01 vmdktest]# kubectl describe pvc example-vanilla-block-pvc
Name:          example-vanilla-block-pvc
Namespace:     default
StorageClass:  csi-sc
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: csi.vsphere.vmware.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
Mounted By:    example-vanilla-block-pod
Events:
  Type    Reason                Age                      From                         Message
  ----    ------                ----                     ----                         -------
  Normal  ExternalProvisioning  65s (x26291 over 4d13h)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner "csi.vsphere.vmware.com" or manually created by system administrator

Run Code Online (Sandbox Code Playgroud)