Kubeless Installation¶
Follow these instructions, i.e.
# Create the kubeless namespace using kubectl:
$ kubectl create ns kubeless
# Set RELEASE:
$ export RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4)
# Create the Kubeless controller:
$ kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml
deployment "kubeless-controller-manager" created
serviceaccount "controller-acct" created
clusterrole "kubeless-controller-deployer" created
clusterrolebinding "kubeless-controller-deployer" created
.. warning:: note the option --validate=false, or else we get the error:
error: error validating "https://github.com/kubeless/kubeless/releases/download/v1.0.0-alpha.7/kubeless-v1.0.0-alpha.7.yaml": error validating data: ValidationError(CustomResourceDefinition): unknown field "description" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinition; if you choose to ignore these errors, turn validation off with --validate=false
# Check it is working:
$ kubectl get pods -n kubeless
NAME READY STATUS RESTARTS AGE
kubeless-controller-manager-7b9b6b9dd7-grscc 0/1 CreateContainerConfigError 0 2m
$ kubectl get deployment -n kubeless
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
kubeless-controller-manager 1 1 1 0 4m
$ kubectl get customresourcedefinition NAME AGE
cronjobtriggers.kubeless.io 23s
functions.kubeless.io 23s
httptriggers.kubeless.io 23s
Clean up¶
You can delete the function and uninstall Kubeless:
$ kubectl delete -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml
kubeless client: certificate in .kube/config¶
There is an issue in the default ~/.kube/config file that kubeless client use to access kubernetes cluster. The certificate in certificate-authority-data is the base64-converted ca-certificate that you find on the master and worker nodes, file /etc/ssl/flannel/client-ca.pem:
$ juju ssh kubernetes-master/1 cat /etc/ssl/flannel/client-ca.pem | base64
LS0tLS1CRUd...FURS0tLS0t
However, the command run on the same file download on the client (e.g. on your PC) is different:
kubernetes@ba1-juju2cli-02:~$ cat .kube/client-ca.pem | base64
LS0tLS1CRUd...FURS0tLS0tCg==
(note the Cg==
missing on the first string!)
To make kubeless client work you have to add the string obtained on the client in .kube/config: certificate-authority-data!