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
Copy file name to clipboardExpand all lines: content/en/docs/concepts/overview/kubernetes-api.md
+38-30Lines changed: 38 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,38 +26,41 @@ Most operations can be performed through the [kubectl](/docs/reference/kubectl/)
26
26
command-line interface or other command-line tools, such as
27
27
[kubeadm](/docs/reference/setup-tools/kubeadm/), which in turn use the API.
28
28
However, you can also access the API directly using REST calls. Kubernetes
29
-
provides a set of [client
30
-
libraries](/docs/reference/using-api/client-libraries/)for those looking to
29
+
provides a set of [client libraries](/docs/reference/using-api/client-libraries/)
30
+
for those looking to
31
31
write applications using the Kubernetes API.
32
32
33
-
Each Kubernetes offers publishes a machine-readable description of the APIs that the cluster serves.
34
-
There are two mechanisms that Kubernetes uses to publish these API descriptions; each is useful
33
+
Each Kubernetes cluster publishes the specification of the APIs that the cluster serves.
34
+
There are two mechanisms that Kubernetes uses to publish these API specifications; both are useful
35
35
to enable automatic interoperability. For example, the `kubectl` tool fetches and caches the API
36
-
description and uses this to enable command-line completion and other features.
37
-
Here is some more detail about each of those two mechanisms:
38
-
39
-
[The Discovery API](#discovery-api) provides information about the Kubernetes APIs: API names,
40
-
resources, versions, and supported operations. This is a Kubernetes specific term as it is a separate API from the Kubernetes OpenAPI.
41
-
It is intended to be a small document providing a summary of available resources
42
-
and does not detail specific schema for the resources. For reference around schemas
43
-
for resources, please refer to the OpenAPI document.
44
-
45
-
The [Kubernetes OpenAPI Document]{#openapi-specification} provides (full) [OpenAPI v2.0 and 3.0 schemas](https://www.openapis.org/) for all Kubernetes API
46
-
endpoints. OpenAPI v3 is the preferred method for accessing OpenAPI as it
47
-
provides a more comprehensive and accurate view of the API. It includes all
48
-
available API paths, as well as all resources consumed and produced for every
49
-
operation on every endpoint. This also includes any extensibility components
50
-
that a cluster supports. This document a complete document and is significantly larger than Discovery. The Discovery API is a
51
-
lightweight alternative that provides a subset of information in the
52
-
Kubernetes OpenAPI document.
36
+
specification for enabling command-line completion and other features.
37
+
The two supported mechanisms are as follows:
38
+
39
+
-[The Discovery API](#discovery-api) provides information about the Kubernetes APIs:
40
+
API names, resources, versions, and supported operations. This is a Kubernetes
41
+
specific term as it is a separate API from the Kubernetes OpenAPI.
42
+
It is intended to be a brief summary of the available resources and it does not
43
+
detail specific schema for the resources. For reference about resource schemas,
44
+
please refer to the OpenAPI document.
45
+
46
+
- The [Kubernetes OpenAPI Document](#openapi-specification) provides (full)
47
+
[OpenAPI v2.0 and 3.0 schemas](https://www.openapis.org/) for all Kubernetes API
48
+
endpoints.
49
+
The OpenAPI v3 is the preferred method for accessing OpenAPI as it
50
+
provides
51
+
a more comprehensive and accurate view of the API. It includes all the available
52
+
API paths, as well as all resources consumed and produced for every operations
53
+
on every endpoints. It also includes any extensibility components that a cluster supports.
54
+
The data is a complete specification and is significantly larger than that from the
55
+
Discovery API.
53
56
54
57
## Discovery API
55
58
56
59
Kubernetes publishes a list of all group versions and resources supported via
57
60
the Discovery API. This includes the following for each resource:
58
61
59
62
- Name
60
-
- Cluster or Namespace scope
63
+
- Cluster or namespaced scope
61
64
- Endpoint URL and supported verbs
62
65
- Alternative names
63
66
- Group, version, kind
@@ -68,22 +71,25 @@ separate endpoint for each group version.
Without the Accept header resource type explicitly indicated, the default
85
+
Without indicating the resource type using the `Accept` header, the default
83
86
response for the `/api` and `/apis` endpoint is an unaggregated discovery
84
87
document.
85
88
86
-
The [discovery document](https://github.com/kubernetes/kubernetes/blob/release-v{{< skew currentVersion >}}/api/discovery/aggregated_v2beta1.json) serving built-in resources is found in the Kubernetes Github repository. This Github document can be used as a reference of the base set of available resources if a Kubernetes cluster is not available to query.
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.
87
93
88
94
The endpoint also supports ETag and protobuf encoding.
89
95
@@ -254,16 +260,18 @@ Refer to the table below for accepted request headers.
254
260
</tbody>
255
261
</table>
256
262
257
-
A Golang implementation to fetch the OpenAPI V3 is provided in the package [`k8s.io/client-go/openapi3`](https://pkg.go.dev/k8s.io/client-go/openapi3).
263
+
A Golang implementation to fetch the OpenAPI V3 is provided in the package
OpenAPI v2.0 and v3.0; there are no plans to support 3.1 in the near future.
261
268
262
269
### Protobuf serialization
263
270
264
271
Kubernetes implements an alternative Protobuf based serialization format that
265
272
is primarily intended for intra-cluster communication. For more information
266
-
about this format, see the [Kubernetes Protobuf serialization](https://git.k8s.io/design-proposals-archive/api-machinery/protobuf.md) design proposal and the
273
+
about this format, see the [Kubernetes Protobuf serialization](https://git.k8s.io/design-proposals-archive/api-machinery/protobuf.md)
274
+
design proposal and the
267
275
Interface Definition Language (IDL) files for each schema located in the Go
0 commit comments