Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apiVersion and beta versions

Tags:

Following the docs to create a Deployment, I have a .yaml file like this:

apiVersion: extensions/v1beta1 kind: Deployment ... 

I wasn't sure what to make of the "extensions/v1beta1", so I ended up here in the API docs.

That makes it sound like I should use a value of "v1", but that doesn't seem to be valid when I try to kubectl apply my .yaml file.

Could someome help me to better understand what the apiVersion values mean and how I can determine the best value to use for each component?

Oh, and I'm using minikube and "kubectl version" reports that client and server are "GitVersion:"v1.3.0".

like image 841
user605331 Avatar asked Jul 23 '16 23:07

user605331


People also ask

What is apiVersion in Kubernetes?

apiVersion - Which version of the Kubernetes API you're using to create this object. kind - What kind of object you want to create. metadata - Data that helps uniquely identify the object, including a name string, UID , and optional namespace. spec - What state you desire for the object.

What are different kinds in Kubernetes?

There are four types of Kubernetes services — ClusterIP , NodePort , LoadBalancer and ExternalName .

How do I know what version of kubectl I have?

Node Version For instance, you can also view the version details of the kubelets of each node by running kubectl get nodes -o yaml and searching through the output for “kubelet”.


2 Answers

The docs you linked to are from before the release of Kubernetes 1.0 (a year ago). At that time, we had beta versions of the API and were migrating to the v1 API. Since then, we have introduced multiple API groups, and each API group can have a different version. The version indicates the maturity of the API (alpha is under active development, beta means it will have compatibility/upgradability guarantees, and v1 means it's stable). The deployment API is currently in the second category, so using extensions/v1beta1 is correct.

like image 184
Robert Bailey Avatar answered Sep 23 '22 05:09

Robert Bailey


from documentation suggested by @Vern DeHaven

extensions/v1beta1

This version of the API includes many new, commonly used features of Kubernetes. Deployments, DaemonSets, ReplicaSets, and Ingresses all received significant changes in this release.

Note that in Kubernetes 1.6, some of these objects were relocated from extensions to specific API groups (e.g. apps). When these objects move out of beta, expect them to be in a specific API group like apps/v1.

Using extensions/v1beta1 is becoming deprecated—try to use the specific API group where possible, depending on your Kubernetes cluster version.

like image 32
jkogut Avatar answered Sep 22 '22 05:09

jkogut