Skip to content

Commit 6cc0e8c

Browse files
nits from review
1 parent f750d66 commit 6cc0e8c

File tree

1 file changed

+14
-6
lines changed
  • keps/sig-node/4960-container-stop-signals

1 file changed

+14
-6
lines changed

keps/sig-node/4960-container-stop-signals/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,22 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
6565

6666
## Summary
6767

68-
Container runtimes let you define a STOPSIGNAL to let your container images change which signal is delivered to kill the container. Currently you can only configure this by defining STOPSIGNAL in the container image definition file before you build the image. This becomes difficult to change when you’re using prebuilt images. This KEP proposes to add support to configure custom stop signals for containers from the ContainerSpec. Kubernetes has no equivalent for STOPSIGNAL as part of Pod or Container APIs. This KEP proposes to add support to configure custom stop signals for containers from the ContainerSpec.
68+
Container runtimes let you define a [STOPSIGNAL](https://docs.docker.com/reference/dockerfile/#stopsignal) to let your container images change which signal is delivered to kill the container. Currently you can only configure this by defining STOPSIGNAL in the container image definition file before you build the image. This becomes difficult to change when you’re using prebuilt images. This KEP proposes to add support to configure custom stop signals for containers from the ContainerSpec. Kubernetes has no equivalent for STOPSIGNAL as part of Pod or Container APIs. This KEP proposes to add support to configure custom stop signals for containers from the ContainerSpec.
6969

7070
## Motivation
7171

72-
Container runtimes like Docker lets you configure the stop signal with which a container would be killed when you start a container. This can be configured either from the container image definition file itself with the STOPSIGNAL instruction or by using the `--stop-signal` flag when starting a container with the respective CLI tool for your runtime. Currently there is no equivalent to this in the Kubernetes APIs.
72+
Container runtimes like Docker let you configure the stop signal with which a container would be killed when you start a container. This can be configured either from the container image definition file itself with the STOPSIGNAL instruction or by using the `--stop-signal` flag when starting a container with the respective CLI tool for your runtime. Currently there is no equivalent to this in the Kubernetes APIs.
7373

7474
While managing containers with Kubernetes, if you want to customize an existing image by changing its predefined stop signal or override the default stop signal of SIGTERM, currently you would have to rebuild the container image and update the stop signal at the image definition level.
7575

76-
Having stop signal as a first class citizen in the container specification would make it easier for users to set custom stop signals for their containers across all types of workloads.
76+
Having stop signal as a first class citizen in the Pod's container specification would make it easier for users to set custom stop signals for their containers across all types of workloads.
7777

7878
### Goals
7979

8080
- Add a new StopSignal field to ContainerSpec
8181
- Update the CRI API to take StopSignal as a field in the StopContainerRequest and pass it down to the container runtime via the StopContainer method of remoteRuntimeService
82-
- Update StopContainer implementation in container runtimes to use the container’s StopSignal, if defined as the stop signal when killing containers.
82+
- Update StopContainer implementation in container runtimes to use the container’s StopSignal, if defined as the stop signal when killing containers
83+
- Add support for sending stop signal as a parameter with the `crictl stop` command
8384

8485
### Non-Goals
8586

@@ -151,7 +152,7 @@ Kubernetes by default sends a SIGTERM to all containers while killing them. When
151152
152153
### Risks and Mitigations
153154
154-
I don't see any issues with adding a new field for the stop signal because this is an optional feature that users.
155+
I don't see any issues with adding a new field for the stop signal because this is an optional feature.
155156
156157
## Design Details
157158
@@ -185,19 +186,26 @@ Alpha:
185186
186187
- Test that containers are killed with the right stop signal when StopSignal is passed
187188
- Test that containers are killed with SIGTERM when no StopSignal is passed
189+
- Test that the Status returns the correct StopSignal in all the following cases:
190+
- When StopSignal is defined in the Container Spec (Status should have signal is defined in the Spec)
191+
- When StopSignal is only defined in the container image (Status should have the signal defined in the image)
192+
- When no StopSignal is defined (StopSignal in Status should be SIGTERM)
193+
- Test that the StopSignal is gracefully degraded when StopSignal is specifed but the container runtime is on a version that doesn't support the implementation
194+
- Test that the feature is gracefully degraded when StopSignal is not supported in Kubelet but is supported in the container runtime
188195
189196
### Graduation Criteria
190197
191198
#### Alpha
192199
193200
- Feature implemented behind a feature flag
194201
- CRI API implementation completed in containerd marked as experimental
202+
- CRI API implementation completed for CRI-O
195203
- Initial e2e tests completed and enabled, testing the feature against containerd
196204
- Unit tests for validation, e2e tests for version skew
197205
198206
#### Beta
199207
200-
- CRI API implementation for CRI-O
208+
- Add support for Windows
201209
- Gather feedback from developers and surveys
202210
- e2e tests for CRI-O
203211

0 commit comments

Comments
 (0)