从“来自服务器的错误(未找到):服务器找不到所请求的资源"中确定未找到什么资源. [英] Determine what resource was not found from "Error from server (NotFound): the server could not find the requested resource"

查看:182
本文介绍了从“来自服务器的错误(未找到):服务器找不到所请求的资源"中确定未找到什么资源.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行kubectl create -f notRelevantToThisQuestion.yml

我得到的答复是:

服务器错误(NotFound):服务器找不到请求的 资源

Error from server (NotFound): the server could not find the requested resource

有什么方法可以确定未找到请求的资源吗?

Is there any way to determine which resource was requested that was not found?

kubectl get ns返回

名称状态年龄
默认有效243d
kube-public活动243d
kube-system活动243d

NAME STATUS AGE
default Active 243d
kube-public Active 243d
kube-system Active 243d

这不是Cron工作.
客户端版本1.9
服务器版本1.6

This is not a cron job.
Client version 1.9
Server version 1.6

这非常类似于

This is very similar to https://devops.stackexchange.com/questions/2956/how-do-i-get-kubernetes-to-work-when-i-get-an-error-the-server-could-not-find-t?rq=1 but my k8s cluster has been deployed correctly (everything's been working for almost a year, I'm adding a new pod now).

推荐答案

要解决此问题,请降级客户端或升级服务器.就我而言,我已经升级了服务器(新的minikube),但是忘记升级客户端(kubectl)并最终获得了那些版本.

To solve this downgrade the client or upgrade the server. In my case I've upgraded server (new minikube) but forget to upgrade client (kubectl) and end up with those versions.

$ kubectl version --short
Client Version: v1.9.0
Server Version: v1.14.1

当我升级客户端版本(在本例中为1.14.2)时,一切又开始正常工作.

When I'd upgraded client version (in this case to 1.14.2) then everything started to work again.

此处说明如何安装(在您的情况下升级)客户端 https://kubernetes .io/docs/tasks/tools/install-kubectl

Instructions how to install (in your case upgrade) client are here https://kubernetes.io/docs/tasks/tools/install-kubectl

这篇关于从“来自服务器的错误(未找到):服务器找不到所请求的资源"中确定未找到什么资源.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆