vmware-archive / kubeless

Kubernetes Native Serverless Framework
https://kubeless.io
Apache License 2.0
6.86k stars 754 forks source link

unable to use kubeless cli #1043

Open rmodpur opened 5 years ago

rmodpur commented 5 years ago

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:

andresmgot commented 5 years ago

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?

rmodpur commented 5 years ago

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:

andresmgot commented 5 years ago

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

rmodpur commented 5 years ago

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

chen0031 commented 5 years ago

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

spikyjt commented 4 years ago

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.