Reference Documentation

Design docs, concept definitions, and references for APIs and CLIs.

Edit This Page

Kubernetes API Overview

Primary system and API concepts are documented in the User guide.

Overall API conventions are described in the API conventions doc.

Remote access to the API is discussed in the access doc.

The Kubernetes API also serves as the foundation for the declarative configuration schema for the system. The Kubectl command-line tool can be used to create, update, delete, and get API objects.

Kubernetes also stores its serialized state (currently in etcd) in terms of the API resources.

Kubernetes itself is decomposed into multiple components, which interact through its API.

API changes

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 a deprecation process. The precise deprecation policy for eliminating features is TBD, but once we reach our 1.0 milestone, there will be a specific policy.

What constitutes a compatible change and how to change the API are detailed by the API change document.

API Swagger definitions

Complete API details are documented using Swagger v1.2. The Kubernetes apiserver (aka “master”) exposes an API that can be used to retrieve the Swagger Kubernetes API spec, by default at located at /swaggerapi, and a UI to browse the API documentation at /swagger-ui.

We also host a version of the latest API documentation UI. This is updated with the latest release, so if you are using a different version of Kubernetes you will want to use the spec from your apiserver.

Kubernetes implements an alternative Protobuf based serialization format for the API that is primarily intended for intra-cluster communication, documented in the design proposal and the IDL files for each schema are located in the Go packages that define the API objects.

API versioning

To make it easier to eliminate fields or restructure resource representations, Kubernetes supports multiple API versions, each at a different API path, such as /api/v1 or /apis/extensions/v1beta1.

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-lifed and/or experimental APIs. The JSON and Protobuf serialization schemas follow the same guidelines for schema changes - all descriptions below cover both formats.

Note that API versioning and Software versioning are only indirectly related. The API and release versioning proposal describes the relationship between API versioning and software versioning.

Different API versions imply different levels of stability and support. The criteria for each level are described in more detail in the API Changes documentation. They are summarized here:

API groups

To make it easier to extend the Kubernetes API, we are in the process of implementing API groups. These are simply different interfaces to read and/or modify the same underlying resources. The API group is specified in a REST path and in the apiVersion field of a serialized object.

Currently there are two API groups in use:

  1. the “core” group, which is at REST path /api/v1 and is not specified as part of the apiVersion field, e.g. apiVersion: v1.
  2. the “extensions” group, which is at REST path /apis/extensions/$VERSION, and which uses apiVersion: extensions/$VERSION (e.g. currently apiVersion: extensions/v1beta1). This holds types which will probably move to another API group eventually.
  3. the “componentconfig” and “metrics” API groups.

In the future we expect that there will be more API groups, all at REST path /apis/$API_GROUP and using apiVersion: $API_GROUP/$VERSION. We expect that there will be a way for third parties to create their own API groups, and to avoid naming collisions.

Enabling resources in the extensions group

DaemonSets, Deployments, HorizontalPodAutoscalers, Ingress, Jobs and ReplicaSets are enabled by default. Other extensions resources can be enabled by setting runtime-config on apiserver. runtime-config accepts comma separated values. For ex: to disable deployments and jobs, set --runtime-config=extensions/v1beta1/deployments=false,extensions/v1beta1/jobs=false

v1beta1, v1beta2, and v1beta3 are deprecated; please move to v1 ASAP

As of June 4, 2015, the Kubernetes v1 API has been enabled by default. The v1beta1 and v1beta2 APIs were deleted on June 1, 2015. v1beta3 is planned to be deleted on July 6, 2015.

v1 conversion tips (from v1beta3)

We’re working to convert all documentation and examples to v1. Use kubectl create --validate in order to validate your json or yaml against our Swagger spec.

Changes to services are the most significant difference between v1beta3 and v1.

Some other difference between v1beta3 and v1:

v1beta3 conversion tips (from v1beta1/2)

Some important differences between v1beta1/2 and v1beta3:


Create Issue Edit This Page