kubeless icon indicating copy to clipboard operation
kubeless copied to clipboard

Unable connect to cluster using exec credential

Open Phill93 opened this issue 5 years ago • 13 comments

Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT (worked see her #836) What happened: Unable to connect to a cluster using exec credentials.

>kubeless function list
FATA[0000] Can not list functions: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1beta1"

What you expected to happen: getting the functions on the cluster

How to reproduce it (as minimally and precisely as possible):

  1. create a cluster with kubespray
  2. use a exec credential to authenticate
  3. try to get the functions on the cluster with kubeless

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-19T22:12:47Z", GoVersion:"go1.12.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
  • Kubeless version (use kubeless version):
Kubeless version: v1.0.3
  • Cloud provider or physical cluster: physical deployed with kubespray

Phill93 avatar May 15 '19 14:05 Phill93

Hi @Phill93,

It seems that the problem is that in Kubernetes 1.14 the API version has changed from client.authentication.k8s.io/v1beta1 to client.authentication.k8s.io/v1. We would need to update the Kubernetes libraries used in Kubeless in order to use the new endpoint.

andresmgot avatar May 15 '19 18:05 andresmgot

If i change the api version in my kubectl config to v1. I can not connect to my cluster anymore with this error: kubectl:

error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"

kubeless:

FATA[0000] Can not list functions: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"

Phill93 avatar May 16 '19 05:05 Phill93

Is it possible to update the Kubernetes libaries easily?

Phill93 avatar May 16 '19 06:05 Phill93

Is it possible to update the Kubernetes libaries easily?

It is not trivial. It will probably require changes in the code to use the new endpoints.

andresmgot avatar May 16 '19 18:05 andresmgot

i have the same issue. any update for this?

hbinduni avatar Jul 04 '19 12:07 hbinduni

we have not worked on updating these libraries, are you also using kubespray or a different platform @hbinduni ?

andresmgot avatar Jul 04 '19 13:07 andresmgot

i use kubernetes from digitalocean and got this issue when i try to run kubeless function ls and also i have the same exatly issue when using fission. below my version:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-20T04:49:16Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:19:22Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

hbinduni avatar Jul 04 '19 13:07 hbinduni

I see, yes, it's likely the same issue, we would need to upgrade client-go and the kubernetes libraries so platforms that doesn't support client.authentication.k8s.io/v1beta1 are usable.

andresmgot avatar Jul 04 '19 14:07 andresmgot

It seems that the problem is that in Kubernetes 1.14 the API version has changed from client.authentication.k8s.io/v1beta1 to client.authentication.k8s.io/v1.

Where are you seeing that? v1alpha1 and v1beta1 are the currently supported versions (see https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go#L66-L70)

liggitt avatar Oct 07 '19 13:10 liggitt

in your kubeconfig file, what apiVersion is set in the user exec config? setting that to client.authentication.k8s.io/v1alpha1 would allow working with the level of client-go currently vendored in kubeless:

https://github.com/kubeless/kubeless/blob/master/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go#L55-L58

(note that the particular exec plugin you are using may or may not support the alpha exec version)

The best solution would be for kubeless to update to current client-go library versions to allow all supported exec plugins to work

liggitt avatar Oct 07 '19 13:10 liggitt

Hello, any update on this matter ? I am experimenting the same problem with Kubernetes v1.14.1 and trying with kubeless from v1.0.5 to 1.0.7

MchlUh avatar Dec 17 '20 14:12 MchlUh

bump

I did a bit of digging and the current supported Kubernetes clusters in cloud providers I'd be interested in using:

  • AWS EKS - 1.18.9, 1.17.12, 1.16.15, 1.15.12
  • GKE - 1.16, 1.17, 1.18
  • DOKS - 1.17, 1.18, 1.19

If this is the issue:

It seems that the problem is that in Kubernetes 1.14 the API version has changed from client.authentication.k8s.io/v1beta1 to client.authentication.k8s.io/v1. We would need to update the Kubernetes libraries used in Kubeless in order to use the new endpoint.

It might be time to give this update a higher priority. I currently want to run kubeless on digital ocean but unfortunately can not.

gcmurphy avatar Jan 29 '21 01:01 gcmurphy

@gcmurphy I'm also stuck, and I'm also running Kubernetes on Digitalocean. Any luck in how to fix this issue?

mazzespazze avatar Feb 16 '21 11:02 mazzespazze