Docker – When I use Deployment in Kubernetes, what’s the differences between apps/v1beta1 and extensions/v1beta1

dockerkubernetes

I use the yaml file, which is in the Kubernetes official document, to create a Deployment in Kubernetes, and it uses apiVersion: apps/v1beta1 at the top. Then I typed kubectl create -f deployment.yaml to create this Deployment, but it occured an error as following:

error: error validating "deployment.yaml": error validating data: couldn't find type: v1beta1.Deployment; if you choose to ignore these errors, turn validation off with --validate=false`

After some search, I changed apiVersion: apps/v1beta1 to extensions/v1beta1, and then recreate the Deployment with the yaml file, and it worked fine.
So, I wanna know what's the differences between apps/v1beta1 and extensions/v1beta1. Is it pertinent to the Kubernetes version?

# kubectl version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:53:09Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-07T23:34:32Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

Best Answer

The apps API group will be where the v1 Deployment type lives. The apps/v1beta1 version was added in 1.6.0, so if you have a 1.5.x client or server, you should still use the extensions/v1beta1 version.

The apps/v1beta1 and extensions/v1beta1 Deployment types are identical, but when creating via the apps API, some improved defaults are used

Related Topic