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: support ephemeral volumes with Ceph CSI RBD and CephFS driver #9055

Merged
merged 1 commit into from Nov 4, 2021

Conversation

humblec
Copy link
Contributor

@humblec humblec commented Oct 28, 2021

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: my-app
   spec:
  containers:
    - name: csi-rbd-demo-pod
      image: busybox
      volumeMounts:
        - mountPath: "/scratch"
          name: mypvc
      command: [ "sleep", "1000000" ]
  volumes:
    - name: mypvc
      ephemeral:
        volumeClaimTemplate:
          spec:
            accessModes: [ "ReadWriteOnce" ]
            storageClassName: "csi-rbd-sc"
            resources:
              requests:
                storage: 1Gi

Signed-off-by: Humble Chirammal hchiramm@redhat.com

Description of your changes:

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@mergify mergify bot added the ceph main ceph tag label Oct 28, 2021
@humblec humblec force-pushed the ephemeral branch 2 times, most recently from 877088b to d055e2b Compare October 28, 2021 07:31
@humblec
Copy link
Contributor Author

humblec commented Oct 28, 2021

Cc @leseb @travisn

@Madhu-1 Madhu-1 added the docs label Oct 28, 2021
Copy link
Member

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

@humblec care to send a PR with the same details to cephcsi also?

Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
cluster/examples/kubernetes/ceph/common.yaml Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
# kubectl delete pod csi-cephfs-demo-ephemeral-pod
pod "csi-cephfs-demo-ephemeral-pod" deleted

# kubectl get pod
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok.. just thought of mentioning it as a confirmation that, pod got deleted successfully and not stuck.

Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
@humblec
Copy link
Contributor Author

humblec commented Oct 28, 2021

@humblec care to send a PR with the same details to cephcsi also?

I was done with ceph csi first, then the RBAC changes looked to be required, so droppped the PR first here. any way I will file the Ceph CSI too

cluster/examples/kubernetes/ceph/common.yaml Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
@humblec humblec force-pushed the ephemeral branch 2 times, most recently from 156bf93 to 713e9e8 Compare October 28, 2021 10:40
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-ephemeralvolume.md Outdated Show resolved Hide resolved
@humblec
Copy link
Contributor Author

humblec commented Nov 2, 2021

@travisn I have trimmed the content and added to csi-drivers.md, ptal.. thanks.

Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

Looks good, just a few more suggestions, thanks!

Documentation/ceph-csi-drivers.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-drivers.md Show resolved Hide resolved
Documentation/ceph-csi-drivers.md Outdated Show resolved Hide resolved
Documentation/ceph-csi-drivers.md Show resolved Hide resolved
Documentation/ceph-csi-drivers.md Show resolved Hide resolved
Documentation/ceph-csi-drivers.md Outdated Show resolved Hide resolved
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>
@humblec
Copy link
Contributor Author

humblec commented Nov 2, 2021

Looks good, just a few more suggestions, thanks!

Thanks @travisn .. Documentation patches are the difficult one to get in shape :) , ptal at latest version. 👍

Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

LGTM!

@travisn travisn requested a review from Madhu-1 November 2, 2021 14:29
@travisn travisn dismissed Madhu-1’s stale review November 4, 2021 15:03

feedback addressed

@travisn travisn merged commit 41ef578 into rook:master Nov 4, 2021
mergify bot added a commit that referenced this pull request Nov 4, 2021
ceph: support ephemeral volumes with Ceph CSI RBD and CephFS driver (backport #9055)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ceph main ceph tag docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants