Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ceph: support ephemeral volumes with Ceph CSI RBD and CephFS driver
This commit make required changes for ceph csi drivers to work with ephemeral volume support. With ephemeral volume support a user can specify ephemeral volumes in its pod spec and tie the lifecycle of the PVC with the POD. An example POD spec looks like this: ``` kind: Pod apiVersion: v1 metadata: name: csi-rbd-demo-ephemeral-pod spec: containers: - name: web-server image: docker.io/library/nginx:latest volumeMounts: - mountPath: "/myspace" name: mypvc volumes: - name: mypvc ephemeral: volumeClaimTemplate: spec: accessModes: ["ReadWriteOnce"] storageClassName: "rook-ceph-block" resources: requests: storage: 1Gi ``` Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
cluster/examples/kubernetes/ceph/csi/cephfs/pod-ephemeral.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-cephfs-demo-ephemeral-pod | ||
spec: | ||
containers: | ||
- name: web-server | ||
image: docker.io/library/nginx:latest | ||
volumeMounts: | ||
- mountPath: "/myspace" | ||
name: mypvc | ||
volumes: | ||
- name: mypvc | ||
ephemeral: | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: ["ReadWriteMany"] | ||
storageClassName: "rook-cephfs" | ||
resources: | ||
requests: | ||
storage: 1Gi |
21 changes: 21 additions & 0 deletions
21
cluster/examples/kubernetes/ceph/csi/rbd/pod-ephemeral.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: csi-rbd-demo-ephemeral-pod | ||
spec: | ||
containers: | ||
- name: web-server | ||
image: docker.io/library/nginx:latest | ||
volumeMounts: | ||
- mountPath: "/myspace" | ||
name: mypvc | ||
volumes: | ||
- name: mypvc | ||
ephemeral: | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: ["ReadWriteOnce"] | ||
storageClassName: "rook-ceph-block" | ||
resources: | ||
requests: | ||
storage: 1Gi |