nordvpn

Grafana Dashboard for Kubernetes Deployment

In this article, I will show you how you can create a grafana dashboard for Kubernetes Deployment. I am using Prometheus-operator and it is really good if you want to monitor your Kubernetes cluster. So, let’s get started.

I have installed Prometheus-operator using helm with the official helm chart.

https://github.com/helm/charts/tree/master/stable/prometheus-operator

Grafana Dashboard for Kubernetes Deployment

There are 2 metrics that you can use to monitor the pods deployments on Kubernetes using Prometheus.

kube_deployment_spec_replicas The number of desired pods for a deployment. kube-state-metrics
kube_deployment_status_replicas The number of replicas per deployment. kube-state-metrics

So let’s create this graph in Grafana.

Grafana Dashboard for Kubernetes Deployment

 

Create a new Dashboard and create 2 variable namespace and deployment. We are creating this variable so we can filter the pods easily.

  1. Create a variable called namespace and add the following query.

label_values(kube_deployment_status_replicas_available, namespace)

Grafana Dashboard for Kubernetes Deployment

2. Create another variable called deployment.

label_values(kube_deployment_status_replicas_available, deployment)

Grafana Dashboard for Kubernetes Deployment

Select visualization as Single stat.

Grafana Dashboard Visualization

After selecting the Visualization and add the following query and name it as Desired.

sum(kube_deployment_spec_replicas{namespace="$namespace",deployment="$deployment"})

Dashboard for Kubernetes

Similarly, create another graph with the following queries.

Unavailable

sum(kube_deployment_status_replicas_unavailable{namespace="$namespace",deployment="$deployment"})

Updated

sum(kube_deployment_status_replicas_updated{namespace="$namespace",deployment="$deployment"})>/code>

Metadata Generation

sum(kube_deployment_metadata_generation{namespace="$namespace",deployment="$deployment"})

Dashboard for Kubernetes Deployment

Leave a Reply

Your email address will not be published.


*



The reCAPTCHA verification period has expired. Please reload the page.

48-Hour Flash Sale! Courses from just $10.99