kubectl执行报错,invalid object doesn't have additional properties

原创
05/08 10:08
阅读数 408

kubectl命令执行报错
kubectl apply -f /tmp/alert.yaml
error: SchemaError(io.k8s.api.autoscaling.v1.CrossVersionObjectReference): invalid object doesn't have additional properties


kubectl version 版本不一样
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T08:13:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.3-tke.5", GitCommit:"6de006122d3e9abf44c8711b253e576d839a77f1", GitTreeState:"clean", BuildDate:"2020-04-14T11:12:31Z", GoVersion:"go1.12.14", Compiler:"gc", Platform:"linux/amd64"}


升级kubectl版本后,执行成功
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
       http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

yum install -y kubelet-1.16.3 kubectl-1.16.3

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部