When we create Kubernetes resource manifests, one of the first important things that we need to specify for the resource is the
apiVersion. For many of the common resources, you might be able to “guess” accurately, but it’s a good skill to be able to figure this out in your cluster. The format of the apiVersion is
An object definition in Kubernetes requires a
apiVersion field. When Kubernetes has a release that updates what is available for you to use—changes something in its API—a new
apiVersion is created.
apiVersion should I use?
What does each
API versions with ‘alpha’ in their name are early candidates for new functionality coming into Kubernetes. This is not stable for use. These may contain bugs.
‘beta’ in the API version name means that testing has progressed past alpha level and that the feature will eventually be included in Kubernetes. Although the way it works might change, and the way objects are defined may change completely, the feature itself is highly likely to make it into Kubernetes in some form.
They are safe to use. These do not contain ‘alpha’ or ‘beta’ in their name.
v1 version was the first stable version release of the Kubernetes API. It contains many core objects in Kubernetes.
apps is the most common API group in Kubernetes, with many core objects. It includes various functions like running applications on Kubernetes, like Deployments, RollingUpdates, and ReplicaSets.
This API version autoscaling/v1 allows pods to be autoscaled based on different resource usage metrics. Kubernetes autoscaling helps optimize resource usage and costs by automatically scaling a cluster up and down. Autoscaling is totally dependent on demand.
This stable version includes support for only CPU scaling, but future alpha and beta versions will allow you to scale based on memory usage and custom metrics.
The batch API group contains objects related to batch processing and job-like tasks. This apiVersion is the first stable release of these API objects.
A beta version release with new functionality for batch objects in Kubernetes, including CronJobs that like you can set a specific time and the job will execute at that time or periodicity.
This API version plays an important role for validate network certificates for secure communication in your cluster.
This version of the API includes many new and commonly used features of Kubernetes. Deployments, DaemonSets, ReplicaSets, and Ingresses all received significant changes in this release. Using extensions/v1beta1 is becoming deprecated—try to use the specific API group where possible, depending on your Kubernetes cluster version.
Basically, this apiVersion is used to add the new rules around pod security and the ability to set a pod disruption budget.
This apiVersion is used for access control. It plays an important role to secure our cluster. It includes more functionality for Kubernetes role-based access control.
Basically, I have covered all common apiVersion. You can also have a look at Kubernetes documentation. In an upcoming blog, I will explain more about all these apiVersion with proper examples.
Documentation – https://kubernetes.io/docs/home/