Skip to content

Commit f9fc6b4

Browse files
authored
Merge pull request #48228 from pegasas/issues/47823
[SidecarContainer] provide sidecar best practices hints about exit code
2 parents 2abcf8b + 7195f5f commit f9fc6b4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

content/en/docs/concepts/workloads/pods/sidecar-containers.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ maintain sidecar containers without affecting the primary application.
9797
Sidecar containers share the same network and storage namespaces with the primary
9898
container. This co-location allows them to interact closely and share resources.
9999

100+
From Kubernetes perspective, sidecars graceful termination is less important.
101+
When other containers took all alloted graceful termination time, sidecar containers
102+
will receive the `SIGTERM` following with `SIGKILL` faster than may be expected.
103+
So exit codes different from `0` (`0` indicates successful exit), for sidecar containers are normal
104+
on Pod termination and should be generally ignored by the external tooling.
105+
100106
## Differences from init containers
101107

102108
Sidecar containers work alongside the main container, extending its functionality and

content/en/docs/tutorials/configuration/pod-sidecar-containers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Using Kubernetes' native support for sidecar containers provides several benefit
6969
special care is needed to handle this situation.
7070
4. Also, with Jobs, built-in sidecar containers would keep being restarted once they are done, even if regular containers would not with Pod's `restartPolicy: Never`.
7171

72+
See [differences from init containers](/docs/concepts/workloads/pods/sidecar-containers/#differences-from-application-containers) to learn more about it.
73+
7274
## Adopting built-in sidecar containers
7375

7476
The `SidecarContainers` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is in beta state starting from Kubernetes version 1.29 and is enabled by default.

0 commit comments

Comments
 (0)