Kubernetes z-pages

提供 Kubernetes 元件的執行時診斷,深入瞭解元件的執行時狀態和配置標誌。
功能狀態: Kubernetes v1.32 [alpha]

Kubernetes 核心元件可以暴露一組 z-endpoints,以便使用者更容易地除錯其叢集及其元件。這些端點僅供人工檢查,以獲取元件二進位制檔案的即時除錯資訊。請避免自動抓取這些端點返回的資料;在 Kubernetes 1.34 中,它們是一項 **alpha** 功能,響應格式在未來版本中可能會發生變化。

z-pages

Kubernetes v1.34 允許您啟用 z-pages 來幫助您排查其核心控制平面元件的問題。這些特殊的除錯端點提供有關正在執行元件的內部資訊。對於 Kubernetes 1.34,元件(啟用後)會提供以下端點:

statusz

使用 ComponentStatusz 功能門啟用後,/statusz 端點會顯示元件的高階資訊,例如其 Kubernetes 版本、模擬版本、啟動時間和更多資訊。

API 伺服器的 /statusz 響應類似於:

kube-apiserver statusz
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

Started: Wed Oct 16 21:03:43 UTC 2024
Up: 0 hr 00 min 16 sec
Go version: go1.23.2
Binary version: 1.32.0-alpha.0.1484+5eeac4f21a491b-dirty
Emulation version: 1.32.0-alpha.0.1484

flagz

使用 ComponentFlagz 功能門啟用後,/flagz 端點會顯示用於啟動元件的命令列引數。

API 伺服器的 /flagz 資料看起來像這樣:

kube-apiserver flags
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

advertise-address=192.168.8.2
contention-profiling=false
enable-priority-and-fairness=true
profiling=true
authorization-mode=[Node,RBAC]
authorization-webhook-cache-authorized-ttl=5m0s
authorization-webhook-cache-unauthorized-ttl=30s
authorization-webhook-version=v1beta1
default-watch-cache-size=100
最後修改於 2025 年 2 月 25 日,太平洋標準時間上午 2:02: 更新 zpages.md (ae7a5944f3)