k8s-查看pod最近一次重啟時間


使用命令
  • 方法一:以yaml格式查看pod狀態,並篩選【lasteState:】參數
[root@K8s-MasterA ~]# kubectl -n ketanyun get pod <pod-name> -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 <pod-name> |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
官方定義

查看官方定義證實了判斷。

Pod 是可以在 Kubernetes 中創建和管理的、最小的可部署的計算單元。

Pod (就像在鯨魚莢或者豌豆莢中)是一組(一個或多個) 容器; 這些容器共享存儲、網絡、以及怎樣運行這些容器的聲明。 Pod 中的內容總是並置(colocated)的並且一同調度,在共享的上下文中運行。 Pod 所建模的是特定於應用的“邏輯主機”,其中包含一個或多個應用容器, 這些容器是相對緊密的耦合在一起的。 在非雲環境中,在相同的物理機或虛擬機上運行的應用類似於 在同一邏輯主機上運行的雲應用。

除了應用容器,Pod 還可以包含在 Pod 啟動期間運行的 Init 容器。 你也可以在集群中支持臨時性容器 的情況下,為調試的目的注入臨時性容器。
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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM