kubeless icon indicating copy to clipboard operation
kubeless copied to clipboard

unable to use kubeless cli

Open rmodpur opened this issue 5 years ago • 6 comments

Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT What happened: I'm trying to deploy a function on a k3s cluster using kubeless cli but on giving the following command kubeless function ls i'm getting the following error FATA[0000] Get https://localhost:6443/apis/kubeless.io/v1beta1/namespaces/default/functions: x509: certificate signed by unknown authority

What you expected to happen: It should list the functions How to reproduce it (as minimally and precisely as possible): just type the above command

Anything else we need to know?: I'm able to deploy the function using kubeless ui but i'm unable to deploy it through kubeless cli. Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1-k3s.4", GitCommit:"52f3b42401c93c36467f1fd6d294a3aba26c7def", GitTreeState:"clean", BuildDate:"2019-04-15T22:13+00:00Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1-k3s.4", GitCommit:"52f3b42401c93c36467f1fd6d294a3aba26c7def", GitTreeState:"clean", BuildDate:"2019-04-15T22:13+00:00Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • K3s version : v0.5.0
  • Kubeless version (use kubeless version): v1.0.3
  • Cloud provider or physical cluster: physical cluster

rmodpur avatar Jun 01 '19 11:06 rmodpur

Hi @rmodpur,

kubeless (and also kubectl) get the certificates to access the API server from the Kubernetes config (~/.kube/config by default). That may not be the case for k3s. I have never tried that platform. Are you able to access that cluster using kubectl? What information is placed in the kube config related to the certificate?

andresmgot avatar Jun 03 '19 22:06 andresmgot

Yes, k3s has it's own kubectl which is exactly the same as that of k8s. I'm able to list the functions deployed through the kubeless ui using the command k3s kubectl get function. No config file was created in the ~/.kube directory on installing kubeless so I created a file named config manually and pasted the contents of k3s kubectl config view in it. apiVersion: v1 clusters:

  • cluster: certificate-authority-data: DATA+OMITTED server: https://localhost:6443 name: default contexts:
  • context: cluster: default user: default name: default current-context: default kind: Config preferences: {} users:
  • name: default user: password: 9bc556ea8906dc556b6756852cf168d4 username: admin

rmodpur avatar Jun 04 '19 04:06 rmodpur

so were you able to make the kubeless CLI work creating the file ~/.kube/config with that information?

andresmgot avatar Jun 04 '19 17:06 andresmgot

No, the kubeless cli is still not working. I'm getting the same error

rmodpur avatar Jun 05 '19 13:06 rmodpur

I have the same problem. Don't know how to resolve.

chen0031 avatar Jun 30 '19 12:06 chen0031

This is due to incorrect parameters in ~/.kube/config. Instead of using the output of kubectl config view, which omits the CA data, as you can see in the pasted file, use kubectl config view --flatten --minify, which will include the CA data. So kubectl config view --flatten --minify > ~/.kube/config will work. Or in the OPs case k3s kubectl config view --flatten --minify > ~/.kube/config.

spikyjt avatar Feb 22 '20 20:02 spikyjt