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

csi-inline-volumes.md: prepare for beta #1172

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Jul 26, 2019

This adds the implementation history and checks which of the proposed
tests are implemented.

/cc @vladimirvivien @kfox111 @msau42

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Jul 26, 2019
@pohly
Copy link
Contributor Author

pohly commented Jul 26, 2019

What else might be needed in the KEP update if we want to go beta in 1.16?

@pohly
Copy link
Contributor Author

pohly commented Jul 26, 2019

/cc @kfox1111

@k8s-ci-robot
Copy link
Contributor

@pohly: GitHub didn't allow me to request PR reviews from the following users: kfox1111.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @kfox1111

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pohly
Copy link
Contributor Author

pohly commented Jul 26, 2019

@vladimirvivien, @kfox1111: can you help identify more tests that have already been implemented?

@pohly pohly force-pushed the ephemeral-inline-volume-beta branch from 67d1638 to 9767794 Compare July 26, 2019 14:33
* Two pods accessing the same ephemeral inline volumes
* Single pod referencing two distinct inline volume request from the same driver
* Pod spec with an ephemeral inline volume request can be mounted/unmounted: https://github.com/pohly/kubernetes/blob/4bc5d065c919fc239e2c8b40e6a96e409ca011fd/test/e2e/storage/csi_mock_volume.go#L356-L371, https://github.com/pohly/kubernetes/blob/4bc5d065c919fc239e2c8b40e6a96e409ca011fd/test/e2e/storage/testsuites/ephemeral.go#L110-L115
* Two pods accessing the same ephemeral inline volume

Choose a reason for hiding this comment

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

How about:
Two pods configured the same (.spec.volumes.name, driver, args) get different volumes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the definition of "different volumes"?

I changed the test case description to "two pods accessing an ephemeral inline volume which has the same attributes in both pods" and the corresponding test creates a second pod, but I don't have any sanity testing for "different volumes".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kfox1111 we can still work on the test cases later. This shouldn't block merging this KEP.

Choose a reason for hiding this comment

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

For example, say you made pod A that has a hostpath ephemeral volume named 'foo' and a command [/bin/sh, -c, 'hostname > /ephemeralmountpoint/hello.txt']

You could wait until you saw that pod go up and the hello.txt get created.

You could then create a second pod, on the same host with a volume named 'foo' configured the same way with:
command [/bin/sh, -c, 'while true; do sleep 1000; done']
And see if you can read /ephemeralmountpoint/hello.txt out of the second container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So "different volumes" basically means "changes not propagated". Yes, that can be tested.

In the meantime, are you okay with merging this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I started to think about it... who guarantees that two pods with the same (as in volume attributes) volume end up with separate volumes? The entire semantic of those volumes is left to the CSI driver. For example, a CSI driver might take no attributes and connect all pods to the same NFS share. That wouldn't be a very useful driver, but it wouldn't be invalid.

I think the test that I have written so far is useful (covers a potential corner case), but we can't make it more strict and keep it generic at the same time.

Choose a reason for hiding this comment

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

the ephemeral volumeHandle generation mechanism ensures that two different pods with the same exact config on the same host, or the same pod with the same config but different volume names each are different volumeHandles.

Choose a reason for hiding this comment

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

For example, very psudocody:

kind: Deployment
spec:
  replicas: 2
  spec:
    nodeSelector: samenode
    volumes:
    - name: foo
      csi:
        driver: hostpath.k8s.io

Creates two different volumes, one per pod. Each pod's volumeHandle is different.

This one also creates two different backing volumes. Two different volumeHandles:

kind: Pod
spec:
  volumes:
  - name: foo
    csi:
      driver: hostpath.k8s.io
  - name: bar
    csi:
      driver: hostpath.k8s.io

In each case, with the ephemeral hostpath driver backing it, it would be the equivalent behavior of using emptyDir: {} instead of csi. No sharing between volumes.

Your technically right, the volume physically being different could be an implemntation detail of the driver. So it could share a read only filesystem and do some careful reference counting. But the above two tests are really the ones I'm interested in making sure work. If they work, other drivers will work properly. Its basically, does the ephemeral volumeHandle generation work properly all the way to the driver. Then the driver can do what it wants with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you want to test volume handle generation, not the behavior of the resulting volumes.

Choose a reason for hiding this comment

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

Yeah.

@pohly pohly force-pushed the ephemeral-inline-volume-beta branch from 9767794 to 994536e Compare July 29, 2019 15:50
@pohly
Copy link
Contributor Author

pohly commented Jul 30, 2019

@msau42 can you approve and merge this now?

@pohly
Copy link
Contributor Author

pohly commented Jul 30, 2019

/assign @saad-ali

Saad, please merge. The discussion with @kfox1111 about testing isn't blocking the KEP.

@kfox1111
Copy link

This looks good to merge to me. We're still debating the test implementation, not that the tests do/don't need to be done.

cannot determine the mode in its `NodePublishVolume` implementation

1.16:
Copy link
Member

Choose a reason for hiding this comment

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

Can you note that this is still in progress for 1.16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I linked to the two PRs instead, with comments about "merged" and "pending".

* CSI Kubelet cleans up ephemeral volume paths once pod goes away: TODO
* Apply PodSecurity settings for allowed CSI drivers: TODO

Copy link
Member

Choose a reason for hiding this comment

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

Also add a line for adding an ephemeral driver to the external test suite

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this:

This adds the implementation history and checks which of the proposed
tests are implemented.
@pohly pohly force-pushed the ephemeral-inline-volume-beta branch from 994536e to c079b27 Compare July 30, 2019 16:10
@msau42
Copy link
Member

msau42 commented Jul 30, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 30, 2019
Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msau42, pohly, saad-ali

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2019
@k8s-ci-robot k8s-ci-robot merged commit cc36040 into kubernetes:master Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants