Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Conversation

@avalluri
Copy link
Contributor

@avalluri avalluri commented Aug 7, 2019

Signed-off-by: Amarnath Valluri amarnath.valluri@intel.com

@okartau
Copy link
Contributor

okartau commented Aug 9, 2019

should we also revert effect of #362 which added refusal all block volume requests

@avalluri
Copy link
Contributor Author

should we also revert effect of #362 which added refusal all block volume requests

Thanks, @okartau. Good point, I reverted the change, let's see if it breaks andy tests

@avalluri avalluri changed the title WIP: Adding support for block volumes Adding support for block volumes Aug 20, 2019
@avalluri avalluri requested review from okartau and pohly and removed request for okartau August 22, 2019 08:01
@okartau
Copy link
Contributor

okartau commented Aug 22, 2019

What about deployment examples, should we show provisioning of a block volume ?
Also, should we describe block volume support in README ?

@avalluri
Copy link
Contributor Author

What about deployment examples, should we show provisioning of a block volume ?

I added an example app and PVC part of this change. Do you think need more?

Also, should we describe block volume support in README ?

Yes, I guess we should mention this in ReadMe, I will do that.

@avalluri
Copy link
Contributor Author

Also, should we describe block volume support in README ?

Yes, I guess we should mention this in ReadMe, I will do that.

Updated ReadMe with Block volume usage, @okartau Can you check if it is clear enough.

README.md Outdated
#### Note about raw block volumes
Applications can use volumes provisioned by PMEM-CSI as [raw block devices](https://kubernetes.io/blog/2019/03/07/raw-block-volume-support-to-beta/). For provisioning a PMEM volume that supposed to use as raw block device, one has to create a `PersistentVolumeClaim` with `volumeMode: Block`. Check with provided example [PVC](deploy/common/pmem-pvc-block-volume.yaml) and [application](deploy/common/pmem-app-block-volume.yaml) for usage reference.
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of:
For provisioning a PMEM volume that supposed to use as raw block device
how about simpler:
For provisioning a PMEM volume as a raw block device

similarly:
instead of:
Check with provided example
use:
See example

We can also wait for few more days when @pohly gets back, he can also take a look on these sentences.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @okartau's proposed language changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those changes are al

Olev Kartau notifications@github.com writes:

Do we already have tests (e.g. from Kubernetes or csi-test) which cover block volumes? while working with #365 I noticed that if we dont respond NOT_SUPPORTED for block volume mode, and we enable VolumeMode suite, then some (just few) more tests are executed. I guess these may be about block volumes.
Can we pull that into this PR?

Now I pulled the commit from #365 that enables the block volume test suite.

@avalluri
Copy link
Contributor Author

@pohly Can you give review comments.

@avalluri avalluri force-pushed the blockvolume branch 2 times, most recently from 50a59da to 43cedd4 Compare September 18, 2019 06:02
@pohly
Copy link
Contributor

pohly commented Sep 25, 2019

Needs to be rebased...

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

Do we already have tests (e.g. from Kubernetes or csi-test) which cover block volumes?

@okartau
Copy link
Contributor

okartau commented Sep 25, 2019

Do we already have tests (e.g. from Kubernetes or csi-test) which cover block volumes?

while working with #365 I noticed that if we dont respond NOT_SUPPORTED for block volume mode, and we enable VolumeMode suite, then some (just few) more tests are executed.
I guess these may be about block volumes. Needs to be clarified more.

@pohly
Copy link
Contributor

pohly commented Sep 25, 2019 via email

@pohly
Copy link
Contributor

pohly commented Sep 26, 2019

Looks like tests are failing?

https://cloudnative-k8sci.southcentralus.cloudapp.azure.com/blue/organizations/jenkins/pmem-csi/detail/PR-380/11/pipeline

[Fail] PMEM Volumes [Driver: pmem-csi] [Testpattern: Dynamic PV (block volmode)] volumeMode [It] should create sc, pod, pv, and pvc, read/write to the pv, and delete all created resources 

/go/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/volumemode.go:282

[Panic!] PMEM Volumes [Driver: pmem-csi] [Testpattern: Dynamic PV (filesystem volmode)] volumeMode [It] should create sc, pod, pv, and pvc, read/write to the pv, and delete all created resources 

/go/src/runtime/panic.go:82

The second one is a timeout.

@okartau
Copy link
Contributor

okartau commented Sep 26, 2019

log shows tester tries to run local kubectl, seems some commits from #365 were left out that work around local kubectl?
For some reason I dont see error "kubectl not found on PATH", have we started installing kubectl on tester host? If not, attempt to use local kubectl may be part of problem here.

@avalluri
Copy link
Contributor Author

Looks like tests are failing?

https://cloudnative-k8sci.southcentralus.cloudapp.azure.com/blue/organizations/jenkins/pmem-csi/detail/PR-380/11/pipeline

[Fail] PMEM Volumes [Driver: pmem-csi] [Testpattern: Dynamic PV (block volmode)] volumeMode [It] should create sc, pod, pv, and pvc, read/write to the pv, and delete all created resources 

/go/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/volumemode.go:282

[Panic!] PMEM Volumes [Driver: pmem-csi] [Testpattern: Dynamic PV (filesystem volmode)] volumeMode [It] should create sc, pod, pv, and pvc, read/write to the pv, and delete all created resources 

/go/src/runtime/panic.go:82

The second one is a timeout.

The other failure was also timeout, while creating a Pod:

Sep 26 09:10:22.329 FAIL: Unexpected error:
    <*errors.errorString | 0xc0008aa0c0>: {
        s: "pod \"security-context-c5352c9b-e03c-11e9-99ce-0242ac110002\" is not Running: timed out waiting for the condition",
    }
    pod "security-context-c5352c9b-e03c-11e9-99ce-0242ac110002" is not Running: timed out waiting for the condition
occurred
github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites.(*volumeModeTestSuite).defineTests.func6()
	/go/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/volumemode.go:282 +0xbe8
github.com/intel/pmem-csi/test/e2e.RunE2ETests(0xc0003eb000)
	/go/src/github.com/intel/pmem-csi/test/e2e/e2e.go:150 +0xa4
github.com/intel/pmem-csi/test/e2e.TestE2E(0xc0003eb000)
	/go/src/github.com/intel/pmem-csi/test/e2e/e2e_test.go:53 +0x2b
testing.tRunner(0xc0003eb000, 0x1ad4dd8)
	/go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
	/go/src/testing/testing.go:916 +0x35a

@okartau
Copy link
Contributor

okartau commented Sep 27, 2019

In driver logs we don't have good explanation why pod is not created.
From Volume POV, I see VolumeCreation with mode=block, but there is no PublishVolume for that VolumeID (and I think Stage should not happen for mode=block volumes?).
I suspect the way tester code creates this pod, is different from how other pods are created in other testing. VolumeMode test code uses CreateSecPodWithNodeName to create a pod: is this different from other testing we use? What is this "SELinuxLabel" security context involved?

@okartau
Copy link
Contributor

okartau commented Sep 27, 2019

I added debug trace in pv_util.go CreateSecPodWithNodeName() printing all args to MakeSecPod, and it appears this is called twice with almost same args (as per calling code in volumemode.go).
The only difference seems to be in pvclaims: in 1st call VolumeMode=*Filesystem, this succeeds.
2nd call will have VolumeMode=*Block, this fails after 5-minute timeout.

@okartau
Copy link
Contributor

okartau commented Sep 27, 2019

I think the error is the one from kubelet emitted close to pod creation failure point:

kubelet pmem-csi-clear-govm-worker2} FailedMapVolume: MapVolume.SetUp failed for volume "pvc-150511aa-e10b-11e9-b34d-0242ac110002" : volumeattachments.storage.k8s.io "csi-2bc0683aaf417707b935a60597d8945cce77abb97a08d8d816addd01b613e70b" is forbidden: User "system:node:pmem-csi-clear-govm-worker2" cannot get resource "volumeattachments" in API group "storage.k8s.io" at the cluster scope: no relationship found between node "pmem-csi-clear-govm-worker2" and this object.

This gives a hint it is a rights/permissions issue.
Search for other discussion by error text leads to
k3s-io/k3s#732

where a work-around was proposed via adding some rights like this:

rules:
- apiGroups:
  - storage.k8s.io
  resources:
  - volumeattachments
  verbs:
  - create
  - watch

Also, it is mentioned that this gets fixed by migration to k8s 1.15 (our CI still runs 1.14, also my trials on stand-alone cluster).

I will re-try in another stand-alone cluster running 1.15, to verify this "fixed in 1.15" claim.
Note that pointed discussion does not touch the aspect why this is related to Block mode

@okartau
Copy link
Contributor

okartau commented Sep 27, 2019

confirmed, Block-mode volume creation and publish works in 1.16 cluster (govm-ubuntu cluster with 4xVM).
There are other errors in test suite, but bock volume test does work.

@avalluri avalluri force-pushed the blockvolume branch 2 times, most recently from efc6409 to 34a2515 Compare October 7, 2019 06:47
@avalluri avalluri force-pushed the blockvolume branch 2 times, most recently from 8bea046 to 5ca43e4 Compare October 15, 2019 07:52
@pohly
Copy link
Contributor

pohly commented Oct 15, 2019

@avalluri: what's the plan regarding Kubernetes 1.14? This isn't part of the pre-merge testing, but we will end up testing on it once it's merged.

// testsuites.InitSnapshottableTestSuite,
// testsuites.InitSubPathTestSuite,
// testsuites.InitVolumeIOTestSuite,
// testsuites.InitVolumeModeTestSuite,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, did the tests actually run for your in block mode? I only get:

PMEM Volumes
/nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/storage/csi_volumes.go:57
  [Driver: pmem-csi]
  /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/storage/csi_volumes.go:102
    [Testpattern: Dynamic PV (block volmode)] volumeMode
    /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/base.go:92
      should not mount / map unused volumes in a pod [BeforeEach]
      /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/volumemode.go:324

      Driver pmem-csi doesn't support  -- skipping

      /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/base.go:151

Copy link
Contributor

Choose a reason for hiding this comment

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

That's because the default file system (i.e. the empty string) is no longer listed as supported:
1f61a3a

Copy link
Contributor

Choose a reason for hiding this comment

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

After adding that, it worked for me, also on Kubernetes 1.14, i.e. I couldn't reproduce the problem that @okartau had.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, did the tests actually run for your in block mode? I only get:

You are right, I realized this when working on ephemeral volumes branch and fixed here : c7f560c

Copy link
Contributor

Choose a reason for hiding this comment

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

Please cherry-pick c9bf3a4 to fix it in this PR.

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

@avalluri: please investigate why it failed on 1.13: #438 (comment)

Also, cherry-pick c9bf3a4 to ensure that that failing test actually runs.

|--------------------+--------------------------------+ ------------------------
| 1.13 | CSINodeInfo, CSIDriverRegistry | unsupported <sup>1</sup>
|--------------------|--------------------------------|----------------
| 1.13 | CSINodeInfo, CSIDriverRegistry,<br>CSIBlockVolume</br>| unsupported <sup>1</sup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why <br> for CSIBlockVolume but not the others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The column is too wide after adding one more feature gate. So, I just made it multi-line column.

@avalluri
Copy link
Contributor Author

@pohly Is it good enough to merge.

Copy link
Contributor

@pohly pohly 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 to me. Let's merge once we have test results.

avalluri and others added 5 commits October 18, 2019 16:40
In commit 2e9fde4, we dropped support for v1.13, but tests are still pointing to
storage class files in deploy/kubernetes-1.13. This change fixes this by
pointing to deploy/common.
Code changes to support provisioning of raw block volumes. For block volumes
driver need not to create a file-system in NodePublishVolume stage.

With this change we only support fsdax raw block volumes. Should find a way to
support 'dax' raw volume, which is a character device.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
As now we support block volumes we no more return "unsupported" for block
volumes. Hence reverting commit 3fcd755.
Several (all?) of the volumeMode tests run with the default filesystem
(i.e. the empty string). If we don't list that as supported, raw block
tests are not executed:

S [SKIPPING] in Spec Setup (BeforeEach) [0.005 seconds]
PMEM Volumes
/nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/storage/csi_volumes.go:57
  [Driver: pmem-csi]
  /nvme/gopath/src/github.com/intel/pmem-csi/test/e2e/storage/csi_volumes.go:102
    [Testpattern: Dynamic PV (block volmode)] volumes
    /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/base.go:92
      should store data [BeforeEach]
      /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/volumes.go:146

      Driver pmem-csi doesn't support  -- skipping

      /nvme/gopath/src/github.com/intel/pmem-csi/vendor/k8s.io/kubernetes/test/e2e/storage/testsuites/base.go:151
@pohly pohly merged commit 484ee99 into intel:devel Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants