Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ceph-rbd support #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 173 additions & 36 deletions soda-csi-plug-n-play-poc/Readme.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions soda-csi-plug-n-play-poc/deploy/kubernetes/ceph/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the RBD block device be always mounted at /dev/xvda? usually it is platform and virtualization mechanism dependent

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it is not compulsory, the user can select the desired path for mounting block volumes inside the pod.

volumes:
- name: data
persistentVolumeClaim:
claimName: raw-block-pvc
12 changes: 12 additions & 0 deletions soda-csi-plug-n-play-poc/deploy/kubernetes/ceph/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: raw-block-pvc
spec:
accessModes:
- ReadWriteOnce
volumeMode: Block
resources:
requests:
storage: 1Gi
storageClassName: csi-rbd-ceph-sc
26 changes: 26 additions & 0 deletions soda-csi-plug-n-play-poc/deploy/kubernetes/ceph/sc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-rbd-ceph-sc
parameters:
imageFormat: "2"
imageFeatures: layering
attachMode: rw
profile: f63a7fcc-6e83-49cc-81c1-8627fc8e0f52
clusterID: 4ac5251b-114f-4044-9bec-2d27fadad502
pool: osdsrbd
csi.storage.k8s.io/provisioner-secret-name: csi-rbd-secret
csi.storage.k8s.io/provisioner-secret-namespace: default
csi.storage.k8s.io/controller-expand-secret-name: csi-rbd-secret
csi.storage.k8s.io/controller-expand-secret-namespace: default
csi.storage.k8s.io/node-stage-secret-name: csi-rbd-secret
csi.storage.k8s.io/node-stage-secret-namespace: default
csi.storage.k8s.io/fstype: ext4

volumeBindingMode: Immediate
provisioner: soda-csi
mountOptions:
- discard



9 changes: 9 additions & 0 deletions soda-csi-plug-n-play-poc/deploy/kubernetes/ceph/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: csi-rbd-secret
namespace: default
stringData:
userID: kube
userKey: AQDjZYFgOw/FFxAASWpRJz+H0yI3LU4x6Ct2zA==

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# if Kubernetes version is less than 1.18 change
# apiVersion to storage.k8s.io/v1betav1
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: rbd.csi.ceph.com
spec:
attachRequired: true
podInfoOnMount: false