kubernetes: Kubectl 1.11.0 is unable to get pods or nodes on clusters running 1.8.4
/kind bug
What happened:
When getting nodes or pods using the command kubectl get pods
kubectl get pods
, the following output appears:
No resources found.
Error from server (NotAcceptable): unknown (get nodes)
No resources found.
Error from server (NotAcceptable): unknown (get pods)
What you expected to happen:
When running the command, kubectl get pods/nodes
, with kubectl version 1.11.0, pods/nodes appear.
How to reproduce it (as minimally and precisely as possible):
- Run
kubectl get pods
using kubectl 1.11.0
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version
):
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.4", GitCommit:"9befc2b8928a9426501d3bf62f72849d5cbcd5a3", GitTreeState:"clean", BuildDate:"2017-11-20T05:17:43Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
- Cloud provider or hardware configuration: AWS
- OS (e.g. from /etc/os-release):
- Kernel:
Linux default-52e963f4-b57f-4225-9a4e-0b33ba4d0197 4.4.0-96-generic #119~14.04.1-Ubuntu SMP Wed Sep 13 08:40:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Install tools:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.11.0/bin/linux/amd64/kubectl
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 46
- Comments: 33 (3 by maintainers)
I just started getting this after upgrading kubectl to 1.11.0.
Downgrading to 1.8.7 to match my server version fixed my issue (same as stephanwesten previously mentioned)
Had same issues , for some reason I got to 1.11.0 version and that did not work… MAC users try version 1.10.0 or replace the curl version with whatever you think it will work for you.
I had the same problem on macos with the exact same versions.
Downgraded kubectl to v1.8.7 and it seems to solve the problem
wget https://storage.googleapis.com/kubernetes-release/release/v1.8.7/bin/darwin/amd64/kubectl
It would be good to improve the error message, as a user you are clueless how to solve this issue.
I can confirm the workaround works also on Mac for getting pods:
$ kubectl get pods --server-print=false
While without --server-print the command gives an error:Got the same error with clusters running on 1.8.6
For macOs users, brew switch will only worked if you already have 1.10 installed before, if not, you can get it right from the commit
then, switch to 1.10.2
brew switch kubernetes-cli 1.10.2
Workaround I found on Azure (probably others as well) is to pass
--server-print=false
:kubectl get componentstatuses --server-print=false
It appears to be related to a new “Server-side columns” feature introduced in 1.11.0. Here’s a link to the reference: https://kubernetes.io/docs/reference/kubectl/overview/#server-side-columns
@darthmetu
edit: reference to azure issue: https://github.com/Azure/azure-cli/issues/7440
kubectl get pods --all-namespaces
also works on 1.11.3Yes. 1.8 is outside the supported skew window for kubectl 1.11, and the server side bug causing this is fixed in 1.9+
I’ve resolved the same issue by downgrading to 1.10.2
brew switch kubernetes-cli 1.10.2
Downgraded to 1.10.5 as a workaround, looks fine
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/d09d97241b17a5e02a25fc51fc56e2a5de74501c/Formula/kubernetes-cli.rb
brew switch kubernetes-cli 1.10.5
Thanks @pauldutheil and @wilsonsilva
You can also add the -w switch or switch the output using -o. I had to do this when using kubectl on Azure in the cloud shell as I can’t control the versions there. Not ideal but it will work.
kubectl supports +/- 1 version of skew against the API server. kubectl 1.11 defaults to requesting table output from the apiserver by sending the following accept header:
servers prior to 1.9 do not handle that accept header correctly (and return the “Not Acceptable” error, which kubectl displays). this was resolved in https://github.com/kubernetes/kubernetes/pull/50603
/close
I am also facing same problem please give solution.
No resources found. Error from server (NotAcceptable): unknown (get nodes)
Thanks srikant
Downgrading to version 1.10.0 fixed the issue for me.
kubectl get pods --server-print=false works on ubuntu, thanks
Note that you are only affected if you make use of the
kubectl cp
commandDowngrading to
v1.10.5
works well too.