-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Use inner volume name instead of outer volume name for subpath directory #61373
Use inner volume name instead of outer volume name for subpath directory #61373
Conversation
b3f5261
to
779b650
Compare
779b650
to
a12828f
Compare
This is ready to review. I ran the new e2e tests against an old cluster to verify that they failed, and that the test cluster with the fix passes. Currently running all subpath tests to test for regression. |
test/e2e/storage/subpath.go
Outdated
@@ -307,6 +308,20 @@ var _ = utils.SIGDescribe("Subpath", func() { | |||
|
|||
testPodContainerRestart(f, pod, filePathInVolume, filePathInSubpath) | |||
}) | |||
|
|||
It("should unmount if pod is gracefully deleted while kubelet is down [Disruptive][Slow]", func() { | |||
if curVolType == "hostPath" || curVolType == "hostPathSymlink" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one side issue here that hostpath volume plugin doesn't support reconstruction. We probably need to figure out how to implement support for it otherwise the subpath bind mounts are not going to get cleaned up for hostpath volumes in the reconstruction window (although I still question why do you need to use subpath with hostpath volumes?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regardless of reconstruction after newest bit of refactoring - Teardown
should be called for all volume types that are not in use, including hostpaths. Shouldn't that cleanup subpaths too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes hostpath subpath is cleaned up in normal cases. But in the reconstruction case, it is not. And this PR won't fix that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think graceful pod delete should still work for hostpath. Only forceful delete will fail, so this check can be removed.
/lgtm |
/assign @tallclair for kubelet approval |
/lgtm |
pkg/kubelet/container/runtime.go
Outdated
@@ -470,6 +470,9 @@ type VolumeInfo struct { | |||
// Whether the volume permission is set to read-only or not | |||
// This value is passed from volume.spec | |||
ReadOnly bool | |||
// Inner volume name, which is the PV name if used, otherwise | |||
// it is the same as the outer volume name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change to "InnerVolumeSpecName" for consistency.
also change outer volume name to "OuterVolumeSpecName" in the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8e2e7af
to
91c557f
Compare
/test pull-kubernetes-integration |
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, msau42, saad-ali, tallclair 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 |
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process @gnufied @jingxu97 @jsafrane @msau42 @saad-ali @tallclair Pull Request Labels
|
Automatic merge from submit-queue (batch tested with PRs 61453, 61393, 61379, 61373, 61494). If you want to cherry-pick this change to another branch, please follow the instructions here. |
…-upstream-release-1.10 Automatic merge from submit-queue. [1.10] Automated cherry pick of #61373: Use inner volume name instead of outer volume name for subpath directory Cherry pick of #61373 on release-1.10. #61373: Use inner volume name instead of outer volume name for subpath directory **Release note**: ```release-note ACTION REQUIRED: In-place node upgrades to this release from versions 1.7.14, 1.8.9, and 1.9.4 are not supported if using subpath volumes with PVCs. Such pods should be drained from the node first. ```
…-upstream-release-1.9 Automatic merge from submit-queue. [1.9] Automated cherry pick of #61373: Use inner volume name instead of outer volume name for subpath directory Cherry pick of #61373 on release-1.9. #61373: Use inner volume name instead of outer volume name for subpath directory **Release note**: ```release-note ACTION REQUIRED: In-place node upgrades to this release from versions 1.7.14, 1.8.9, and 1.9.4 are not supported if using subpath volumes with PVCs. Such pods should be drained from the node first. ```
…-upstream-release-1.8 Automatic merge from submit-queue. [1.8] Automated cherry pick of #61373: Use inner volume name instead of outer volume name for subpath directory Cherry pick of #61373 on release-1.8. #61373: Use inner volume name instead of outer volume name for subpath directory **Release note**: ```release-note ACTION REQUIRED: In-place node upgrades to this release from versions 1.7.14 and 1.8.9 are not supported if using subpath volumes with PVCs. Such pods should be drained from the node first. ```
…-upstream-release-1.7 Automatic merge from submit-queue. [1.7] Automated cherry pick of #61373: Use inner volume name instead of outer volume name for subpath directory Cherry pick of #61373 on release-1.7. #61373: Use inner volume name instead of outer volume name for subpath directory **Release note**: ```release-note ACTION REQUIRED: In-place node upgrades to this release from versions 1.7.14 are not supported if using subpath volumes with PVCs. Such pods should be drained from the node first. ```
What this PR does / why we need it:
Fixes volume reconstruction for PVCs with subpath
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #61372
Special notes for your reviewer:
Release note: