Which apiVersion should K8S use?

Posted by realchamp on Fri, 16 Aug 2019 05:15:10 +0200

Original Link: https://www.jianshu.com/p/457cf0835f88

There is no detailed explanation of apiVersion in Kubernetes'official documentation, and since the K8S version itself is iterating rapidly, some resources are still in beta at the lower version and become stable at the higher version.

For example, Deployment:

Prior to version 1.6 apiVsersion:extensions/v1beta1

Between version 1.6 and 1.9: apps/v1beta1

After version 1.9: apps/v1

1. Meaning of various apiVersion s

alpha

*The software may contain errors.Enabling a feature may cause a bug
 * Support for this feature may be discarded at any time without notice

beta

* The software is well tested.Enabling functionality is considered safe.
*Functions are on by default
 * Details may change, but features will not be removed in future releases

stable

*Name the version as: vX Here X is an integer
 *Stable version, safe to use
 *Will appear in subsequent releases

v1

A stable version of the Kubernetes API with many core objects: pod, service, and so on

apps/v1beta2

In kubernetes1.8, the concept of apps/v1beta2 was added, and apps/v1beta1 is the same
 The current versions of DaemonSet, Deployment, ReplicaSet, and StatefulSet moved into apps/v1beta2, compatible with the original extensions/v1beta1

apps/v1

In kubernetes version 1.9, resources such as apps/v1, deployment were introduced from extensions/v1beta1, apps/v1beta1 and apps/v1beta2 into apps/v1, and the original v1beta1 was abandoned.

apps/v1 stands for: api combinations that contain some common application layers, such as Deployments, RollingUpdates, and ReplicaSets

batch/v1

Represents job-related api combinations

In kubernetes1.8, batch/v1beta1 was added, CronJob has migrated to batch/v1beta1, and then to batch/v1

autoscaling/v1

Represents an auto-scaling api combination introduced in version 1.8 of kubernetes.
Subsequent alpha and beta versions of this combination will support scaling based on memory usage and other monitoring metrics

extensions/v1beta1

Resources such as deployment were placed in version 1.6, moved to apps/v1beta2, and managed uniformly in apps/v1

certificates.k8s.io/v1beta1

Security authentication-related api combinations

authentication.k8s.io/v1

Resource authentication-related api combinations

2. View the currently available API versions

Execute kubectl api-versions

kubernetes 1.8

apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
apps/v1beta1
apps/v1beta2
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
batch/v1
batch/v1beta1
certificates.k8s.io/v1beta1
extensions/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
settings.k8s.io/v1alpha1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

kubernetes 1.11

admissionregistration.k8s.io/v1alpha1
admissionregistration.k8s.io/v1beta1
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1
apiregistration.k8s.io/v1beta1
apps/v1
apps/v1beta1
apps/v1beta2
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
batch/v1
batch/v1beta1
certificates.k8s.io/v1beta1
events.k8s.io/v1beta1
extensions/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
scheduling.k8s.io/v1beta1
settings.k8s.io/v1alpha1
storage.k8s.io/v1
storage.k8s.io/v1alpha1
storage.k8s.io/v1beta1
v1

 

Topics: Kubernetes