You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -167,30 +167,30 @@ The scope of this endpoint is intentionally limited to the status of the primary
167
167
168
168
3.**API Stability and Evolution**
169
169
170
-
The alpha release will support both a plain text format and a versioned JSON format (`v1alpha1`). The feature will be secured behind a feature gate that is disabled by default, ensuring users opt-in consciously. The `v1alpha1`JSON format is explicitly marked as alpha-quality, intended for early feedback, and is subject to change.
170
+
The alpha release will support both a plain text format and a versioned structured API format (`v1alpha1`, supporting JSON, YAML, and CBOR). The feature will be secured behind a feature gate that is disabled by default, ensuring users opt-in consciously. The `v1alpha1`structured API format is explicitly marked as alpha-quality, intended for early feedback, and is subject to change.
171
171
172
-
For Beta, to provide a stable contract for consumers, the JSON response API will be promoted to `v1beta1` or `v1` based on feedback and will be considered stable. The plain text format remains the default for human consumption and backward compatibility.
172
+
For Beta, to provide a stable contract for consumers, the structured API response will be promoted to `v1beta1` or `v1` based on feedback and will be considered stable. The plain text format remains the default for human consumption and backward compatibility.
173
173
174
174
## Design Details
175
175
176
176
### Data Format and versioning
177
177
178
178
The `/statusz` endpoint defaults to a `text/plain` response format, which is intended for human consumption and should not be parsed by automated tools.
179
179
180
-
For programmatic access, a structured, versioned JSON format is available with an initial alpha version of `v1alpha1`. This version is not stable and is intended for feedback and iteration during the Alpha phase.
180
+
For programmatic access, a structured, versioned API format is available (supporting JSON, YAML, and CBOR) with an initial alpha version of `v1alpha1`. This version is not stable and is intended for feedback and iteration during the Alpha phase.
181
181
182
182
-**Group**: `config.k8s.io`
183
183
-**Version**: `v1alpha1` (initial version, subject to change)
184
184
-**Kind**: `Statusz`
185
185
186
-
To receive the structured JSON response, a client **must** explicitly request it using an `Accept` header specifying these parameters. For example:
186
+
To receive the structured API response, a client **must** explicitly request it using an `Accept` header specifying these parameters. For example:
This negotiation mechanism ensures clients are explicit about the exact API they want, preventing accidental dependencies on unstable or incorrect formats. If a client requests `application/json` without the required parameters, the server will respond with a `406 Not Acceptable` error.
193
+
This negotiation mechanism ensures clients are explicit about the exact API they want, preventing accidental dependencies on unstable or incorrect formats. If a client requests `application/json` without the required parameters, the server will respond with a `406 Not Acceptable` error. YAML and CBOR are also supported (CBOR is gated by the `CBORServingAndStorage` feature gate).
194
194
195
195
### Authz and authn
196
196
@@ -213,7 +213,7 @@ rules:
213
213
214
214
### Endpoint Response Format
215
215
216
-
The `/statusz` endpoint supports both plain text and structured JSON formats. The default format is `text/plain`.
216
+
The `/statusz` endpoint supports both plain text and structured API (JSON/YAML/CBOR) formats. The default format is `text/plain`.
217
217
218
218
#### Data format: text
219
219
@@ -245,19 +245,21 @@ readyz:/readyz
245
245
sli metrics:/metrics/slis
246
246
```
247
247
248
-
#### Data format: JSON (v1alpha1)
248
+
#### Structured API format (v1alpha1)
249
249
250
-
This format is available in Alpha for programmatic access and must be explicitly requested. It is considered an alpha-level format.
250
+
This format is available in Alpha for programmatic access and must be explicitly requested. It is considered an alpha-level format. The structured API supports JSON, YAML, and (if the CBORServingAndStorage feature gate is enabled) CBOR serialization.
or `Accept: application/yaml;as=Statusz;v=v1alpha1;g=config.k8s.io` (for YAML)
257
+
or `Accept: application/cbor;as=Statusz;v=v1alpha1;g=config.k8s.io` (for CBOR, if enabled)
256
258
* Body: empty
257
259
258
260
##### Response Body: `Statusz` object
259
261
260
-
The response is a `Statusz` object.
262
+
The response is a `Statusz` object, serialized in the requested format (JSON, YAML, or CBOR).
261
263
262
264
###### Go Struct Definition
263
265
```go
@@ -299,7 +301,7 @@ type Statusz struct {
299
301
}
300
302
```
301
303
302
-
###### JSON Structure
304
+
###### Example Structure (JSON)
303
305
```json
304
306
{
305
307
"kind": "Statusz",
@@ -323,8 +325,9 @@ type Statusz struct {
323
325
]
324
326
}
325
327
```
328
+
YAML and CBOR follow the same structure, serialized in their respective formats.
326
329
327
-
##### Sample Response
330
+
##### Sample Response (JSON)
328
331
329
332
```json
330
333
{
@@ -365,11 +368,11 @@ N/A
365
368
366
369
##### Unit tests
367
370
368
-
-`staging/src/k8s.io/component-base/zpages/statusz`: Unit tests will be added to cover both the plain text and structured JSON output, including serialization and content negotiation logic.
371
+
-`staging/src/k8s.io/component-base/zpages/statusz`: Unit tests will be added to cover both the plain text and structured output, including serialization and content negotiation logic.
369
372
370
373
##### Integration tests
371
374
372
-
- Integration tests will be added for each component to verify that the `/statusz` endpoint is correctly registered and serves both `text/plain` and the versioned `application/json` content types.
375
+
- Integration tests will be added for each component to verify that the `/statusz` endpoint is correctly registered and serves both `text/plain` and the versioned `application/json`, `application/yaml`, `application/cbor` content types.
373
376
374
377
##### e2e tests
375
378
@@ -386,18 +389,18 @@ N/A
386
389
- Feature gate `ComponentStatusz` is disabled by default.
387
390
- A structured JSON response (`config.k8s.io/v1alpha1`) is introduced for feedback, alongside the default `text/plain` format.
388
391
- Feature is implemented for at least one component (e.g., kube-apiserver).
389
-
- E2E tests are added for both plain text and the new JSON response format.
392
+
- E2E tests are added for both plain text and the new structured response format.
390
393
- Gather feedback from users and developers on the structured format.
391
394
392
395
#### Beta
393
396
394
397
- Feature gate `ComponentStatusz` is enabled by default.
395
-
- The JSON response API is promoted to `v1beta1` or `v1` based on feedback and is considered stable.
398
+
- The structured API is promoted to `v1beta1` or `v1` based on feedback and is considered stable.
396
399
- Feature is implemented for all core Kubernetes components.
397
400
398
401
#### GA
399
402
400
-
- The JSON response API is promoted to a stable `v1` version after bake-in.
403
+
- The structured API is promoted to a stable `v1` version after bake-in.
401
404
- Conformance tests are in place for the endpoint.
402
405
403
406
#### Deprecation
@@ -532,7 +535,7 @@ Yes, enabling this feature will result in a new HTTP endpoint (/statusz) being s
532
535
533
536
###### Will enabling / using this feature result in introducing new API types?
534
537
535
-
No, this feature does not introduce new Kubernetes API types or resources. While the statusz endpoint uses a structured JSON response with Group/Version/Kind for content negotiation and consistency, it is not a Kubernetes API object and is not managed or persisted by the API server. The GVK is used solely to provide a predictable format for clients querying the endpoint.
538
+
No, this feature does not introduce new Kubernetes API types or resources. While the statusz endpoint uses a structured JSON/YAML/CBOR response with Group/Version/Kind for content negotiation and consistency, it is not a Kubernetes API object and is not managed or persisted by the API server. The GVK is used solely to provide a predictable format for clients querying the endpoint.
536
539
537
540
###### Will enabling / using this feature result in any new calls to the cloud provider?
538
541
@@ -573,6 +576,8 @@ The feature can be disabled by setting the feature-gate to false if the performa
573
576
- v1.33: `/statusz` enablement extended to [kubelet](https://github.com/kubernetes/kubernetes/pull/128811), [scheduler](https://github.com/kubernetes/kubernetes/pull/128987), [controller-manager](https://github.com/kubernetes/kubernetes/pull/128991), and [kube-proxy](https://github.com/kubernetes/kubernetes/pull/128989)
574
577
- v1.34: `/statusz` response enhanced to add a `Paths` field listing down all debug endpoints available for [apiserver](https://github.com/kubernetes/kubernetes/pull/132581)
575
578
- v1.35: `Paths` field added for [kubelet](https://github.com/kubernetes/kubernetes/pull/133239), [scheduler](https://github.com/kubernetes/kubernetes/pull/132606), [controller-manager](https://github.com/kubernetes/kubernetes/pull/133218), and [kube-proxy](https://github.com/kubernetes/kubernetes/pull/133190)
579
+
- v1.35: Converted the `/statusz` endpoint to a structured API ([#134313](https://github.com/kubernetes/kubernetes/pull/134313)).
580
+
- v1.36: Added support for YAML and CBOR serialization for the `/statusz` endpoint ([#135309](https://github.com/kubernetes/kubernetes/pull/135309)). CBOR support is gated by the `CBORServingAndStorage` feature gate.
0 commit comments