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

Use inner volume name instead of outer volume name for subpath directory #61373

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

msau42
Copy link
Member

@msau42 msau42 commented Mar 19, 2018

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:

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.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 19, 2018
@msau42
Copy link
Member Author

msau42 commented Mar 19, 2018

/assign @jsafrane @jingxu97
/cc @liggitt @gnufied @saad-ali
@kubernetes/sig-storage-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Mar 19, 2018
@msau42 msau42 force-pushed the subpath-reconstruct branch 2 times, most recently from b3f5261 to 779b650 Compare March 20, 2018 18:07
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 20, 2018
@msau42 msau42 changed the title WIP: Use inner volume name instead of outer volume name for subpath directory Use inner volume name instead of outer volume name for subpath directory Mar 21, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 21, 2018
@msau42
Copy link
Member Author

msau42 commented Mar 21, 2018

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.

@@ -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" {
Copy link
Member Author

@msau42 msau42 Mar 21, 2018

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?).

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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.

@saad-ali saad-ali added this to the v1.10 milestone Mar 21, 2018
@saad-ali saad-ali added kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. status/approved-for-milestone labels Mar 21, 2018
@gnufied
Copy link
Member

gnufied commented Mar 21, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 21, 2018
@msau42
Copy link
Member Author

msau42 commented Mar 21, 2018

/assign @tallclair for kubelet approval

@tallclair
Copy link
Member

/lgtm

@@ -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.
Copy link
Contributor

@jingxu97 jingxu97 Mar 22, 2018

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2018
@msau42
Copy link
Member Author

msau42 commented Mar 22, 2018

/test pull-kubernetes-integration

@saad-ali
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 22, 2018
@saad-ali
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process

@gnufied @jingxu97 @jsafrane @msau42 @saad-ali @tallclair

Pull Request Labels
  • sig/storage: Pull Request will be escalated to these SIGs if needed.
  • priority/critical-urgent: Never automatically move pull request out of a release milestone; continually escalate to contributor and SIG through all available channels.
  • kind/bug: Fixes a bug discovered during the current release.
Help

@k8s-github-robot
Copy link

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.

@k8s-github-robot k8s-github-robot merged commit d23066e into kubernetes:master Mar 22, 2018
k8s-github-robot pushed a commit that referenced this pull request Mar 23, 2018
…-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.
```
k8s-github-robot pushed a commit that referenced this pull request Mar 24, 2018
…-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.
```
k8s-github-robot pushed a commit that referenced this pull request Mar 26, 2018
…-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.
```
k8s-github-robot pushed a commit that referenced this pull request Mar 27, 2018
…-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.
```
@msau42 msau42 deleted the subpath-reconstruct branch November 17, 2018 21:04
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pvc volumes used with subPath volume mounts don't support reconstruction
9 participants