kubectl版本
$ kubectl version
Client Version: version.Info{Major:"1",Minor:"16",GitVersion:"v1.16.3",GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749",GitTreeState:"clean",BuildDate:"2019-11-18T14:56:51Z",GoVersion:"go1.12.13",Compiler:"gc",Platform:"linux/amd64"}
Server Version: version.Info{Major:"1",GitVersion:"v1.16.2",GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b",BuildDate:"2019-10-15T19:09:08Z",GoVersion:"go1.12.10",Platform:"linux/amd64"}
错误
当我运行kubectl run
时,会发生错误。
$ kubectl run nginx --image=nginx
WARNING: New generator "deployment/apps.v1" specified,but it isn't available. Falling back to "run/v1".
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
error: no matches for kind "Deployment" in version "apps/v1"
这似乎是由新版本(1.16.x)引起的,不是吗?
据我搜索,甚至官方文件也没有明确提及与此情况相关的内容。我该如何使用kubectl run
?