mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
This PR adds support to allow the CSI driver to pick up a node matching the topology specified in the storage class. Admin can specify allowedTopologies in the StorageClass to specify the nodes where the zfs pools are setup
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-zfspv
allowVolumeExpansion: true
parameters:
blocksize: "4k"
compression: "on"
dedup: "on"
thinprovision: "yes"
poolname: "zfspv-pool"
provisioner: zfs-localpv
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
- key: kubernetes.io/hostname
values:
- gke-zfspv-pawan-default-pool-c8929518-cgd4
- gke-zfspv-pawan-default-pool-c8929518-dxzc
```
Note: This PR picks up the first node from the list of nodes available.
Signed-off-by: Pawan <pawan@mayadata.io>
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: openebs-zfspv
|
|
allowVolumeExpansion: true
|
|
parameters:
|
|
blocksize: "4k"
|
|
compression: "on"
|
|
dedup: "on"
|
|
thinprovision: "yes"
|
|
#encryption: "on"
|
|
#keyformat: "raw"
|
|
#keylocation: "file:///home/pawan/key"
|
|
poolname: "zfspv-pool"
|
|
provisioner: zfs-localpv
|
|
volumeBindingMode: WaitForFirstConsumer
|
|
allowedTopologies:
|
|
- matchLabelExpressions:
|
|
- key: kubernetes.io/hostname
|
|
values:
|
|
- gke-zfspv-pawan-default-pool-c8929518-cgd4
|
|
- gke-zfspv-pawan-default-pool-c8929518-dxzc
|
|
---
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: csi-zfspv
|
|
spec:
|
|
storageClassName: openebs-zfspv
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 4Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: fio
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: perfrunner
|
|
image: openebs/tests-fio
|
|
command: ["/bin/bash"]
|
|
args: ["-c", "while true ;do sleep 50; done"]
|
|
volumeMounts:
|
|
- mountPath: /datadir
|
|
name: fio-vol
|
|
tty: true
|
|
volumes:
|
|
- name: fio-vol
|
|
persistentVolumeClaim:
|
|
claimName: csi-zfspv
|