10. The demo setup (Kubernetes)

Github webhook code

Github analytics code

Figure 10.1. Github Webhook listens to HTTP calls and sends a message to Github Analytics



For the demo scenario we have two applications. Github Analytics and Github Webhook. Let’s imagine a case where Github is emitting events via HTTP. Github Webhook has an API that could register to such hooks and receive those messages. Once this happens Github Webhook sends a message by RabbitMQ to a channel. Github Analytics is listening to those messages and stores them in a MySQL database.

Figure 10.2. Github Analytics exposes metrics that are polled by Prometheus

demo metrics


Github Analytics has its KPIs (Key Performance Indicators) monitored. In the case of that application the KPI is number of issues.

Figure 10.3. Grafana alerts Slack over Prometheus metrics

demo alerting


Let’s assume that if we go below the threshold of X issues then an alert should be sent to Slack.

10.1 Deploying production applications to Minikube

In the real world scenario we wouldn’t want to automatically provision services like RabbitMQ, MySQL or Eureka each time we deploy a new application to production. Typically production is provisioned manually (using automated solutions). In our case, before you deploy to production you can provision the sc-pipelines-prod namespace using the k8s-helper.sh. Just call

$ ./k8s-helper.sh setup-prod-infra

10.2 Running Prometheus on Kubernetes

10.3 Running Grafana on Kubernetes