|
| 1 | +--- |
| 2 | +title: Kubernetes z-pages |
| 3 | +content_type: reference |
| 4 | +weight: 60 |
| 5 | +--- |
| 6 | +<!-- |
| 7 | +title: Kubernetes z-pages |
| 8 | +content_type: reference |
| 9 | +weight: 60 |
| 10 | +reviewers: |
| 11 | +- dashpole |
| 12 | +--> |
| 13 | + |
| 14 | +<!-- overview --> |
| 15 | + |
| 16 | +{{< feature-state for_k8s_version="v1.32" state="alpha" >}} |
| 17 | + |
| 18 | +<!-- |
| 19 | +Kubernetes core components can expose a suite of _z-endpoints_ to make it easier for users |
| 20 | +to debug their cluster and its components. These endpoints are strictly to be used for human |
| 21 | +inspection to gain real time debugging information of a component binary. |
| 22 | +Avoid automated scraping of data returned by these endpoints; in Kubernetes {{< skew currentVersion >}} |
| 23 | +these are an **alpha** feature and the response format may change in future releases. |
| 24 | +--> |
| 25 | +Kubernetes 的核心组件可以暴露一系列 **z-endpoints**,以便用户更轻松地调试他们的集群及其组件。 |
| 26 | +这些端点仅用于人工检查,以获取组件二进制文件的实时调试信息。请不要自动抓取这些端点返回的数据; |
| 27 | +在 Kubernetes {{< skew currentVersion >}} 中,这些是 **Alpha** 特性,响应格式可能会在未来版本中发生变化。 |
| 28 | + |
| 29 | +<!-- body --> |
| 30 | + |
| 31 | +<!-- |
| 32 | +## z-pages |
| 33 | +
|
| 34 | +Kubernetes v{{< skew currentVersion >}} allows you to enable _z-pages_ to help you troubleshoot |
| 35 | +problems with its core control plane components. These special debugging endpoints provide internal |
| 36 | +information about running components. For Kubernetes {{< skew currentVersion >}}, components |
| 37 | +serve the following endpoints (when enabled): |
| 38 | +--> |
| 39 | +## z-pages |
| 40 | + |
| 41 | +Kubernetes v{{< skew currentVersion >}} 允许你启用 **z-pages** 来帮助排查其核心控制平面组件的问题。 |
| 42 | +这些特殊的调试端点提供与正在运行的组件有关的内部信息。对于 Kubernetes {{< skew currentVersion >}}, |
| 43 | +这些组件提供以下端点(当启用 z-pages 后): |
| 44 | + |
| 45 | +- [z-pages](#z-pages) |
| 46 | + - [statusz](#statusz) |
| 47 | + - [flagz](#flagz) |
| 48 | + |
| 49 | +<!-- |
| 50 | +### statusz |
| 51 | +
|
| 52 | +Enabled using the `ComponentStatusz` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/), |
| 53 | +the `/statusz` endpoint displays high level information about the component such as its Kubernetes version, emulation version, start time and more. |
| 54 | +
|
| 55 | +The `/statusz` response from the API server is similar to: |
| 56 | +--> |
| 57 | +### statusz |
| 58 | + |
| 59 | +使用 `ComponentStatusz` |
| 60 | +[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用后, |
| 61 | +`/statusz` 端点显示有关组件的高级信息,例如其 Kubernetes 版本、仿真版本、启动时间等。 |
| 62 | + |
| 63 | +来自 API 服务器的 `/statusz` 响应类似于: |
| 64 | + |
| 65 | +``` |
| 66 | +kube-apiserver statusz |
| 67 | +Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only. |
| 68 | +
|
| 69 | +Started: Wed Oct 16 21:03:43 UTC 2024 |
| 70 | +Up: 0 hr 00 min 16 sec |
| 71 | +Go version: go1.23.2 |
| 72 | +Binary version: 1.32.0-alpha.0.1484+5eeac4f21a491b-dirty |
| 73 | +Emulation version: 1.32.0-alpha.0.1484 |
| 74 | +``` |
| 75 | + |
| 76 | +<!-- |
| 77 | +### flagz |
| 78 | +
|
| 79 | +Enabled using the `ComponentFlagz` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/), the `/flagz` endpoint shows you the command line arguments that were used to start a component. |
| 80 | +
|
| 81 | +The `/flagz` data for the API server looks something like: |
| 82 | +--> |
| 83 | +### flagz |
| 84 | + |
| 85 | +使用 `ComponentFlagz` |
| 86 | +[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用后, |
| 87 | +`/flagz` 端点为你显示用于启动某组件的命令行参数。 |
| 88 | + |
| 89 | +API 服务器的 `/flagz` 数据看起来类似于: |
| 90 | + |
| 91 | +``` |
| 92 | +kube-apiserver flags |
| 93 | +Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only. |
| 94 | +
|
| 95 | +advertise-address=192.168.8.2 |
| 96 | +contention-profiling=false |
| 97 | +enable-priority-and-fairness=true |
| 98 | +profiling=true |
| 99 | +authorization-mode=[Node,RBAC] |
| 100 | +authorization-webhook-cache-authorized-ttl=5m0s |
| 101 | +authorization-webhook-cache-unauthorized-ttl=30s |
| 102 | +authorization-webhook-version=v1beta1 |
| 103 | +default-watch-cache-size=100 |
| 104 | +``` |
0 commit comments