Flagger – Monitor your Canary deployments with Grafana
Fabian Piau | Sunday June 28th, 2020 - 06:07 PMOctober, 17th, 2020 : Use newer versions (Helm 3, Kube 18, Istio 1.7, Flagger 1.2).
This is the third article in our 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 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.
Installing Grafana
Flagger provides a Grafana dashboard out of the box to monitor all the canary deployments inside your cluster.
Let’s install Grafana in the namespace istio-system
with a single command:
--namespace=istio-system \
--set url=http://prometheus:9090 \
--set user=admin \
--set password=changeme
Reference: Flagger monitoring
Flagger depends on Istio telemetry and Prometheus (I’ve assumed Istio is installed in theistio-system
namespace).
After a few seconds, you should get a message confirming that Grafana for Flagger has been installed. From the Kubernetes dashboard, verify that the Flagger Grafana pod is running in istio-system
.
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 (admin
/ changeme
).
Note that as we use Istio, we use the Istio Canary dashboard. Flagger is compatible with other service meshes and there are other dashboards available.
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 try again the different experiments we did in the previous article and monitor the Grafana dashboard at the same time, especially:
- Experiment 1 – MHS v1.1.2 successful deployment
- Experiment 2 – MHS v1.1.3 faulty deployment
Results
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.
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!
Cleaning up resources
You can delete the MHS application and its namespace. We can also remove Istio and Flagger because this is the last article of the series.
You can also stop the Kubernetes cluster by unchecking the box and restarting Docker Desktop.
Recent Comments