mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
update readme for raw block pvc
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
ef74050af2
commit
9bebd829ab
@ -216,3 +216,65 @@ spec:
|
||||
|
||||
If you access the pod you can check that your data is avaialable at
|
||||
`/var/lib/www/html`
|
||||
|
||||
## Testing Raw Block feature in kubernetes with RBD volumes
|
||||
|
||||
CSI block volume support is feature-gated and turned off by default. To run CSI
|
||||
with block volume support enabled, a cluster administrator must enable the
|
||||
feature for each Kubernetes component using the following feature gate flags:
|
||||
|
||||
--feature-gates=BlockVolume=true,CSIBlockVolume=true
|
||||
|
||||
these feature-gates must be enabled on both api-server and kubelet
|
||||
|
||||
### create a raw-block PVC
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: raw-block-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeMode: Block
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: csi-rbd
|
||||
```
|
||||
|
||||
create raw block pvc
|
||||
|
||||
```console
|
||||
kubectl create -f raw-block-pvc.yaml
|
||||
```
|
||||
|
||||
### create a pod to mount raw-block PVC
|
||||
|
||||
```yaml
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: pod-with-raw-block-volume
|
||||
spec:
|
||||
containers:
|
||||
- name: fc-container
|
||||
image: fedora:26
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: [ "tail -f /dev/null" ]
|
||||
volumeDevices:
|
||||
- name: data
|
||||
devicePath: /dev/xvda
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: raw-block-pvc
|
||||
```
|
||||
|
||||
Create a POD that uses raw block PVC
|
||||
|
||||
```console
|
||||
kubectl create -f raw-block-pod.yaml
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user