Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine what resource was not found from "Error from server (NotFound): the server could not find the requested resource"

I'm running kubectl create -f notRelevantToThisQuestion.yml

The response I get is:

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 returns

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

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).

like image 799
Glen Pierce Avatar asked Jul 04 '18 19:07

Glen Pierce


2 Answers

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

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

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

like image 52
sobi3ch Avatar answered Oct 23 '22 15:10

sobi3ch


I have the same error when trying to do a CD with Jenkins and Kubernetes. In the pipeline I excute kubectl create -f app-deployment.yml -v=8 This image show more information about the error:

enter image description here

like image 1
Marluan Espiritusanto Guerrero Avatar answered Oct 23 '22 14:10

Marluan Espiritusanto Guerrero