@@ -331,6 +331,36 @@ For example:
331
331
Accept: application/vnd.kubernetes.protobuf, application/json
332
332
```
333
333
334
+ ### CBOR resource encoding {#cbor-encoding}
335
+
336
+ {{< feature-state feature_gate_name="CBORServingAndStorage" >}}
337
+
338
+ With the ` CBORServingAndStorage ` [ feature
339
+ gate] ( /docs/reference/command-line-tools-reference/feature-gates/ ) enabled, request and response
340
+ bodies for all built-in resource types and all resources defined by a {{< glossary_tooltip
341
+ term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} may be encoded to the
342
+ [ CBOR] ( https://www.rfc-editor.org/rfc/rfc8949 ) binary data format. CBOR is also supported at the {{<
343
+ glossary_tooltip text="aggregation layer" term_id="aggregation-layer" >}} if it is enabled in
344
+ individual aggregated API servers.
345
+
346
+ Clients should indicate the IANA media type ` application/cbor ` in the ` Content-Type ` HTTP request
347
+ header when the request body contains a single CBOR [ encoded data
348
+ item] ( https://www.rfc-editor.org/rfc/rfc8949.html#section-1.2-4.2 ) , and in the ` Accept ` HTTP request
349
+ header when prepared to accept a CBOR encoded data item in the response. API servers will use
350
+ ` application/cbor ` in the ` Content-Type ` HTTP response header when the response body contains a
351
+ CBOR-encoded object.
352
+
353
+ If an API server encodes its response to a [ watch request] ( #efficient-detection-of-changes ) using
354
+ CBOR, the response body will be a [ CBOR Sequence] ( https://www.rfc-editor.org/rfc/rfc8742 ) and the
355
+ ` Content-Type ` HTTP response header will use the IANA media type ` application/cbor-seq ` . Each entry
356
+ of the sequence (if any) is a single CBOR-encoded watch event.
357
+
358
+ In addition to the existing ` application/apply-patch+yaml ` media type for YAML-encoded [ server-side
359
+ apply configurations] ( #patch-and-apply ) , API servers that enable CBOR will accept the
360
+ ` application/apply-patch+cbor ` media type for CBOR-encoded server-side apply configurations. There
361
+ is no supported CBOR equivalent for ` application/json-patch+json ` or ` application/merge-patch+json ` ,
362
+ or ` application/strategic-merge-patch+json ` .
363
+
334
364
## Efficient detection of changes
335
365
336
366
The Kubernetes API allows clients to make an initial request for an object or a
0 commit comments