Question

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

Subscribe
Share

None of them work. Even your own tutorials…

Nonetheless here is the contents of deployment.yml (basic redis instance)

https://gist.github.com/anthonybudd/4bfb090f8c3c2865bf39d8408a121a7a

How was this resolved? There is no answer on here, and the link just links to sales force that users (me) cannot link to. I was following along to the tutorial below and I was getting the same error.

https://www.digitalocean.com/community/meetup_kits/getting-started-with-containers-and-kubernetes-a-digitalocean-meetup-kit

I understand this could be an issue with my kubernetes set up, but there wasn’t any part that told me I needed to set up kubernetes in a special way, please let me know what you find. thanks!

Thanks! Checking it out now.

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

Are you going to update me or shall I just take my business to another provider?

$> kubectl apply -fdeployment.yml -v=8 I0702 15:56:19.419439 65914 loader.go:357] Config loaded from file /Users/anthonybudd/.kube/config I0702 15:56:19.426161 65914 round_trippers.go:414] GET https://abc74b05-b157-4b4a-adc9-7f8562f36da9.k8s.ondigitalocean.com/swagger-2.0.0.pb-v1 I0702 15:56:19.426201 65914 round_trippers.go:421] Request Headers: I0702 15:56:19.426219 65914 round_trippers.go:424] Accept: application/json, / I0702 15:56:19.426233 65914 round_trippers.go:424] User-Agent: kubectl/v1.9.7 (darwin/amd64) kubernetes/dd5e1a2 I0702 15:56:19.736201 65914 round_trippers.go:439] Response Status: 404 Not Found in 309 milliseconds I0702 15:56:19.736227 65914 round_trippers.go:442] Response Headers: I0702 15:56:19.736236 65914 round_trippers.go:445] Audit-Id: cb66376c-6c1d-46f9-99a5-e290585e7a12 I0702 15:56:19.736245 65914 round_trippers.go:445] Content-Type: application/json I0702 15:56:19.736253 65914 round_trippers.go:445] Content-Length: 487 I0702 15:56:19.736260 65914 round_trippers.go:445] Date: Tue, 02 Jul 2019 20:56:19 GMT I0702 15:56:19.740779 65914 request.go:873] Response Body: { “paths”: [ “/apis”, “/apis/”, “/apis/apiextensions.k8s.io”, “/apis/apiextensions.k8s.io/v1beta1”, “/healthz”, “/healthz/etcd”, “/healthz/log”, “/healthz/ping”, “/healthz/poststarthook/crd-informer-synced”, “/healthz/poststarthook/generic-apiserver-start-informers”, “/healthz/poststarthook/start-apiextensions-controllers”, “/healthz/poststarthook/start-apiextensions-informers”, “/metrics”, “/openapi/v2”, “/version” ] } I0702 15:56:19.742295 65914 helpers.go:201] server response object: [{ “metadata”: {}, “status”: “Failure”, “message”: “the server could not find the requested resource”, “reason”: “NotFound”, “details”: { “causes”: [ { “reason”: “UnexpectedServerResponse”, “message”: “unknown” } ] }, “code”: 404 }] F0702 15:56:19.742334 65914 helpers.go:119] Error from server (NotFound): the server could not find the requested resource

Hi there,

Can you please share the contents of deployment.yml? Please ensure to scrub it of an sensitive data such as usernames and passwords if they are specified there.

Regards,

John Kwiatkoski Senior Developer Support Engineer


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

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.

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