kubectl报错error validating data: the server could not find the requested resource

使用跳板机执行kubectl 命令报错

kubectl --kubeconfig /root/.kube/config --context kubernetes-admin@kubernetes apply -f test.yml
error: error validating "test.yml": error validating data: the server could not find the requested resource; if you choose to ignore these errors, turn validation off with --validate=false

原因:跳板机的kubectl版本与K8S集群的kubectl版本不匹配

解决:将跳板机的kubectl升级到与集群一致即可

你可能感兴趣的:(踩坑,kubernetes,docker)