-
A running 1.7 Kubernetes cluster with at least 4GB of memory. These instructions assume minikube for now.
minikube start --cpus=4 --memory=4096 --disk-size=64g
You can install the system using a Helm chart or by manually building and deploying the components.
Sk8s offers a Helm Chart for deploying the FaaS and its required services to a Kubernetes Cluster. The following instructions cover how to initialize Helm and install Sk8s FaaS on the Minikube cluster.
Helm is comprised of 2 components: one is the client (Helm) the other is the server component (Tiller). The Helm client is run on your local machine and can be installed using the instructions found here: https://github.com/kubernetes/helm/blob/master/README.md#install
Once you have Helm client installed you can install the server component using:
helm init
|
Note
|
To verify that the Tiller pod has started execute the following command: kubectl get pod --namespace kube-system and you should see the tiller pod running.
|
Run the following commands to add the sk8s-incubator repository:
helm repo add sk8s-incubator http://sk8s-incubator.cfapps.io helm repo update
Install the Sk8s Helm chart using the following command:
helm install --name demo sk8s-incubator/sk8s
You should see a number of resources get created in your Minikube. You can see them all using:
kubectl get all,jobs,functions,topics
To work with the demos and Metrics Dashboard you need a clone of the Sk8s repo:
git clone https://github.com/markfisher/sk8s.git
You can enable each dashboard by setting flags for the Helm release. For the Metrics Dashboard use
--set enable.metricsDashboard=true and for the Tracing Dashboard use --set enable.metricsDashboard=true.
These flags can be set when installing the chart or you can apply them during an upgrade operation. Here is an example of upgrading the release and enabling the Metrics Dashboard:
helm upgrade demo sk8s-incubator/sk8s --set enable.metricsDashboard=true
See how to use the dashboards and run some samples.
You need:
-
Git installed.
-
A Java 8 environment.
-
A working Go environment, with a clone of Eric Bottard’s customized fabric8io/kubernetes-model.
cd $(go env GOPATH) #defaults to ~/go git clone https://github.com/ericbottard/kubernetes-model src/github.com/fabric8io/kubernetes-model/
-
A clone of this repo.
git clone https://github.com/markfisher/sk8s.git
Create Function and Topic Custom Resource Definitions:
kubectl apply -f config/types
Point your Docker environment to the Docker environment running in minikube:
eval $(minikube docker-env)
kubectl apply -f config/prometheus kubectl apply -f config/grafana
kubectl apply -f config/zipkin
See how to use the dashboards and run some samples.
With the Sk8s FaaS running try some of the samples.
To access the Grafana Metrics Dashboard run the following from a terminal:
minikube service $(kubectl get svc -l component=grafana -o jsonpath='{.items[0].metadata.name}')
Once the app opens click on "Add data source" and enter the following:
Name: sk8s
Type: Prometheus
Url: http://demo-sk8s-prometheus:9090 [for Helm install this must match the service
name based on the name given to the release
which was "demo" in our case. For a manual
install use http://prometheus:9090]
Access: proxy
Once the sk8s data source is created select Dashboards - Import from the top left menu drop down.
Select Upload .json file and locate the sk8s-grafana.json that is in the root directory of the cloned sk8s repo.
Select sk8s for the Select a Prometheus data source option and click Import.
To access the Zipkin dashboard run the following from a terminal:
minikube service $(kubectl get svc -l component=zipkin -o jsonpath='{.items[0].metadata.name}')
When the dashboard opens, click on the Find a trace link on the top bar. Then select a component from the top-left drop down menu and click the Find Traces button.