You can install OpenFaaS on kubernetes using two ways
1. Using `faas-netes` repository
2. Using Helm
$ git clone https://github.com/openfaas/faas-netes.git && cd faas-netes
$ kubectl apply -f namespaces.yml
$ kubectl apply -f ./yaml
$ kubectl delete -f ./yaml
Helm is a package manager for Kubernetes
$ brew install kubernetes-helm
$ kubectl -n kube-system create sa tiller
$ kubectl create clusterrolebinding tiller-cluster-rule \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:tiller
$ helm init --skip-refresh --upgrade --service-account tiller
$ kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
$ password=$(head -c 12 /dev/urandom | shasum | cut -d' ' -f1)
$ kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password=$password
$ helm repo add openfaas https://openfaas.github.io/faas-netes/
$ helm upgrade openfaas --install openfaas/openfaas \
--namespace openfaas \
--set functionNamespace=openfaas-fn \
--set serviceType=LoadBalancer \
--set basic_auth=true
$ brew install kubernetes-helm
$ kubectl -n kube-system create sa tiller
$ kubectl create clusterrolebinding tiller-cluster-rule \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:tiller
$ helm init --skip-refresh --upgrade --service-account tiller
$ kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
Delete already existing basic auth credentials from openfaas namespace
$ kubectl delete secret basic-auth -n openfaas
$ password=$(head -c 12 /dev/urandom | shasum | cut -d' ' -f1)
$ kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password=$password
$ helm repo add openfaas https://openfaas.github.io/faas-netes/
$ helm upgrade openfaas --install openfaas/openfaas \
--namespace openfaas \
--set functionNamespace=openfaas-fn \
--set serviceType=LoadBalancer \
--set basic_auth=true \
--set operator.create=true
$ kubectl get all -n openfaas
$ kubectl get functions -n openfaas-fn
$ kubectl annotate functions figlet test=test -n openfaas-fn
$ kubectl describe functions figlet -n openfaas-fn
$ kubectl delete functions figlet -n openfaas-fn
$ faas-cli login --username=admin --password=$password
$ faas-cli new kube-demo --lang=python --prefix=viveksyngh
$ faas-cli build -f kube-demo.yml
$ faas-cli push -f kube-demo.yml
$ faas-cli deploy -f kube-demo.yml
$ echo -n "Hello World!" | faas-cli invoke kube-demo
$ faas-cli invoke kube-demo --async -H "X-Callback-Url=http://requestbin.fullcontact.com/122nj181"
$ faas-cli up -f kube-demo.yml
$ helm delete --purge openfaas
$ kubectl port-forward svc/prometheus 9090:9090 -n openfaas
$ kubectl -n openfaas run \
--image=stefanprodan/faas-grafana:4.6.3 \
--port=3000 \
grafana
$ kubectl -n openfaas expose deployment grafana \
--type=NodePort \
--name=grafana
$ kubectl port-forward deployment/grafana 3000:3000 -n openfaas
$ while [ true ]; do curl -X POST http://127.0.0.1:8080/function/figlet; done;