This article is the third one of the series dedicated to Flagger. In a nutshell, Flagger is a progressive delivery tool that automates the release process for applications running on Kubernetes. It reduces the risk of introducing a new software version in production by gradually shifting traffic to the new version while measuring metrics and running conformance tests.
Make sure you have a local Kubernetes cluster running with the service mesh Istio. If you don’t, read the first article: Flagger – Get Started with Istio and Kubernetes. You also need to be familiar with Flagger and MHS, you will find all details in the second article: Flagger – Canary deployments on Kubernetes.
In this third hands-on guide, we will focus on the installation of Grafana for Flagger and how you can monitor your Canary deployments without having to use Kubernetes (i.e. Kube dashboard or
kubectl command line tool).
This is a hands-on guide and can be followed step by step on MacOS. It will require some adjustments if you are using a Windows or Linux PC. It is important to note that this article will not go into details and only grasp the concepts & technologies so if you are not familiar with Docker, Kubernetes, Helm or Istio, I strongly advise you to check some documentation yourself before continuing reading.
Flagger provides a Grafana dashboard out of the box to monitor all the canary deployments inside your cluster.
Let’s install Grafana by running this single command. We install Grafana in the namespace
--set url=http://prometheus:9090 \
--set user=admin \
Reference: Flagger monitoring
Flagger depends on Istio telemetry and Prometheus (in that case, we assume Istio is installed in the
After a few seconds, you should get a message confirming that Grafana for Flagger has been installed. From the Kube dashboard, verify that the Flagger Grafana pod is running in the
To expose Grafana, run:
So you can access it with your browser at http://localhost:3000/d/flagger-istio/istio-canary. Use the login and password you specified before (
Note that as we use Istio, we use the Istio Canary dashboard. There are other dashboards available as Flagger is compatible with other service meshes.
Running the Canary deployments
If you have followed the previous article, make sure you select
application for the Namespace and associate
mhs-primary to Primary and
mhs to Canary.
Then, you can try again the different experiments we did in the previous article and monitor the Grafana dashboard at the same time, especially:
- Canary deployment – Experiment 1 – Healthy MHS version 1.1.2
- Canary deployment – Experiment 2 – Faulty MHS 1.1.1
You can take a look at this screenshot I took during Experiment 1 when the canary release was successful and the new version rolled out. I annotated it and added explanations, so it’s easier to understand the graphs. Just click to zoom.
And this is a similar screenshot for Experiment 2 when the canary release did not succeed and the new version was not rolled out.
Congratulations, you’ve come to the end of this third tutorial!
You can delete the MHS application and its namespace. We can also remove Istio and Flagger because this was the last article of the series.
You can also stop the Kubernetes cluster by unchecking the box and restarting Docker Desktop.