Skip to content

Commit a6edc99

Browse files
authored
Merge pull request #5805 from richabanker/statusz-beta
KEP-4827: graduate ComponentStatusz to beta
2 parents 69d324f + 89c6cb6 commit a6edc99

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

keps/prod-readiness/sig-instrumentation/4827.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
kep-number: 4827
55
alpha:
66
approver: jpbetz
7+
beta:
8+
approver: jpbetz

keps/sig-instrumentation/4827-component-statusz/README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ tags, and then generate with `hack/update-toc.sh`.
2929
- [Data format: text](#data-format-text)
3030
- [Request](#request)
3131
- [Sample response](#sample-response)
32-
- [Data format: JSON (v1alpha1)](#data-format-json-v1alpha1)
32+
- [Structured API format (v1alpha1)](#structured-api-format-v1alpha1)
3333
- [Request](#request-1)
3434
- [Response Body: <code>Statusz</code> object](#response-body-statusz-object)
35-
- [Sample Response](#sample-response-1)
35+
- [Sample Response (JSON)](#sample-response-json)
3636
- [API Versioning and Deprecation Policy](#api-versioning-and-deprecation-policy)
3737
- [Test Plan](#test-plan)
3838
- [Prerequisite testing updates](#prerequisite-testing-updates)
@@ -167,30 +167,30 @@ The scope of this endpoint is intentionally limited to the status of the primary
167167

168168
3. **API Stability and Evolution**
169169

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.
171171

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.
173173

174174
## Design Details
175175

176176
### Data Format and versioning
177177

178178
The `/statusz` endpoint defaults to a `text/plain` response format, which is intended for human consumption and should not be parsed by automated tools.
179179

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.
181181

182182
- **Group**: `config.k8s.io`
183183
- **Version**: `v1alpha1` (initial version, subject to change)
184184
- **Kind**: `Statusz`
185185

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:
187187

188188
```
189189
GET /statusz
190190
Accept: application/json;as=Statusz;v=v1alpha1;g=config.k8s.io
191191
```
192192

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.
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).
194194

195195
### Authz and authn
196196

@@ -213,7 +213,7 @@ rules:
213213
214214
### Endpoint Response Format
215215
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`.
217217

218218
#### Data format: text
219219

@@ -245,19 +245,21 @@ readyz:/readyz
245245
sli metrics:/metrics/slis
246246
```
247247
248-
#### Data format: JSON (v1alpha1)
248+
#### Structured API format (v1alpha1)
249249
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.
251251
252252
##### Request
253253
* Method: **GET**
254254
* Endpoint: **/statusz**
255-
* Header: `Accept: application/json;as=Statusz;v=v1alpha1;g=config.k8s.io`
255+
* Header: `Accept: application/json;as=Statusz;v=v1alpha1;g=config.k8s.io` (for JSON)
256+
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)
256258
* Body: empty
257259
258260
##### Response Body: `Statusz` object
259261
260-
The response is a `Statusz` object.
262+
The response is a `Statusz` object, serialized in the requested format (JSON, YAML, or CBOR).
261263
262264
###### Go Struct Definition
263265
```go
@@ -299,7 +301,7 @@ type Statusz struct {
299301
}
300302
```
301303

302-
###### JSON Structure
304+
###### Example Structure (JSON)
303305
```json
304306
{
305307
"kind": "Statusz",
@@ -323,8 +325,9 @@ type Statusz struct {
323325
]
324326
}
325327
```
328+
YAML and CBOR follow the same structure, serialized in their respective formats.
326329

327-
##### Sample Response
330+
##### Sample Response (JSON)
328331

329332
```json
330333
{
@@ -365,11 +368,11 @@ N/A
365368

366369
##### Unit tests
367370

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.
369372

370373
##### Integration tests
371374

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.
373376

374377
##### e2e tests
375378

@@ -386,18 +389,18 @@ N/A
386389
- Feature gate `ComponentStatusz` is disabled by default.
387390
- A structured JSON response (`config.k8s.io/v1alpha1`) is introduced for feedback, alongside the default `text/plain` format.
388391
- 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.
390393
- Gather feedback from users and developers on the structured format.
391394

392395
#### Beta
393396

394397
- 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.
396399
- Feature is implemented for all core Kubernetes components.
397400

398401
#### GA
399402

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.
401404
- Conformance tests are in place for the endpoint.
402405

403406
#### Deprecation
@@ -532,7 +535,7 @@ Yes, enabling this feature will result in a new HTTP endpoint (/statusz) being s
532535

533536
###### Will enabling / using this feature result in introducing new API types?
534537

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.
536539

537540
###### Will enabling / using this feature result in any new calls to the cloud provider?
538541

@@ -573,6 +576,8 @@ The feature can be disabled by setting the feature-gate to false if the performa
573576
- 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)
574577
- 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)
575578
- 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.
576581

577582

578583
## Drawbacks

keps/sig-instrumentation/4827-component-statusz/kep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ approvers:
1717
- "@rexagod"
1818
- "@liggitt"
1919
# The target maturity stage in the current dev cycle for this KEP.
20-
stage: alpha
20+
stage: beta
2121

2222
# The most recent milestone for which work toward delivery of this KEP has been
2323
# done. This can be the current (upcoming) milestone, if it is being actively
2424
# worked on.
25-
latest-milestone: "v1.35"
25+
latest-milestone: "v1.36"
2626

2727
# The milestone at which this feature was, or is targeted to be, at each stage.
2828
milestone:

0 commit comments

Comments
 (0)