This katalog deploys the vSphere container storage interface driver on a VMware Kubernetes cluster backed by vCenter.
Follow all the prerequisites from vsphere-cm
modules.
gcr.io/cloud-provider-vsphere/csi/release/driver:v3.1.2
gcr.io/cloud-provider-vsphere/csi/release/syncer:v3.1.2
k8s.gcr.io/sig-storage/csi-attacher:v4.3.0
k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.8.0
k8s.gcr.io/sig-storage/csi-provisioner:v3.5.0
k8s.gcr.io/sig-storage/csi-resizer:v1.8.0
k8s.gcr.io/sig-storage/csi-snapshotter:v6.2.2
k8s.gcr.io/sig-storage/livenessprobe:v2.10.0
Credential are set via secret, patch it via Kustomize:
apiVersion: v1
kind: Secret
metadata:
name: vsphere-config-secret
namespace: vmware-system-csi
stringData:
csi-vsphere.conf: |
[Global]
cluster-id = "demo-cluster-id"
[VirtualCenter "1.1.1.1"]
insecure-flag = "true"
user = "Administrator@vsphere.local"
password = "password"
port = "443"
datacenters = "datacenter"
type: Opaque
cluster-id
represents the unique cluster identifier. Each Kubernetes cluster should have its own unique cluster-id set in the csi-vsphere.conf
file.
After setting all prerequisites and the password, you can apply all manifests to the cluster.
Run these commands, the output should be similar:
$ kubectl get CSINode
NAME CREATED AT
k8s-node1 2019-06-01T00:50:26Z
k8s-node2 2019-06-01T00:50:38Z
k8s-node3 2019-06-01T00:50:26Z
k8s-node4 2019-06-01T00:50:25Z
Now you will need to set a Storage Policy in VCenter to define which datastore will be used by volumes:
Follow the wizard to select the storage. Storage is selected using vSAN or using tags on Datastores. After the procedure, you will have a storage policy that shows some disks under Storage Compatibility
.
Create your storageClass
:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: vsphere
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: csi.vsphere.vmware.com
parameters:
storagepolicyname: "your-awesome-storage-policy-in-vcenter"
fstype: ext4