Install an appropriate version of the vSphere Container Storage Plug-in in your native Kubernetes environment. After you install the plug-in, you can verify whether the installation is successful.

To deploy your Kubernetes cluster with topology aware provisioning feature, see Topology-Aware Volume Provisioning.

Prerequisites

Procedure

  1. Deploy vSphere Container Storage Plug-in.
    $ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/vsphere-csi-driver/v2.4.0/manifests/vanilla/vsphere-csi-driver.yaml
  2. Verify that the vSphere Container Storage Plug-in has been successfully deployed.
    1. Verify that vsphere-csi-controller instances run on the primary node and vsphere-csi-node instances run on worker nodes of the cluster.
      $ kubectl get deployment --namespace=vmware-system-csi
      NAME                          READY   AGE
      vsphere-csi-controller        1/1     2m58s
      $ kubectl get daemonsets vsphere-csi-node --namespace=vmware-system-csi
      NAME               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
      vsphere-csi-node   4         4         4       4            4           <none>          3m51s
    2. Verify that the vSphere Container Storage Plug-in has been registered with Kubernetes.
      $ kubectl describe csidrivers
        Name:         csi.vsphere.vmware.com
        Namespace:
        Labels:       <none>
        Annotations:  <none>
        API Version:  storage.k8s.io/v1
        Kind:         CSIDriver
        Metadata:
          Creation Timestamp:  2020-04-14T20:46:07Z
          Resource Version:    2382881
          Self Link:           /apis/storage.k8s.io/v1beta1/csidrivers/csi.vsphere.vmware.com
          UID:                 19afbecd-bc2f-4806-860f-b29e20df3074
        Spec:
          Attach Required:    true
          Pod Info On Mount:  false
          Volume Lifecycle Modes:
            Persistent
        Events:  <none>
    3. Verify that the CSINodes have been created.
      $ kubectl get CSINode
      NAME                 CREATED AT
      <k8s-worker1-name>   2020-04-14T12:30:29Z
      <k8s-worker2-name>   2020-04-14T12:30:38Z
      <k8s-worker3-name>   2020-04-14T12:30:21Z
      <k8s-worker4-name>   2020-04-14T12:30:26Z