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

KEP 4960: Container Stop Signals #49857

Draft
wants to merge 1 commit into
base: dev-1.33
Choose a base branch
from

Conversation

sreeram-venkitesh
Copy link
Member

Description

Docs for KEP 4960: Container Stop Signals.

Related PRs

Issue

Closes: nil, part of kubernetes/enhancements#4960

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Feb 21, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 21, 2025
@sreeram-venkitesh sreeram-venkitesh changed the base branch from main to dev-1.33 February 21, 2025 18:44
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 21, 2025
@sreeram-venkitesh sreeram-venkitesh force-pushed the 4960-container-stop-signals branch from 5ae9029 to 76aad78 Compare February 21, 2025 18:50
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign natalisucks for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 21, 2025
Copy link

netlify bot commented Feb 21, 2025

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit 76aad78
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/67b8caeead46a1000867609c

Copy link

netlify bot commented Feb 21, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 5ae9029
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67b8c97812e525000814ccb1
😎 Deploy Preview https://deploy-preview-49857--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 21, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 76aad78
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67b8caee78734c0008c0c2c4
😎 Deploy Preview https://deploy-preview-49857--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sreeram-venkitesh sreeram-venkitesh marked this pull request as draft February 21, 2025 19:17
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 21, 2025
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Even for alpha stage, I recommend rethinking how we document this.

See inline feedback.

@@ -47,6 +47,11 @@ parameters are passed to the handler.
A more detailed description of the termination behavior can be found in
[Termination of Pods](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination).

`StopSignal`
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't a hook; it's a separate part of Pod lifecycle configuration.

(I'm disagreeing with the KEP, here, which calls it a hook; however, a hook such as preStop is very different from specifying a signal to be emitted).

I recommend you add a new detail within https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination

Mention that even if you don't specify a stop signal within the Pod manifest:

  • the container runtime attempts to signal graceful termination
  • the signalling mechanism is OS-dependent

and then, do mention that you can customise the signal for Linux Pods, by adding a StopSignal entry within lifecycle:


The https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ page should link to Pod termination (but it already does, so no special change needed). The Pod termination page should also link to https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ (but it already does, so no special change needed there either).

defaultValue: false
fromVersion: "1.33"
---
Enables usage of the StopSignal lifecycle hook for containers for configuring custom [stop signals](https://docs.docker.com/reference/dockerfile/#stopsignal) using which the containers would be stopped.
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't link to Docker documentation; link to Kubernetes docs instead.

Comment on lines +52 to +53
The StopSignal hook can be used to define a stop signal which would be sent to the container when it is
stopped. This is equivalent to the `STOPSIGNAL` instruction that we configure when building container images.
Copy link
Contributor

Choose a reason for hiding this comment

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

Prepend “For Linux Pods“ here.

`StopSignal`

The StopSignal hook can be used to define a stop signal which would be sent to the container when it is
stopped. This is equivalent to the `STOPSIGNAL` instruction that we configure when building container images.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct?

Suggested change
stopped. This is equivalent to the `STOPSIGNAL` instruction that we configure when building container images.
stopped. If you set this, it overrides any `STOPSIGNAL` instruction defined within the container image.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. language/en Issues or PRs related to English language size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants