From 2dd3bbc5f1747d52500b7e57685cf433e7e00d36 Mon Sep 17 00:00:00 2001 From: windsonsea Date: Wed, 18 Dec 2024 11:23:25 +0800 Subject: [PATCH] [zh] Add instrumentation/zpages.md --- .../docs/reference/instrumentation/zpages.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 content/zh-cn/docs/reference/instrumentation/zpages.md diff --git a/content/zh-cn/docs/reference/instrumentation/zpages.md b/content/zh-cn/docs/reference/instrumentation/zpages.md new file mode 100644 index 0000000000..a82bffe542 --- /dev/null +++ b/content/zh-cn/docs/reference/instrumentation/zpages.md @@ -0,0 +1,104 @@ +--- +title: Kubernetes z-pages +content_type: reference +weight: 60 +--- + + + + +{{< feature-state for_k8s_version="v1.32" state="alpha" >}} + + +Kubernetes 的核心组件可以暴露一系列 **z-endpoints**,以便用户更轻松地调试他们的集群及其组件。 +这些端点仅用于人工检查,以获取组件二进制文件的实时调试信息。请不要自动抓取这些端点返回的数据; +在 Kubernetes {{< skew currentVersion >}} 中,这些是 **Alpha** 特性,响应格式可能会在未来版本中发生变化。 + + + + +## z-pages + +Kubernetes v{{< skew currentVersion >}} 允许你启用 **z-pages** 来帮助排查其核心控制平面组件的问题。 +这些特殊的调试端点提供与正在运行的组件有关的内部信息。对于 Kubernetes {{< skew currentVersion >}}, +这些组件提供以下端点(当启用 z-pages 后): + +- [z-pages](#z-pages) + - [statusz](#statusz) + - [flagz](#flagz) + + +### statusz + +使用 `ComponentStatusz` +[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用后, +`/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` +[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用后, +`/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 +```