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

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

Commands: $> kubectl get nodes NAME STATUS ROLES AGE VERSION 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

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

This comment has been deleted