第五次 2022-02-26 Chapter 6. Managing the lifecycle of the Pod’s containers === - Q: Pod phase 不確定作者為什麼會寫 Unknown - 根據官方文件,Pod phase 有定義 Unknown,大致上就是 Pod 跟 API server 失聯就會被標記為 Unknown,原因可能性很多。 - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ - Q: contianer return exit code,會是 container 內的 root process 是 application process 還是會是 fork 出來所執行的 process retrun 的? - A: 基本上要查看 Dockerfile 定義最後是透過怎樣方式執行 application。以 [Nginx container](https://github.com/nginxinc/docker-nginx/blob/6f0396c1e06837672698bc97865ffcea9dc841d5/mainline/debian/Dockerfile#L114) 為例,可以看到最後他是透過 CMD nginx 來執行,也可以在 contianer root process 為 nginx: master process ``` $ kubectl -n demo-nginx exec -it demo-nginx-deployment-75966cf8c6-blxr8 -- bash root@demo-nginx-deployment-75966cf8c6-blxr8:/# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 8852 6104 ? Ss 13:42 0:00 nginx: master process nginx -g daemon off; nginx 31 0.0 0.0 9240 2588 ? S 13:42 0:00 nginx: worker process nginx 32 0.0 0.0 9240 2588 ? S 13:42 0:00 nginx: worker process root 33 0.0 0.0 4096 3308 pts/0 Ss 13:42 0:00 bash root 384 0.0 0.0 6696 2816 pts/0 R+ 13:43 0:00 ps aux ``` - 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up