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
+94-56Lines changed: 94 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,73 +11,94 @@ card:
11
11
12
12
{{% capture overview %}}
13
13
14
-
Overall API conventions are described in the [API conventions doc](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md).
14
+
The core of Kubernetes' {{< glossary_tooltip text="control plane" term_id="control-plane" >}}
15
+
is the {{< glossary_tooltip text="API server" term_id="kube-apiserver" >}}. The API server
16
+
exposes an HTTP API that lets end users, different parts of your cluster, and external components
17
+
communicate with one another.
15
18
16
-
API endpoints, resource types and samples are described in [API Reference](/docs/reference).
19
+
The Kubernetes API lets you query and manipulate the state of objects in the Kubernetes API
20
+
(for example: Pods, Namespaces, ConfigMaps, and Events).
17
21
18
-
Remote access to the API is discussed in the [Controlling API Access doc](/docs/reference/access-authn-authz/controlling-access/).
19
-
20
-
The Kubernetes API also serves as the foundation for the declarative configuration schema for the system. The [kubectl](/docs/reference/kubectl/overview/) command-line tool can be used to create, update, delete, and get API objects.
21
-
22
-
Kubernetes also stores its serialized state (currently in [etcd](https://coreos.com/docs/distributed-configuration/getting-started-with-etcd/)) in terms of the API resources.
23
-
24
-
Kubernetes itself is decomposed into multiple components, which interact through its API.
22
+
API endpoints, resource types and samples are described in the [API Reference](/docs/reference/kubernetes-api/).
25
23
26
24
{{% /capture %}}
27
25
28
-
29
26
{{% capture body %}}
30
27
31
28
## API changes
32
29
33
-
In our experience, any system that is successful needs to grow and change as new use cases emerge or existing ones change. Therefore, we expect the Kubernetes API to continuously change and grow. However, we intend to not break compatibility with existing clients, for an extended period of time. In general, new API resources and new resource fields can be expected to be added frequently. Elimination of resources or fields will require following the [API deprecation policy](/docs/reference/using-api/deprecation-policy/).
34
-
35
-
What constitutes a compatible change and how to change the API are detailed by the [API change document](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md).
30
+
Any system that is successful needs to grow and change as new use cases emerge or existing ones change.
31
+
Therefore, Kubernetes has design features to allow the Kubernetes API to continuously change and grow.
32
+
The Kubernetes project aims to _not_ break compatibility with existing clients, and to maintain that
33
+
compatibility for a length of time so that other projects have an opportunity to adapt.
36
34
37
-
## OpenAPI and Swagger definitions
35
+
In general, new API resources and new resource fields can be added often and frequently.
36
+
Elimination of resources or fields requires following the
Complete API details are documented using [OpenAPI](https://www.openapis.org/).
40
-
41
-
Starting with Kubernetes 1.10, the Kubernetes API server serves an OpenAPI spec via the `/openapi/v2` endpoint.
42
-
The requested format is specified by setting HTTP headers:
43
-
44
-
Header | Possible Values
45
-
------ | ---------------
46
-
Accept | `application/json`, `application/[email protected]+protobuf` (the default content-type is `application/json` for `*/*` or not passing this header)
47
-
Accept-Encoding | `gzip` (not passing this header is acceptable)
39
+
What constitutes a compatible change, and how to change the API, are detailed in
<caption>Valid request header values for OpenAPI v2 queries</caption>
78
+
</table>
59
79
60
80
Kubernetes implements an alternative Protobuf based serialization format for the API that is primarily intended for intra-cluster communication, documented in the [design proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/protobuf.md) and the IDL files for each schema are located in the Go packages that define the API objects.
61
81
62
-
Prior to 1.14, the Kubernetes apiserver also exposes an API that can be used to retrieve
63
-
the [Swagger v1.2](http://swagger.io/) Kubernetes API spec at `/swaggerapi`.
64
-
This endpoint is deprecated, and was removed in Kubernetes 1.14.
65
-
66
82
## API versioning
67
83
68
84
To make it easier to eliminate fields or restructure resource representations, Kubernetes supports
69
85
multiple API versions, each at a different API path, such as `/api/v1` or
70
86
`/apis/extensions/v1beta1`.
71
87
72
-
We chose to version at the API level rather than at the resource or field level to ensure that the API presents a clear, consistent view of system resources and behavior, and to enable controlling access to end-of-life and/or experimental APIs. The JSON and Protobuf serialization schemas follow the same guidelines for schema changes - all descriptions below cover both formats.
88
+
Versioning is done at the API level rather than at the resource or field level to ensure that the
89
+
API presents a clear, consistent view of system resources and behavior, and to enable controlling
90
+
access to end-of-life and/or experimental APIs.
73
91
74
-
Note that API versioning and Software versioning are only indirectly related. The [API and release
75
-
versioning proposal](https://git.k8s.io/community/contributors/design-proposals/release/versioning.md) describes the relationship between API versioning and
76
-
software versioning.
92
+
The JSON and Protobuf serialization schemas follow the same guidelines for schema changes - all descriptions below cover both formats.
77
93
94
+
Note that API versioning and Software versioning are only indirectly related. The
proposal describes the relationship between API versioning and software versioning.
78
97
79
98
Different API versions imply different levels of stability and support. The criteria for each level are described
80
-
in more detail in the [API Changes documentation](https://git.k8s.io/community/contributors/devel/sig-architecture/api_changes.md#alpha-beta-and-stable-versions). They are summarized here:
- The version names contain `alpha` (e.g. `v1alpha1`).
@@ -101,35 +122,36 @@ in more detail in the [API Changes documentation](https://git.k8s.io/community/c
101
122
102
123
## API groups
103
124
104
-
To make it easier to extend the Kubernetes API, we implemented[*API groups*](https://git.k8s.io/community/contributors/design-proposals/api-machinery/api-group.md).
125
+
To make it easier to extend its API, Kubernetes implements[*API groups*](https://git.k8s.io/community/contributors/design-proposals/api-machinery/api-group.md).
105
126
The API group is specified in a REST path and in the `apiVersion` field of a serialized object.
106
127
107
-
Currently there are several API groups in use:
128
+
There are several API groups in a cluster:
108
129
109
-
1. The *core* group, often referred to as the *legacy group*, is at the REST path `/api/v1` and uses `apiVersion: v1`.
130
+
1. The *core* group, also referred to as the *legacy* group, is at the REST path `/api/v1` and uses `apiVersion: v1`.
110
131
111
-
1. The named groups are at REST path `/apis/$GROUP_NAME/$VERSION`, and use `apiVersion: $GROUP_NAME/$VERSION`
112
-
(e.g. `apiVersion: batch/v1`). Full list of supported API groups can be seen in [Kubernetes API reference](/docs/reference/).
132
+
1.*Named* groups are at REST path `/apis/$GROUP_NAME/$VERSION`, and use `apiVersion: $GROUP_NAME/$VERSION`
133
+
(e.g. `apiVersion: batch/v1`). The Kubernetes [API reference](/docs/reference/kubernetes-api/) has a
134
+
full list of available API groups.
113
135
114
-
115
-
There are two supported paths to extending the API with [custom resources](/docs/concepts/api-extension/custom-resources/):
136
+
There are two paths to extending the API with [custom resources](/docs/concepts/api-extension/custom-resources/):
0 commit comments