Skip to content

kubelet: storage: teardown terminated pod volumes#37228

Merged
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
sjenning:teardown-terminated-volumes
Jan 20, 2017
Merged

kubelet: storage: teardown terminated pod volumes#37228
k8s-github-robot merged 1 commit into
kubernetes:masterfrom
sjenning:teardown-terminated-volumes

Conversation

@sjenning

@sjenning sjenning commented Nov 21, 2016

Copy link
Copy Markdown
Contributor

This is a continuation of the work done in #36779

There really is no reason to keep volumes for terminated pods attached on the node. This PR extends the removal of volumes on the node from memory-backed (the current policy) to all volumes.

@pmorie raised a concern an impact debugging volume related issues if terminated pod volumes are removed. To address this issue, the PR adds a --keep-terminated-pod-volumes flag the kubelet and sets it for hack/local-up-cluster.sh.

For consideration in 1.6.

Fixes #35406

@derekwaynecarr @vishh @dashpole

kubelet tears down pod volumes on pod termination rather than pod deletion

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 21, 2016
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Nov 21, 2016
@sjenning sjenning force-pushed the teardown-terminated-volumes branch from d64543e to 76be092 Compare November 21, 2016 18:33
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2016
@sjenning sjenning force-pushed the teardown-terminated-volumes branch from 76be092 to 48a5d14 Compare November 21, 2016 19:33
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Jenkins unit/integration failed for commit 48a5d14ae7c78abeed116bd62ad7636d41584f20. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Jenkins verification failed for commit 48a5d14ae7c78abeed116bd62ad7636d41584f20. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@smarterclayton smarterclayton added this to the v1.6 milestone Nov 21, 2016
@smarterclayton

Copy link
Copy Markdown
Contributor

In the long run I could imagine tagging specific containers and pods as having a "retainPolicy" that allows debugging of other aspects, not just volumes, post pod termination. Things like logs, network artifacts, etc. But that doesn't block or inhibit this work.

@sjenning sjenning force-pushed the teardown-terminated-volumes branch from 48a5d14 to 22500b6 Compare November 21, 2016 21:04
@sjenning sjenning changed the title kubelet: storage: teardown terminated volumes kubelet: storage: teardown terminated pod volumes Nov 21, 2016
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2016
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Jenkins Bazel Build failed for commit 22500b6cf904c0b7e7fd2180b0b8a85aaf508a4e. Full PR test history.

The magic incantation to run this job again is @k8s-bot bazel test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Jenkins kops AWS e2e failed for commit 22500b6cf904c0b7e7fd2180b0b8a85aaf508a4e. Full PR test history.

The magic incantation to run this job again is @k8s-bot kops aws e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@derekwaynecarr

Copy link
Copy Markdown
Member

In the long run, i want to be able to schedule on local disk, so keeping disk cleanup with pod lifetime is important. I guess we could do something like retainPolicy, but it would need to be visible to scheduler.

@mikedanese

Copy link
Copy Markdown
Member

@k8s-bot bazel test this, issue kubernetes/test-infra#1152

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 24, 2016
@sjenning sjenning force-pushed the teardown-terminated-volumes branch from 22500b6 to 0248edf Compare November 29, 2016 15:17
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 29, 2016
@sjenning

Copy link
Copy Markdown
Contributor Author

@saad-ali @kubernetes/sig-storage

I would like to get this in early in the 1.6 dev cycle so it has time to soak. Reviews appreciated!

@vishh

vishh commented Nov 30, 2016

Copy link
Copy Markdown
Contributor

cc @dashpole who is working on cleaning up all volumes as part of pod termination.

@saad-ali saad-ali self-assigned this Nov 30, 2016
@saad-ali

Copy link
Copy Markdown
Member

I would like to get this in early in the 1.6 dev cycle so it has time to soak. Reviews appreciated!

Ack, will take a look as soon as 1.5 release is out.

@derekwaynecarr

Copy link
Copy Markdown
Member

@vishh -- you agree we could stage the work? for example, accept this change before taking any larger refactor that @dashpole was looking at performing?

@derekwaynecarr

Copy link
Copy Markdown
Member

for example, it seems like we will need to have a flag like this to preserve legacy behavior no matter any future solution

@sjenning sjenning force-pushed the teardown-terminated-volumes branch from 60ddd40 to ffdf5de Compare January 3, 2017 21:55
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 3, 2017
@sjenning

sjenning commented Jan 4, 2017

Copy link
Copy Markdown
Contributor Author

@saad-ali I think I addressed your feedback in the latest commits. Can you look again?

@jingxu97 This is the first I'm learning of a controller the cares about volumes. I see from #20262 this was created to mount cloud volumes (GPD, EBS, Cinder, etc) to the nodes. Looks like a rough copy of the kubelet volume manager. Not sure how the states of the world sync between the two.

Does anything need to be done wrt the attachdeatch controller?

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 6, 2017
@saad-ali saad-ali added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jan 19, 2017
@saad-ali

Copy link
Copy Markdown
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 Jan 19, 2017
@saad-ali

Copy link
Copy Markdown
Member

Feel free to readd LGTM label after rebase. And please add a release note.

@sjenning sjenning force-pushed the teardown-terminated-volumes branch from ffdf5de to e2750a3 Compare January 20, 2017 17:08
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 20, 2017
@sjenning

Copy link
Copy Markdown
Contributor Author

can I re-add an lgtm on my own PR?

/lgtm

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@sjenning: you can't LGTM your own PR.

Details

In response to this comment:

can I re-add an lgtm on my own PR?

/lgtm

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. I understand the commands that are listed here.

@vishh

vishh commented Jan 20, 2017 via email

Copy link
Copy Markdown
Contributor

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@vishh: you can't LGTM a PR unless you are an assignee.

Details

In response to this comment:

/lgtm

On Fri, Jan 20, 2017 at 11:11 AM, k8s-ci-robot notifications@github.com
wrote:

@sjenning https://github.com/sjenning: you can't LGTM your own PR.

In response to this comment
#37228 (comment)
:

can I re-add an lgtm on my own PR?

/lgtm

Instructions for interacting with me using PR comments are available here
https://github.com/kubernetes/community/blob/master/contributors/devel/pull-request-commands.md.
If you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:
repository. I understand the commands that are listed here
https://github.com/kubernetes/test-infra/blob/master/prow/commands.md.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#37228 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGvIKI1kkPryIObeg0H2Lyuy_lc7Nv5mks5rUQbFgaJpZM4K4imT
.

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. I understand the commands that are listed here.

@derekwaynecarr derekwaynecarr self-assigned this Jan 20, 2017
@derekwaynecarr

Copy link
Copy Markdown
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 Jan 20, 2017
@k8s-github-robot

Copy link
Copy Markdown

Automatic merge from submit-queue (batch tested with PRs 37228, 40146, 40075, 38789, 40189)

@k8s-github-robot k8s-github-robot merged commit dcf14ad into kubernetes:master Jan 20, 2017
k8s-github-robot pushed a commit that referenced this pull request Jan 26, 2017
Automatic merge from submit-queue

Delay deletion of pod from the API server until volumes are deleted

Depends on #37228, and will not pass tests until that PR is merged, and this is rebased.

Keeps all kubelet behavior the same, except the kubelet will not make the "Delete" call (kubeClient.Core().Pods(pod.Namespace).Delete(pod.Name, deleteOptions)) until the volumes associated with that pod are removed.  I will perform some performance testing so that we better understand the latency impact of this change.

Is kubelet_pods.go the correct file to include the "when can I delete this pod" logic?

cc: @vishh @sjenning @derekwaynecarr
k8s-github-robot pushed a commit that referenced this pull request Aug 1, 2017
Automatic merge from submit-queue (batch tested with PRs 49284, 49555, 47639, 49526, 49724)

skip WaitForAttachAndMount for terminated pods in syncPod

Fixes #49663

I tried to tread lightly with a small localized change because this needs to be picked to 1.7 and 1.6 as well.

I suspect this has been as issue since we started unmounting volumes on pod termination #37228

xref openshift/origin#14383

@derekwaynecarr @eparis @smarterclayton @saad-ali @jwforres 

/release-note-none
@sjenning sjenning deleted the teardown-terminated-volumes branch August 16, 2017 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

9 participants