Open
Description
What happened?
A terminated container cannot restart when there is any terminating container in the same pod.
/sig node
What did you expect to happen?
I expect the terminated container can restart during another container's termination.
How can we reproduce it (as minimally and precisely as possible)?
Make a pod with
- terminating-container: terminate because of the liveness failure
- restarting-container: exit immediately
apiVersion: v1
kind: Pod
metadata:
labels:
run: test
name: test
spec:
containers:
- args:
- bash
- "-c"
- |
_term() {
echo "terminating..." >> /shared/log
sleep 15s
echo "terminated" >> /shared/log
exit 0
}
trap _term TERM
exec sleep infinity & wait $!
livenessProbe:
exec:
command:
- "false"
periodSeconds: 1
failureThreshold: 1
image: ubuntu
name: terminating-container
volumeMounts:
- name: log
mountPath: /shared
- args:
- bash
- "-c"
- echo "start a container" >> /shared/log
image: ubuntu
name: restarting-container
volumeMounts:
- name: log
mountPath: /shared
- args:
- tail
- -F
- /shared/log
image: ubuntu
name: log
volumeMounts:
- name: log
mountPath: /shared
volumes:
- name: log
emptyDir: {}
$ kubectl logs test -c log -f
start a container
start a container
terminating...
terminated
start a container
terminating...
terminated
terminating...
terminated
start a container
terminating...
terminated
terminating...
terminated
start a container
terminating...
terminated
start a container
The result is saying that no container restarts during the termination.
Anything else we need to know?
No response
Kubernetes version
$ kubectl version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.0
Cloud provider
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
Metadata
Metadata
Assignees
Labels
Categorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.Important over the long term, but may not be staffed and/or may need multiple releases to complete.Important over the long term, but may not be staffed and/or may need multiple releases to complete.Categorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.Indicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Type
Projects
Status
Triaged