i am very new in kubenetes, i want to know why when i remove ‘command: ["/bin/sleep", “3650d”]’ the pod wont “Running”?
apiVersion: v1
kind: Pod
metadata:
name: centos3
spec:
containers:
- image: centos:8
name: centos
command: ["/bin/sleep", “3650d”]
Containers typically have default commands or entrypoints set. The centos:8
container does a no operation
in shell.
$ docker pull centos:8
8: Pulling from library/centos
7a0437f04f83: Already exists
Digest: sha256:5528e8b1b1719d34604c87e11dcd1c0a20bedf46e83b5632cdeac91b8c04efc1
Status: Downloaded newer image for centos:8
docker.io/library/centos:8
$ docker inspect centos:8 | jq '.[].ContainerConfig.Cmd'
[
"/bin/sh",
"-c",
"#(nop) ",
"CMD [\"/bin/bash\"]"
]
$ docker inspect centos:8 | jq '.[].ContainerConfig.Entrypoint'
null