Kubectl apply -f deployment.yml -> the server could not find the requested resource

Posted July 2, 2019 11k views

When I try to deploy anything to my cluster i get this response
“the server could not find the requested resource”

$> kubectl get nodes
ideea-prod-pool-1-o5a6 Ready <none> 1h v1.14.1
ideea-prod-pool-1-o5al Ready <none> 1h v1.14.1
ideea-prod-pool-1-o5at Ready <none> 1h v1.14.1

$> kubectl apply -f deployment.yml
Error from server (NotFound): the server could not find the requested resource


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

If you are like me and seeing this error, my error was having an old kubectl installed. To install the newest version you can look here. If you are like me and used brew use this:

brew upgrade kubernetes-cli

To validate you have the correct version of kubectl you can run:

kubectl version

And validate that you are within 1 minor version between server and client. I was off by 7.

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T21:12:46Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.6", GitCommit:"72c30166b2105cd7d3350f2c28a219e6abcd79eb", GitTreeState:"clean", BuildDate:"2020-01-18T23:23:21Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

After upgrade I was on 1.18 for my client, but it fixed my issue.

This question was answered by @sabrinac:

Hey Anthony, can you please open a support ticket so we can investigate this?

View the original comment