kubernetic icon indicating copy to clipboard operation
kubernetic copied to clipboard

Cannot work with k8s cluster which supports kubectl up to 1.9.9 only

Open stepanselyuk opened this issue 7 years ago • 2 comments

Hello, I cannot make Kubernetic work with k8s cluster which supports kubectl up to 1.9.9 only. It shows the cluster is online.

screen shot on 2018-10-28 at 20-55-26

This is output from kubectl 1.9.9 version: kubectl19 version

Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.5+coreos.0", GitCommit:"b8e596026feda7b97f4337b115d1a9a250afa8ac", GitTreeState:"clean", BuildDate:"2017-12-12T11:01:08Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

This is output from kubectl (1.12):

kubectl get namespaces
Error from server (NotAcceptable): unknown (get namespaces)

While kubectl 1.9.9 displays the list correctly.

stepanselyuk avatar Oct 28 '18 17:10 stepanselyuk

Hi Stephen,

it seems your cluster is too old, if there is no compatibility with new kubectl version then kubernetic will not be backporting there, and your best bet is to upgrade the cluster if it's in your power.

Though I'm curious what's the difference between those two commands, can you post here the same commands for both kubectl versions adding --v=8 to check the API calls?

dkapanidis avatar Oct 29 '18 08:10 dkapanidis

For kubectl 1.12 I can post exceptions from bottom of the log:

I1029 14:28:00.796972   88344 loader.go:359] Config loaded from file /Users/Jason/.kube/config
I1029 14:28:00.797581   88344 round_trippers.go:383] GET https://k8s.redacteddomain.com:6443/api/v1/namespaces?limit=500
I1029 14:28:00.797594   88344 round_trippers.go:390] Request Headers:
I1029 14:28:00.797599   88344 round_trippers.go:393]     Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json
I1029 14:28:00.797604   88344 round_trippers.go:393]     User-Agent: kubectl/v1.12.0 (darwin/amd64) kubernetes/0ed3388
I1029 14:28:01.148367   88344 round_trippers.go:408] Response Status: 406 Not Acceptable in 350 milliseconds
I1029 14:28:01.148394   88344 round_trippers.go:411] Response Headers:
I1029 14:28:01.148405   88344 round_trippers.go:414]     Content-Type: application/json
I1029 14:28:01.148413   88344 round_trippers.go:414]     Content-Length: 220
I1029 14:28:01.148421   88344 round_trippers.go:414]     Date: Mon, 29 Oct 2018 11:28:00 GMT
I1029 14:28:01.148458   88344 request.go:942] Response Body: {
  "metadata": {},
  "status": "Failure",
  "message": "only the following media types are accepted: application/json, application/yaml, application/vnd.kubernetes.protobuf",
  "reason": "NotAcceptable",
  "code": 406
}
I1029 14:28:01.148640   88344 request.go:1144] body was not decodable (unable to check for Status): Object 'Kind' is missing in '{
  "metadata": {},
  "status": "Failure",
  "message": "only the following media types are accepted: application/json, application/yaml, application/vnd.kubernetes.protobuf",
  "reason": "NotAcceptable",
  "code": 406
}'
I1029 14:28:01.149418   88344 helpers.go:201] server response object: [{
  "metadata": {},
  "status": "Failure",
  "message": "unknown (get namespaces)",
  "reason": "NotAcceptable",
  "details": {
    "kind": "namespaces",
    "causes": [
      {
        "reason": "UnexpectedServerResponse",
        "message": "unknown"
      }
    ]
  },
  "code": 406
}]
F1029 14:28:01.149454   88344 helpers.go:119] Error from server (NotAcceptable): unknown (get namespaces)

Same piece from log of kubectl19:

I1029 14:34:43.075873   88676 loader.go:357] Config loaded from file /Users/Jason/.kube/config
I1029 14:34:43.103117   88676 round_trippers.go:414] GET https://k8s.redacteddomain.com:6443/api/v1/namespaces?limit=500
I1029 14:34:43.103137   88676 round_trippers.go:421] Request Headers:
I1029 14:34:43.103144   88676 round_trippers.go:424]     Accept: application/json
I1029 14:34:43.103149   88676 round_trippers.go:424]     User-Agent: kubectl19/v1.9.9 (darwin/amd64) kubernetes/57729ea
I1029 14:34:44.223175   88676 round_trippers.go:439] Response Status: 200 OK in 1120 milliseconds
I1029 14:34:44.223206   88676 round_trippers.go:442] Response Headers:
I1029 14:34:44.223218   88676 round_trippers.go:445]     Content-Type: application/json
I1029 14:34:44.223229   88676 round_trippers.go:445]     Date: Mon, 29 Oct 2018 11:34:44 GMT

It looks like an issue with format or value of Accept header of the request to /api/v1/namespaces

stepanselyuk avatar Oct 29 '18 11:10 stepanselyuk