k8s-查看pod最近一次重启时间
使用命令
- 方法一:以yaml格式查看pod状态,并筛选【lasteState:】参数
[root@K8s-MasterA ~]# kubectl -n ketanyun get pod -oyaml|grep lastState -A 6
lastState:
terminated:
containerID: docker://fae89762baf9e7ee222781fb7c4671a9a96b626b6e80f479e3b9d5703948e36c
exitCode: 143
finishedAt: "2021-12-23T14:30:29Z"
reason: Error
startedAt: "2021-12-20T23:31:50Z"
- 方法二:查看pod的详情,并筛选字段“Last State:”,查看【Finished】内容
[root@K8s-MasterA ~]# kubectl -n ketanyun describe pod |grep "Last State:" -A 4
Last State: Terminated
Reason: Error
Exit Code: 143
Started: Tue, 21 Dec 2021 07:31:50 +0800
Finished: Thu, 23 Dec 2021 22:30:29 +0800
定位到重启时间后,方便进一步排查重启原因。
另外专门查了【pod】的中文对应翻译。这是个多义词,根据pod的功能和属性,感觉豆荚这个解释最合适。
每个容器相当于一个豆子,包含多个容器的[pod]正像一个豆荚。
- 英文词义
荚;荚果
a long thin case filled with seeds that develops from the flowers of some plants, especially peas and beans
官方定义
查看官方定义证实了判断。
- 中文定义
https://kubernetes.io/zh/docs/concepts/workloads/pods/
Pod 是可以在 Kubernetes 中创建和管理的、最小的可部署的计算单元。
Pod (就像在鲸鱼荚或者豌豆荚中)是一组(一个或多个) 容器; 这些容器共享存储、网络、以及怎样运行这些容器的声明。 Pod 中的内容总是并置(colocated)的并且一同调度,在共享的上下文中运行。 Pod 所建模的是特定于应用的“逻辑主机”,其中包含一个或多个应用容器, 这些容器是相对紧密的耦合在一起的。 在非云环境中,在相同的物理机或虚拟机上运行的应用类似于 在同一逻辑主机上运行的云应用。
除了应用容器,Pod 还可以包含在 Pod 启动期间运行的 Init 容器。 你也可以在集群中支持临时性容器 的情况下,为调试的目的注入临时性容器。
- 英文定义
https://kubernetes.io/docs/concepts/workloads/pods/
Pods
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. In non-cloud contexts, applications executed on the same physical or virtual machine are analogous to cloud applications executed on the same logical host.
As well as application containers, a Pod can contain init containers that run during Pod startup. You can also inject ephemeral containers for debugging if your cluster offers this.
- 建议翻译为
容器荚,容器仓,容器箱,容器盒
## 颇为苦恼的是,不够简化易懂。如能找到两个字的本土化翻译就完美了。
拓展思路
根据k8s对docker的强势态度,可以翻译为渔网,鱼兜。docker是鱼,pod是网。
- 参考文档
https://www.5axxw.com/questions/content/8lb5is