-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add De-Init Containers for POD Termination Lifecycle #70496
Comments
@kubernetes/sig-architecture /sig architecture |
Is it not an issue though that while for |
i tend to agree with the above statement. if you want to get more attention from maintainers try asking in these slack channels #sig-node or #sig-scheduling. this is not related to code that these sigs maintain: |
@goblain - perhaps I was not detailed enough in my feature request resulting in the above assumptions. I am not necessarily requesting that shutdownContainers succeed prior to POD termination. What I am requesting is, "upon POD termination", shutdownContainer(s) can be triggered. [POD-workers] - State: Terminating In this model, since the termination signal is sent to the POD (and since there is really no way to revert a termination signal), that's all we need to know to trigger a shutdownContainer sequence of jobs. They can trigger asynchronously with the termination signal or wait for the POD to be completely destroyed prior to kicking off -- it really doesn't matter as long as they are executed with or after the termination signal. |
👍 |
Is this different that defer-containers proposal? |
The defer-container proposal would suffice and provide additional benefits. Seems like that proposal was started in 2017. How can we raise the priority? |
/remove-sig architecture |
/remove-sig scheduling |
Defer containers proposal: kubernetes/community#483 Comment on our current hooks generally: kubernetes/community#1171 (comment) cc @kow3ns |
when reviewing kubecon eu talks, I noticed tekton seems to have a similar issue, which they also solved via a "hack" (injecting a smart binary that handles the order). https://youtu.be/4EyTGYB7GvA?t=913 So it seems there are a bunch of use-cases for "run a linear sequence of pods on the same node"), thus a native solution would be quite nice @bobcatfish @mrbobbytables @rochaporto @afortiorama @clelange |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
One of the things I've suffered through is that preStop hooks all happen at once and the container they are associated with gets killed when that preStop is done. There may be some support containers that need to stay up while the main preStop hook happens. So maybe this needs to work with that. Maybe all de-init containers happen first, then prestop hooks, then actual pod death? |
/cc |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
This may be covered by the Sidecar container use case? |
@kfox1111 A sidecar container runs in parallel with the main application. Any sidecars would be stopped in conjunction with the main container. Check this old conversation of defer-containers (de-init containers) here: kubernetes/community#483 |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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. |
+1 - would be useful for example main container is generating some files (it could be database dump, could be unit test reports) - and deinit container - can upload these files somewhere. That way we can split responsibilities and remove some binaries from main container - responsible only for uploading the generated files. |
This should be re-opened or a solution suggested. Waiting for a proper solution, this could help : https://github.com/target/pod-reaper /reopen /remove-lifecycle rotten |
@flavienbwk: You can't reopen an issue/PR unless you authored it or you are a collaborator. In response to this:
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. |
What would you like to be added:
Rationale: Currently, during POD instantiation Kubernetes offers initContainers and PostStart hooks. However, for POD termination, the only offering is PreStop hooks. This enhancement/feature request is to allow the same duality during POD instantiation also during POD termination. Having the ability to have controlled sequential containerized jobs for POD termination allows for dealing with application management such as clearing out configurations, a de registration/or series of de registration processes, or a whole slew of opportunities which are limited by a single PreStop hook.
Why is this needed:
It is needed because it is missing from the Kubernetes ecosystem. Offering initContainers and PostStart hooks for startup but only offering PreStop hooks for termination is extremely limiting. Having a De-Init container (or whatever you would like to call it), is imperative for closing the gap on complete container orchestration.
Example:
I have a vast multi-pod microservices based ecosystem. For example: when certain worker services come online, they can 1-Register with a registration API, 2-Share their configuration with other services, 3-Dynamically build their own configuration based on the current state of the ecosystem, 4-Perform SQL updates, and 5-Obtain a software license via API call - then they can start and run. However during Termination, having this ability to perform the reverse with just a PreStop hook is impossible.
/kind feature
The text was updated successfully, but these errors were encountered: