当我试图描述hpa时,会抛出以下错误:
kubectl describe hpa go-auth
Error from server (NotFound): the server could not find the requested resource
我的kubectl版本是:
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.7-gke.7", GitCommit:"b80664a77d3bce5b4701bc881d972b1a702290bf", GitTreeState:"clean", BuildDate:"2019-04-04T03:12:09Z", GoVersion:"go1.10.8b4", Compiler:"gc", Platform:"linux/amd64"}
小心kubectl
version skew。不支持使用kubectl
v1.12运行kube-apiserver
v1.14。
根据kubectl
docs:
您必须使用与群集的一个次要版本差异的kubectl版本。例如,v1.2客户端应该与v1.1,v1.2和v1.3 master一起使用。使用最新版本的kubectl有助于避免无法预料的问题。
使用kubectl
v1.12.x再试一次,你可能会摆脱这个问题。另外,看看#568问题(特别是this评论),它解决了你遇到的同样问题。
如果您想知道如何管理多个kubectl
版本,我建议阅读:Using different kubectl versions with multiple Kubernetes clusters。