Skip to content

Commit ed6ac94

Browse files
authored
Merge pull request #32784 from apelisse/openapi-v3-beta
Add documentation for OpenAPI v3 Beta
2 parents ba6776b + 11333a4 commit ed6ac94

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

content/en/docs/concepts/overview/kubernetes-api.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,42 @@ packages that define the API objects.
8282

8383
### OpenAPI V3
8484

85-
{{< feature-state state="alpha" for_k8s_version="v1.23" >}}
85+
{{< feature-state state="beta" for_k8s_version="v1.24" >}}
8686

87-
Kubernetes v1.23 offers initial support for publishing its APIs as OpenAPI v3; this is an
88-
alpha feature that is disabled by default.
89-
You can enable the alpha feature by turning on the
87+
Kubernetes {{< param "version" >}} offers beta support for publishing its APIs as OpenAPI v3; this is a
88+
beta feature that is enabled by default.
89+
You can disable the beta feature by turning off the
9090
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) named `OpenAPIV3`
9191
for the kube-apiserver component.
9292

93-
With the feature enabled, the Kubernetes API server serves an
94-
aggregated OpenAPI v3 spec per Kubernetes group version at the
95-
`/openapi/v3/apis/<group>/<version>` endpoint. Please refer to the
96-
table below for accepted request headers.
93+
A discovery endpoint `/openapi/v3` is provided to see a list of all
94+
group/versions available. This endpoint only returns JSON. These group/versions
95+
are provided in the following format:
96+
```json
97+
{
98+
"paths": {
99+
...
100+
"api/v1": {
101+
"serverRelativeURL": "/openapi/v3/api/v1?hash=CC0E9BFD992D8C59AEC98A1E2336F899E8318D3CF4C68944C3DEC640AF5AB52D864AC50DAA8D145B3494F75FA3CFF939FCBDDA431DAD3CA79738B297795818CF"
102+
},
103+
"apis/admissionregistration.k8s.io/v1": {
104+
"serverRelativeURL": "/openapi/v3/apis/admissionregistration.k8s.io/v1?hash=E19CC93A116982CE5422FC42B590A8AFAD92CDE9AE4D59B5CAAD568F083AD07946E6CB5817531680BCE6E215C16973CD39003B0425F3477CFD854E89A9DB6597"
105+
},
106+
...
107+
}
108+
```
109+
110+
The relative URLs are pointing to immutable OpenAPI descriptions, in
111+
order to improve client-side caching. The proper HTTP caching headers
112+
are also set by the API server for that purpose (`Expires` to 1 year in
113+
the future, and `Cache-Control` to `immutable`). When an obsolete URL is
114+
used, the API server returns a redirect to the newest URL.
115+
116+
The Kubernetes API server publishes an OpenAPI v3 spec per Kubernetes
117+
group version at the `/openapi/v3/apis/<group>/<version>?hash=<hash>`
118+
endpoint.
119+
120+
Refer to the table below for accepted request headers.
97121

98122
<table>
99123
<caption style="display:none">Valid request header values for OpenAPI v3 queries</caption>
@@ -126,9 +150,6 @@ table below for accepted request headers.
126150
</tbody>
127151
</table>
128152

129-
A discovery endpoint `/openapi/v3` is provided to see a list of all
130-
group/versions available. This endpoint only returns JSON.
131-
132153
## Persistence
133154

134155
Kubernetes stores the serialized state of objects by writing them into

content/en/docs/reference/command-line-tools-reference/feature-gates.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ different Kubernetes components.
158158
| `NodeOutOfServiceVolumeDetach` | `false` | Alpha | 1.24 | |
159159
| `OpenAPIEnums` | `false` | Alpha | 1.23 | 1.23 |
160160
| `OpenAPIEnums` | `false` | Beta | 1.24 | |
161-
| `OpenAPIV3` | `false` | Alpha | 1.23 | |
161+
| `OpenAPIV3` | `false` | Alpha | 1.23 | 1.23 |
162+
| `OpenAPIV3` | `true` | Beta | 1.24 | |
162163
| `PodAndContainerStatsFromCRI` | `false` | Alpha | 1.23 | |
163164
| `PodDeletionCost` | `false` | Alpha | 1.21 | 1.21 |
164165
| `PodDeletionCost` | `true` | Beta | 1.22 | |

0 commit comments

Comments
 (0)