Skip to content

Commit 58efab3

Browse files
address comments
Co-authored-by: Susan Sica <[email protected]>
1 parent 900b5a6 commit 58efab3

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

content/en/blog/_posts/2025-11-13-zpages-for-kubernetes.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ draft: true
55
slug: kubernetes-1-35-structured-zpages
66
author: >
77
[Richa Banker](https://github.com/richabanker),
8-
[Han Kang](https://github.com/logicalhan)
8+
[Han Kang](https://github.com/cncf/memorials/blob/main/han-kang.md)
99
---
1010

1111
Debugging Kubernetes control plane components can be challenging, especially when you need to quickly understand the runtime state of a component or verify its configuration. With Kubernetes 1.35, we're enhancing the z-pages debugging endpoints with structured, machine-parseable responses that make it easier to build tooling and automate troubleshooting workflows.
1212

1313
## What are z-pages?
1414

15-
z-pages are special debugging endpoints exposed by Kubernetes control plane components. Introduced as an alpha feature in Kubernetes 1.32, these endpoints provide runtime diagnostics for components like kube-apiserver, kube-controller-manager, kube-scheduler, kubelet and kube-proxy. The name "z-pages" comes from the convention of using `/z*` paths for debugging endpoints.
15+
z-pages are special debugging endpoints exposed by Kubernetes control plane components. Introduced as an alpha feature in Kubernetes 1.32, these endpoints provide runtime diagnostics for components like `kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, `kubelet` and `kube-proxy`. The name "z-pages" comes from the convention of using `/*z` paths for debugging endpoints.
1616

1717
Currently, Kubernetes supports two primary z-page endpoints:
1818

19-
- **`/statusz`**: Displays high-level component information including version information, start time, uptime, and available debug paths
20-
- **`/flagz`**: Shows all command-line flags and their values used to start the component (with confidential values redacted for security)
19+
`/statusz`
20+
: Displays high-level component information including version information, start time, uptime, and available debug paths
21+
22+
`/flagz`
23+
: Shows all command-line arguments and their values used to start the component (with confidential values redacted for security)
2124

2225
These endpoints are valuable for human operators who need to quickly inspect component state, but until now, they only returned plain text output that was difficult to parse programmatically.
2326

@@ -30,8 +33,9 @@ Kubernetes 1.35 introduces structured, versioned responses for both `/statusz` a
3033
The new structured responses are opt-in. Without specifying an `Accept` header, the endpoints continue to return the familiar plain text format:
3134

3235
```
33-
$ curl -k --cert /etc/kubernetes/pki/apiserver-kubelet-client.crt \
36+
$ curl --cert /etc/kubernetes/pki/apiserver-kubelet-client.crt \
3437
--key /etc/kubernetes/pki/apiserver-kubelet-client.key \
38+
--cacert /etc/kubernetes/pki/ca.crt \
3539
https://localhost:6443/statusz
3640
3741
kube-apiserver statusz
@@ -65,7 +69,7 @@ This returns a versioned JSON response:
6569
"startTime": "2025-10-29T00:30:01Z",
6670
"uptimeSeconds": 856,
6771
"goVersion": "go1.23.2",
68-
"binaryVersion": "1.35.0-alpha.0.1595+b288caa2c26536-dirty",
72+
"binaryVersion": "1.35.0",
6973
"emulationVersion": "1.35",
7074
"paths": [
7175
"/healthz",
@@ -113,7 +117,7 @@ Instead of parsing plain text, monitoring tools can now easily extract specific
113117

114118
### 2. **Better debugging tools**
115119

116-
Developers can build sophisticated debugging tools that compare configurations across multiple components or track configuration drift over time. The structured format makes it trivial to diff configurations or validate that components are running with expected settings.
120+
Developers can build sophisticated debugging tools that compare configurations across multiple components or track configuration drift over time. The structured format makes it trivial to `diff` configurations or validate that components are running with expected settings.
117121

118122
### 3. **API versioning and stability**
119123

@@ -130,24 +134,32 @@ Both endpoints require feature gates to be enabled:
130134

131135
### Example: Getting structured responses
132136

133-
Here's an example using `curl` to retrieve structured JSON responses:
137+
Here's an example using `curl` to retrieve structured JSON responses from the kube-apiserver:
134138

135139
```bash
136140
# Get structured statusz response
137-
curl -k \
141+
curl \
138142
--cert /etc/kubernetes/pki/apiserver-kubelet-client.crt \
139143
--key /etc/kubernetes/pki/apiserver-kubelet-client.key \
144+
--cacert /etc/kubernetes/pki/ca.crt \
140145
-H "Accept: application/json;v=v1alpha1;g=config.k8s.io;as=Statusz" \
141146
https://localhost:6443/statusz | jq .
142147

143148
# Get structured flagz response
144-
curl -k \
149+
curl \
145150
--cert /etc/kubernetes/pki/apiserver-kubelet-client.crt \
146151
--key /etc/kubernetes/pki/apiserver-kubelet-client.key \
152+
--cacert /etc/kubernetes/pki/ca.crt \
147153
-H "Accept: application/json;v=v1alpha1;g=config.k8s.io;as=Flagz" \
148154
https://localhost:6443/flagz | jq .
149155
```
150156

157+
{{< note >}}
158+
The examples above use client certificate authentication and verify the server's certificate using `--cacert`.
159+
If you need to bypass certificate verification in a test environment, you can use `--insecure` (or `-k`),
160+
but this should never be done in production as it makes you vulnerable to man-in-the-middle attacks.
161+
{{< /note >}}
162+
151163
## Important considerations
152164

153165
### Alpha feature status
@@ -162,20 +174,20 @@ The structured z-page responses are an **alpha** feature in Kubernetes 1.35. Thi
162174

163175
z-pages expose internal component information and require proper access controls. Here are the key security considerations:
164176

165-
**RBAC authorization**: Access to z-page endpoints is restricted to members of the `system:monitoring` group, which follows the same authorization model as other debugging endpoints like `/healthz`, `/livez`, and `/readyz`. This ensures that only authorized users and service accounts can access debugging information.
177+
**Authorization**: Access to z-page endpoints is restricted to members of the `system:monitoring` group, which follows the same authorization model as other debugging endpoints like `/healthz`, `/livez`, and `/readyz`. This ensures that only authorized users and service accounts can access debugging information. If your cluster uses RBAC, you can manage access by granting appropriate permissions to this group.
166178

167-
**Authentication**: As shown in the examples, you need to use appropriate authentication mechanisms (such as client certificates) to access these endpoints. The endpoints are not publicly accessible and require valid credentials.
179+
**Authentication**: The authentication requirements for these endpoints depend on your cluster's configuration. Unless anonymous authentication is enabled for your cluster, you typically need to use authentication mechanisms (such as client certificates) to access these endpoints.
168180

169181
**Information disclosure**: These endpoints reveal configuration details about your cluster components, including:
170182
- Component versions and build information
171-
- All command-line flags and their values (with confidential values redacted)
183+
- All command-line arguments and their values (with confidential values redacted)
172184
- Available debug endpoints
173185

174186
Only grant access to trusted operators and debugging tools. Avoid exposing these endpoints to unauthorized users or automated systems that don't require this level of access.
175187

176188
### Future evolution
177189

178-
As the feature matures, we expect to:
190+
As the feature matures, we (Kubernetes SIG Instrumentation) expect to:
179191

180192
- Introduce `v1beta1` and eventually `v1` versions of the API
181193
- Gather community feedback on the response schema

0 commit comments

Comments
 (0)