Serverless Kubernetes Workshop with Kubeless, NATS, and Minio. In this workshop you will learn how to:
- Set up a Kubeless
- Creating functions using the
kubeless
CLI - Creating triggers for invoking functions
Tool | Version |
---|---|
Virtualbox | v5.2.18 |
Minikube | v0.29.0 |
kubectl | v1.11.3 |
Helm | v2.11.0 |
Kubeless | v1.0.0-alpha.8 |
Download the Minikube utility:
$ minikube start --memory 4096 --disk-size 40g --kubernetes-version v1.11.3 -v 4
$ minikube addons enable ingress
Verify the setup by running the following commands:
$ minikube status
$ kubectl version
$ kubectl cluster-info
$ kubectl get nodes
Set up the required ingress hostnames for this workshop:
$ make add-etc-hosts
Manual /etc/hosts install
$ export MINIKUBE_IP=$(minikube ip)
$ sudo sh -c "echo \"\n\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP minio.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP nats.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP kubeless.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP promethues.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP grafana.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP function-python.minikube\" >> /etc/hosts"
$ sudo sh -c "echo \"$MINIKUBE_IP function-node.minikube\" >> /etc/hosts"
Download the Helm client CLI:
Install the Helm server component:
$ helm init --upgrade
Verify that Helm is set up correctly:
$ helm version
Download the Kubeless client CLI:
Install the Kubeless control pane:
$ make install-kubeless
Manual install with Helm
$ helm upgrade kubeless ./charts/kubeless \
--namespace kubeless \
--values config/kubeless.yaml \
--install \
--wait \
--timeout 600 \
--force
Verify the Kubeless installation:
$ kubeless get-server-config
Kubeless has native integration with Prometheus.
$ make install-prometheus
$ make install-grafana
Manual install with Helm
$ export MINIKUBE_IP=$(minikube ip)
$ helm upgrade prometheus stable/prometheus \
--version 7.2.0 \
--namespace monitoring \
--values config/prometheus.yaml \
--set server.ingress.hosts[1]=prometheus.${MINIKUBE_IP}.nip.io \
--install \
--wait \
--timeout 600 \
--force
$ helm upgrade grafana stable/grafana \
--version 1.16.0 \
--namespace monitoring \
--values config/grafana.yaml \
--set ingress.hosts[1]=grafana.${MINIKUBE_IP}.nip.io \
--install \
--wait \
--timeout 600 \
--force
NATS is a simple, high performance open source messaging system for cloud native applications, IoT messaging, and microservices architectures. Kubeless has native support for NATS in addition to Kafka.
Install the NATS server:
$ make install-nats
Manual install with Helm
$ helm upgrade nats stable/nats \
--namespace nats \
--values config/nats.yaml \
--install \
--wait \
--timeout 600 \
--force
Minio is a high performance distributed object storage server, designed for large-scale private cloud infrastructure.
Download the Minio client CLI:
Architecture | Download |
---|---|
Mac | https://dl.minio.io/client/mc/release/darwin-amd64/mc |
Linux | https://dl.minio.io/client/mc/release/linux-amd64/mc |
Windows | https://dl.minio.io/client/mc/release/windows-amd64/mc.exe |
Install the Minio server:
$ make install-minio
Manual install with Helm
$ helm upgrade minio stable/minio \
--namespace minio \
--values config/minio.yaml \
--install \
--wait \
--timeout 600 \
--force
Set up the mc
client command line utility to communicate with the Minio
installation.
$ make configure-minio-client
Manual configure Minio client
$ export MINIKUBE_IP=$(minikube ip)
$ mc config host add local \
http://${MINIKUBE_IP}:30900 \
AKIAIOSFODNN7EXAMPLE \
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \
--api "S3v4" \
--lookup "path"
$ mc ls --recursive local
You can use the Kubless UI to view and manage functions by going to kubeless.minikube in your browser.
You can use the Minio UI to view and manage buckets by going to minio.minikube in your browser.