This page provides an overview of the Kubernetes API.
The REST API is the fundamental fabric of Kubernetes. All operations and communications between components, and external user commands are REST API calls that the API Server handles. Consequently, everything in the Kubernetes platform is treated as an API object and has a corresponding entry in the API.
Most operations can be performed through the kubectl command-line interface or other command-line tools, such as kubeadm, which in turn use the API. However, you can also access the API directly using REST calls.
Consider using one of the client libraries if you are writing an application using the Kubernetes API.
To eliminate fields or restructure resource representations, Kubernetes supports
multiple API versions, each at a different API path. For example:
The version is set at the API level rather than at the resource or field level to:
The JSON and Protobuf serialization schemas follow the same guidelines for schema changes. The following descriptions cover both formats.
Note: The API versioning and software versioning are indirectly related. The API and release versioning proposal describes the relationship between API versioning and software versioning.
Different API versions indicate different levels of stability and support. You can find more information about the criteria for each level in the API Changes documentation.
Here’s a summary of each level:
Note: Try the beta features and provide feedback. After the features exit beta, it may not be practical to make more changes.
Xis an integer.
API groups make it easier to extend the Kubernetes API. The API group is specified in a REST path and in the
apiVersion field of a serialized object.
Currently, there are several API groups in use:
/api/v1and is not specified as part of the
apiVersionfield, for example,
/apis/$GROUP_NAME/$VERSION, and use
apiVersion: $GROUP_NAME/$VERSION(for example,
apiVersion: batch/v1). You can find the full list of supported API groups in Kubernetes API reference.
The two paths that support extending the API with custom resources are:
Certain resources and API groups are enabled by default. You can enable or disable them by setting
on the apiserver.
--runtime-config accepts comma separated values. For example:
- to disable batch/v1, set
- to enable batch/v2alpha1, set
The flag accepts comma separated set of key=value pairs describing runtime configuration of the apiserver.
Note: When you enable or disable groups or resources, you need to restart the apiserver and controller-manager to pick up the
DaemonSets, Deployments, HorizontalPodAutoscalers, Ingress, Jobs and ReplicaSets are enabled by default.
You can enable other extensions resources by setting
--runtime-config accepts comma separated values. For example, to disable deployments and jobs, set