The first and the most important part of VSC configuration is to select Volume allocator, which determines how VSC will choose VPSA when creating a new Volume.
In values.yaml:
plugin:
allocator: "weighted"weighted(default): use the least utilized VPSA, based on the following:totalWeight = wNumVolumes + wAllocatedCapacity + wProvisionedCapacity, wherewNumVolumes = numberOfVolumes / 1000wAllocatedCapacity = AllocatedCapacity / TotalCapacity. Allocated capacity is a metric of capacity utilization at Storage Pool level, including space used by data, metadata, snapshots, and allocated but unused space (e.g, due to fragmentation).wProvisionedCapacity = ProvisionedCapacity / TotalCapacity. Provisioned capacity is a sum of size of all VPSA Volumes.
mostAvailableCapacity: prefer VPSA with the most Available Capacity in Storage Pool.eveneven distribution i.e, prefer VPSA with minimum number of Volumes (regardless of total Volumes size).linearuse a VPSA until exhausted, then proceed to the next one, in the same order that VPSAs have been added to a VSC Storage Class.
All algorithms will only consider VPSAs that:
- have
Readystate in VSC. - have
normalcapacity mode. - have sufficient Available Capacity in Storage Pool.
For Volume Provisioning, you need to create at least one VSC Storage Class. One CSI driver instance can manage any number of VSC Storage Classes. For example, one could create
K8s StorageClass may reference VSC Storage Class in parameters.VSCStorageClassName, see example.
kind: VSCStorageClass
metadata:
name: vscstorageclass-sample
spec:
displayName: "Sample VSC Storage Class"
description: "Demonstrates VSCStorageClass schema"
isDefault: trueThis file is also available in deploy/examples:
$ kubectl apply -f ./deploy/examples/storage_v1_vscstorageclass.yaml
vscstorageclass.storage.zadara.com/vscstorageclass-sample created
$ kubectl get vscstorageclasses -o wide
NAME STATUS DEFAULT MEMBERS CAPACITY MODE TOTAL AVAILABLE AGE
vscstorageclass-sample Ready true 0 normal 0 0 57sYou may create a VSC Storage Class with isDefault: true, and it will be used when VSC Storage Class is
not explicitly set (similar to how you can omit StorageClass in PVC definition).
⚠ Default VSC Storage Class cannot be deleted.
To delete it, update isDefault by using kubectl edit vscsc, or kubectl patch:
$ kubectl patch vscsc vscstorageclass-sample --patch '{"spec":{"isDefault":false}}' --type=merge
vscstorageclass.storage.zadara.com/vscstorageclass-sample patched
$ kubectl get vscstorageclasses -o wide
NAME STATUS DEFAULT MEMBERS CAPACITY MODE TOTAL AVAILABLE AGE
vscstorageclass-sample Ready 0 normal 0 0 7m1s
VPSA Custom Resource includes VPSA credentials,
and a reference to a VSC Storage Class in spec.VSCStorageClassName.
apiVersion: storage.zadara.com/v1
kind: VPSA
metadata:
name: vpsa-sample
spec:
displayName: "Example VPSA"
description: "Demonstrates VPSA resource schema"
hostname: "example.zadaravpsa.com"
token: "SUPER-SECRET-TOKEN-12345"
VSCStorageClassName: "vscstorageclass-sample"This file is also available in deploy/examples (replace spec.hostname and spec.token with your VPSA credentials):
$ kubectl apply -f ./deploy/examples/storage_v1_vpsa.yaml
vscstorageclass.storage.zadara.com/vscstorageclass-sample created$ kubectl get vpsa -o wide
NAME STATUS DISPLAY NAME HOSTNAME VERSION CAPACITY MODE TOTAL AVAILABLE VSC AGE
vpsa-sample Ready Example VPSA vsa-0000028d-zadara-qa.zadaravpsa.com 20.12-sp2-240 normal 743296Mi 743152Mi vscstorageclass-sample 45sAt this point, VSC Storage Class will be updated with aggregated status and capacity:
$ kubectl get vscstorageclasses -o wide
NAME STATUS DEFAULT MEMBERS CAPACITY MODE TOTAL AVAILABLE AGE
vscstorageclass-sample Ready true 1 normal 743296Mi 743152Mi 52m