diff --git a/README.md b/README.md index 0907a546a..8f49b868f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,60 @@ # Ceph CSI [Container Storage Interface (CSI)](https://github.com/container-storage-interface/) driver, provisioner, and attacher for Ceph RBD and CephFS +# Prerequisite + +## Enable Mount Propagation in Docker + +Comment out `MountFlags=slave` in docker systemd service then restart docker service. +```bash +# systemctl daemon-reload +# systemctl restart docker +``` + +## Enable Kubernetes Feature Gates + +Enable features `MountPropagation=true,CSIPersistentVolume=true` and runtime config `storage.k8s.io/v1alpha1=true` + # Build +```bash +# make container +``` + # Test +## Start rbdplugin and driver registrar + +```bash +# kubectl create -f deploy/kubernetes/rbdplugin.yaml +``` + +### Start CSI external volume provisioner + +```bash +# kubectl create -f deploy/kubernetes/csi-provisioner.yaml +``` + +### Start CSI external volume attacher + +``` +# kubectl create -f deploy/kubernetes/csi-attacher.yaml +``` + +### Verify all componets are ready + +```bash +# kubectl get pod +NAME READY STATUS RESTARTS AGE +csi-attacher-0 1/1 Running 0 6s +csi-nodeplugin-rbdplugin-kwhhc 2/2 Running 0 6m +csi-provisioner-0 1/1 Running 0 1m +``` + +### Create a CSI storage class + + +### Create a PVC + +### Create a Pod diff --git a/deploy/kubernetes/csi-provisioner.yaml b/deploy/kubernetes/csi-provisioner.yaml index f1df00027..6758e3a92 100644 --- a/deploy/kubernetes/csi-provisioner.yaml +++ b/deploy/kubernetes/csi-provisioner.yaml @@ -75,7 +75,7 @@ spec: serviceAccount: csi-provisioner containers: - name: csi-provisioner - image: docker.io/k8scsi/csi-provisioner:latest + image: quay.io/k8scsi/csi-provisioner:latest args: - "--provisioner=rbdplugin" - "--csi-address=$(ADDRESS)" diff --git a/deploy/kubernetes/rbdplugin.yaml b/deploy/kubernetes/rbdplugin.yaml index 2ca814340..2b14bd4be 100644 --- a/deploy/kubernetes/rbdplugin.yaml +++ b/deploy/kubernetes/rbdplugin.yaml @@ -11,6 +11,9 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: csi-nodeplugin rules: + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "update"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "list"] @@ -58,7 +61,7 @@ spec: hostNetwork: true containers: - name: driver-registrar - image: csi_images/driver-registrar:latest + image: docker.io/k8scsi/driver-registrar:latest args: - "--v=5" - "--csi-address=$(ADDRESS)" diff --git a/examples/pvc.yaml b/examples/pvc.yaml index 25f90f965..306d773fa 100644 --- a/examples/pvc.yaml +++ b/examples/pvc.yaml @@ -8,4 +8,4 @@ spec: storageClassName: rbd-csi-provisioner resources: requests: - storage: 1Mi + storage: 1Gi