Kubernetes API Overview - closed

REST API is an important part Kubernetes system, operation and communication between all the components of the processing by the API Server REST API calls, in most cases, API definitions and implementations of standard HTTP REST format, you can kubectl command management tool or other command-line tool to perform.

API version

In order compatible with older versions while the escalating new API, Kubernetes API supports multiple versions, each version has a different API API path, such as / api / v1 or / apis / extensions / v1beta1.

API version rules-based API level select version, rather than resource-based and domain-level selection, in order to ensure that the API can describe a clear view of the continuous system resources and behavior, the whole process can control access to and control of experimental API, access.

  • Protobuf and JSON serialization mode follows the same pattern change principle, all described below are covered by these two modes.

It should be noted, API version and the version of the software is not directly related, different API versions have different degrees of stability, API documentation describes in detail each level standards.

Alpha level:

  • Comprising alpha version name (e.g. v1alpha1).
  • The software may contain errors. Enable a feature may cause bug. By default, the feature may be disabled.
  • At any time may drop support for this feature, without notice.
  • API may not be compatible with a way to change in later versions of the software, without notice.
  • The software is recommended only for short-term tests in the cluster, because of an increased risk of errors and lack of long-term support.

Beta level:

  • The beta version contains the name (for example v2beta3). The software is well tested. Enable function is considered safe. By default, the feature is turned on. Details may change, but the function may not be compatible with the way changes in subsequent beta versions or Stable version in subsequent versions are not deleted object mode or semantics. If this occurs, the official will provide migration guides. This may need to delete, edit, and re-create the API object. This may change in subsequent versions of some incompatible places, it is recommended for non-critical services, if you have multiple clusters can be upgraded independently, you can also relax this restriction. After we used the Beta version, you can give the community feedback, if this version does not change much after subsequent updates. Stable level:
  • The version name naming: vX where X is an integer.
  • Features Stable version will appear in a subsequent version of the software release.

API groups

API groups so that expansion Kubernetes API more convenient. API groups are designated in the path and apiVersion REST field in the serialized object.

Currently, there are several API groups in use:

  • The core (also called legacy) group, REST path / api / v1, but this path is not fixed, v1 is the current version. Correspondingly apiVersion code field inside is v1.
  • Named Groups, REST path is specified in the / apis / $ GROUP_NAME / $ VERSION, and use apiVersion: $ GROUP_NAME / $ VERSION (e.g. apiVersion: batch / v1). In Kubernetes API references can see the complete list of API Groups.

Use custom resource extension API in two ways:

  1. CustomResourceDefinition to provide basic CRUD needs of the user.
  2. Coming Soon: Kubernetes API requires a complete semantic user can implement custom api server, and use the seamless connection aggregator client.

 

Enable API Groups

You can use --runtime-config settings to enable or disable certain resources and API Groups on api server. --runtime-config comma-separated values ​​may be used. For example, to disable the batch / v1, set --runtime-config = batch / v1 = false, to enable batch / v2alpha1, set --runtime-config = batch / v2alpha1. This tag has a set of key = value pairs separated by a comma described api server runtime configuration.

Tip: Enable and disable Groups or resources need to restart apiserver and controller-manager ensure --runtime-config changes to take effect.

Enable group resource

DaemonSets, Deployments, HorizontalPodAutoscalers, Ingress, Jobs and ReplicaSets, are enabled by default. Other extensions can be enabled by --runtime-config resources provided on api server. --runtime-config acceptable values ​​are separated by commas. For example, to disable deployments and Jobs, set --runtime-config = extensions / v1beta1 / deployments = false, extensions / v1beta1 / jobs = false

This article translation Kubernetes official documents

Original articles published 0 · won praise 0 · Views 542

Guess you like

Origin blog.csdn.net/qingdao666666/article/details/104625412