K8S基本操作-36-當Kube-API Server 失效時用 CRICTL 檢查錯誤
失效情況
當 ETCD server 失效,或者 Kube API server 失效時,這時無法使用 kubectl 指令登入查看。
這種時刻,需要做的就是登入該 Server ,然後使用 K8S 採用的容器 Runtime 工具來檢查錯誤報告。
普遍來說,沒有特別設置 Docker 作為 Runtime 則是使用 CRI。
CRI 檢視所有容器,這時觀察哪個容器是故障,或者不斷重新啟動的:
crictl ps -a
接著檢視容器的 Log:
crictl logs <容器ID>
接著就能試圖從 Log 理解錯誤所在了。