'Kubectl' throws error 'failed to negotiate an api version' while installing using docker

4/30/2016

I installed docker in machine using the guide in https://docs.docker.com/engine/installation/linux/ubuntulinux/ and I also installed Kubernetes in my local machine by using http://kubernetes.io/docs/getting-started-guides/docker/.

But once I run "kubectl get nodes" I get the error error: failed to negotiate an api version; server supports: map[], client supports: map[v1:{} metrics/v1alpha1:{} extensions/v1beta1:{} componentconfig/v1alpha1:{} batch/v1:{} autoscaling/v1:{} authorization.k8s.io/v1beta1:{}].

The docker version on my machine is as follows.

  • Client:

    • Version: 1.11.1
    • API version: 1.23
    • Go version: go1.5.4
    • Git commit: 5604cbe
    • Built: Tue Apr 26 23:30:23 2016
    • OS/Arch: linux/amd64
  • Server:

    • Version: 1.11.1
    • API version: 1.23
    • Go version: go1.5.4
    • Git commit: 5604cbe
    • Built: Tue Apr 26 23:30:23 2016
    • OS/Arch: linux/amd64
-- Sabra Ossen
api
docker
kubernetes
linux

2 Answers

5/9/2016

Ive tried using v1.3.0-alpha.3 of kubernetes with the same version of docker as the OP. I`m still having the same issue though. Should this be fixed in alpha.3 or do I need to wait for a new version ?

-- Roel Van Nyen
Source: StackOverflow

5/2/2016

Looks like the server responded with an empty list of api versions that it supports.

Can you post the output of kubectl version?

That will print the git versions of kubectl and api server and will help us find if there is any incompatibility between the two.

-- Nikhil Jindal
Source: StackOverflow