Ephemeral Containers(临时容器)
使用临时容器来调试的例子
$ kubectl run ephemeral-demo \
--image=registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1 --restart=Never
pod/ephemeral-demo created$ kubectl exec -it ephemeral-demo -- sh
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "1993bffac1b845330114c8a71d16ee918b4586fbd7ad36bd5e6a844b4bdcdc0d": OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown$ kubectl debug -it ephemeral-demo --image=centos:6 --target=ephemeral-demo
Targeting container "ephemeral-demo". If you don't see processes from this container it may be because the container runtime doesn't
support this feature.
Defaulting debug container name to debugger-mmn8j.
If you don't see a command prompt, try pressing enter.
[root@ephemeral-demo /]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 03:10 ? 00:00:00 /pause
root 18 0 0 03:12 pts/0 00:00:00 /bin/bash
root 31 18 0 03:12 pts/0 00:00:00 ps -ef最后更新于