mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
feat(block): adding block volume support for ZFSPV (#102)
This commit adds the support for creating a Raw Block Volume request using volumemode as block in PVC :-
```
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: block-claim
spec:
volumeMode: Block
storageClassName: zfspv-block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
```
The driver will create a zvol for this volume and bind mount the block device at the given path.
Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
49dc99726b
commit
dd059a2f43
10 changed files with 274 additions and 10 deletions
50
deploy/sample/fio-block.yaml
Normal file
50
deploy/sample/fio-block.yaml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: zfspv-block
|
||||
allowVolumeExpansion: true
|
||||
parameters:
|
||||
poolname: "zfspv-pool"
|
||||
provisioner: zfs.csi.openebs.io
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: block-claim
|
||||
spec:
|
||||
volumeMode: Block
|
||||
storageClassName: zfspv-block
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fiob
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
name: fiob
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: fiob
|
||||
spec:
|
||||
containers:
|
||||
- resources:
|
||||
name: perfrunner
|
||||
image: openebs/tests-fio
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/bash"]
|
||||
args: ["-c", "while true ;do sleep 50; done"]
|
||||
volumeDevices:
|
||||
- devicePath: /dev/xvda
|
||||
name: storage
|
||||
volumes:
|
||||
- name: storage
|
||||
persistentVolumeClaim:
|
||||
claimName: block-claim
|
||||
|
|
@ -791,7 +791,7 @@ spec:
|
|||
- name: libnvpair
|
||||
mountPath: /lib/libnvpair.so.1
|
||||
- name: pods-mount-dir
|
||||
mountPath: /var/lib/kubelet/pods
|
||||
mountPath: /var/lib/kubelet/
|
||||
# needed so that any mounts setup inside this container are
|
||||
# propagated back to the host machine.
|
||||
mountPropagation: "Bidirectional"
|
||||
|
|
@ -838,6 +838,6 @@ spec:
|
|||
type: DirectoryOrCreate
|
||||
- name: pods-mount-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/pods
|
||||
path: /var/lib/kubelet/
|
||||
type: Directory
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1248,7 +1248,7 @@ spec:
|
|||
- name: libnvpair
|
||||
mountPath: /lib/libnvpair.so.1
|
||||
- name: pods-mount-dir
|
||||
mountPath: /var/lib/kubelet/pods
|
||||
mountPath: /var/lib/kubelet/
|
||||
# needed so that any mounts setup inside this container are
|
||||
# propagated back to the host machine.
|
||||
mountPropagation: "Bidirectional"
|
||||
|
|
@ -1295,6 +1295,6 @@ spec:
|
|||
type: DirectoryOrCreate
|
||||
- name: pods-mount-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/pods
|
||||
path: /var/lib/kubelet/
|
||||
type: Directory
|
||||
---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue