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
Without indicating the resource type using the `Accept` header, the default
86
+
response for the `/api` and `/apis` endpoint is an unaggregated discovery
87
+
document.
88
+
89
+
The [discovery document](https://github.com/kubernetes/kubernetes/blob/release-v{{< skew currentVersion >}}/api/discovery/aggregated_v2beta1.json)
90
+
for the built-in resources can be found in the Kubernetes GitHub repository.
91
+
This Github document can be used as a reference of the base set of the available resources
92
+
if a Kubernetes cluster is not available to query.
93
+
94
+
The endpoint also supports ETag and protobuf encoding.
95
+
96
+
### Unaggregated discovery
97
+
98
+
Without discovery aggregation, discovery is published in levels, with the root
99
+
endpoints publishing discovery information for downstream documents.
100
+
101
+
A list of all group versions supported by a cluster is published at
102
+
the `/api` and `/apis` endpoints. Example:
103
+
104
+
```
105
+
{
106
+
"kind": "APIGroupList",
107
+
"apiVersion": "v1",
108
+
"groups": [
109
+
{
110
+
"name": "apiregistration.k8s.io",
111
+
"versions": [
112
+
{
113
+
"groupVersion": "apiregistration.k8s.io/v1",
114
+
"version": "v1"
115
+
}
116
+
],
117
+
"preferredVersion": {
118
+
"groupVersion": "apiregistration.k8s.io/v1",
119
+
"version": "v1"
120
+
}
121
+
},
122
+
{
123
+
"name": "apps",
124
+
"versions": [
125
+
{
126
+
"groupVersion": "apps/v1",
127
+
"version": "v1"
128
+
}
129
+
],
130
+
"preferredVersion": {
131
+
"groupVersion": "apps/v1",
132
+
"version": "v1"
133
+
}
134
+
},
135
+
...
136
+
}
137
+
```
138
+
139
+
Additional requests are needed to obtain the discovery document for each group version at
140
+
`/apis/<group>/<version>` (for example:
141
+
`/apis/rbac.authorization.k8s.io/v1alpha1`), which advertises the list of
142
+
resources served under a particular group version. These endpoints are used by
143
+
kubectl to fetch the list of resources supported by a cluster.
33
144
34
145
<!-- body -->
35
146
36
-
## OpenAPI specification {#api-specification}
147
+
<aid="#api-specification" />
37
148
38
-
Complete API details are documented using [OpenAPI](https://www.openapis.org/).
149
+
## OpenAPI interface definition
39
150
151
+
For details about the OpenAPI specifications, see the [OpenAPI documentation](https://www.openapis.org/).
152
+
153
+
Kubernetes serves both OpenAPI v2.0 and OpenAPI v3.0. OpenAPI v3 is the
154
+
preferred method of accessing the OpenAPI because it offers a more comprehensive
155
+
(lossless) representation of Kubernetes resources. Due to limitations of OpenAPI
156
+
version 2, certain fields are dropped from the published OpenAPI including but not
157
+
limited to `default`, `nullable`, `oneOf`.
40
158
### OpenAPI V2
41
159
42
160
The Kubernetes API server serves an aggregated OpenAPI v2 spec via the
@@ -74,11 +192,6 @@ request headers as follows:
74
192
</tbody>
75
193
</table>
76
194
77
-
Kubernetes implements an alternative Protobuf based serialization format that
78
-
is primarily intended for intra-cluster communication. For more information
79
-
about this format, see the [Kubernetes Protobuf serialization](https://git.k8s.io/design-proposals-archive/api-machinery/protobuf.md) design proposal and the
80
-
Interface Definition Language (IDL) files for each schema located in the Go
81
-
packages that define the API objects.
82
195
83
196
### OpenAPI V3
84
197
@@ -149,7 +262,20 @@ Refer to the table below for accepted request headers.
149
262
</tbody>
150
263
</table>
151
264
152
-
A Golang implementation to fetch the OpenAPI V3 is provided in the package `k8s.io/client-go/openapi3`.
265
+
A Golang implementation to fetch the OpenAPI V3 is provided in the package
0 commit comments