kubernetes: kubectl shows Pod status Completed if one of the containers exited with an Error
What happened:
Running a Job with two or more containers creates a Pod. If one of the container fails such Pod status in kubectl is shown as Completed if the name of such container is the last name of the container names ordered alphabetically.
What you expected to happen:
If the container who’s name is the last name of the container names ordered alphabetically fails the Pod status in kubectl should be shown as Error.
How to reproduce it (as minimally and precisely as possible):
cat << EOF | kubectl create -f -
apiVersion: batch/v1
kind: Job
metadata:
name: test
spec:
backoffLimit: 0
completionMode: NonIndexed
parallelism: 1
suspend: false
template:
spec:
restartPolicy: Never
containers:
- command:
- /bin/sh
- -exc
- "true"
name: a
image: busybox
- command:
- /bin/sh
- -exc
- "false"
name: z
image: busybox
EOF
Anything else we need to know?:
Environment:
- Kubernetes client and server versions (use
kubectl version
):
Client Version: v1.28.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.22.17
- Cloud provider or hardware configuration:
kind v0.15.0 go1.19 linux/amd64
- OS (e.g:
cat /etc/os-release
):
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
About this issue
- Original URL
- State: open
- Created 8 months ago
- Comments: 15 (9 by maintainers)
kube version
no recurrence in v1.27
No recurrence in v1.28.2 Maybe we need more information and other reproduction methods or does Kubernetes v1.28.0 has this bug?