我创建一个deployment.yaml来创建kubernetes的部署。

这是我的尝试:
apiVersion: apps/v1
获取error: unable to recognize "./slate-master/deployment.yaml": no matches for kind "Deployment" in version "apps/v1"apiVersion: extensions/v1beta1apiVersion: apps/v1beta1
他们两个都得到Error from server (BadRequest): error when creating "./slate-master/deployment.yaml": Deployment in version "v1beta1" cannot be handled as a Deployment: v1beta1.Deployment: ...
这是我的kubernetes版本:

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-05-12T04:12:12Z", GoVersion:"go1.9.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.7", GitCommit:"b30876a5539f09684ff9fde266fda10b37738c9c", GitTreeState:"clean", BuildDate:"2018-01-16T21:52:38Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

那么,为什么kubernetes创建部署失败?

最佳答案

通过以下方式更改apiVersion: apps/v1:

apiVersion: extensions/v1beta1

关于kubernetes-无法正确创建部署,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50601057/

10-10 04:29