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

Let kubelet respect pod's finalizers #76360

Closed
hex108 opened this issue Apr 10, 2019 · 2 comments
Closed

Let kubelet respect pod's finalizers #76360

hex108 opened this issue Apr 10, 2019 · 2 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@hex108
Copy link
Contributor

hex108 commented Apr 10, 2019

What would you like to be added:
If pod's finalizer list is not empty, kubelet should keep it running until its finalizer list is empty even its deletion timestamp is set.

Why is this needed:
If I understand it correctly, finalizer works as a pre-delete hook. We create ingress for pods, and want to remove pod from ingress firstly before terminating it, then we could avoid request traffic are sent to pods that are not running.

/sig node

@hex108 hex108 added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 10, 2019
@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Apr 10, 2019
@liggitt
Copy link
Member

liggitt commented Apr 10, 2019

Finalizers control the API object lifecycle, not the lifecycle of the pod process. A pod that has had deletion requested is subject to it's process being terminated.

You can use the preStop lifecycle and/or terminationGracePeriodSeconds in combination with SIGTERM handling in your container process to control how long a pod remains running after deletion is requested to give your controller time to observe the deletionTimestamp and react prior to the container process being terminated.

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

Finalizers control the API object lifecycle, not the lifecycle of the pod process. A pod that has had deletion requested is subject to it's process being terminated.

You can use the preStop lifecycle and/or terminationGracePeriodSeconds in combination with SIGTERM handling in your container process to control how long a pod remains running after deletion is requested to give your controller time to observe the deletionTimestamp and react prior to the container process being terminated.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests

3 participants