Helm Chart for Prometheus and Grafana on Kubernetes

Anshika Sharma
4 min readJul 24, 2021

--

Hello everyone,

As we know, monitoring is the major demand with each and every setup. Either in terms of server setup or setting up a cloud environment. So, in this article we are going to create a Helm Chart to create the Setup of Prometheus and Grafana.

But first we need to understand what are Helm Charts and how we gonna create them?🤔

For creating a setup, we need to fulfill multiple dependencies and configuration! but that is very manual kind of setup. Suppose we need to create a web server and for that first you need to install httpd , php ,……and so on. Here you will work on each of them one by one.

Do you think, that is a good approach ??🤔

In my opinion, its not !! So for this, we create packages….means the file/code that is capable of creating the whole setup. Although in redhat, package is as good as a Software.

Hence, HELM is a Package Manager Tool 📦. It is a 3rd party tool.

In this, we call packages as Charts! So we are going to create HELM charts. A chart can help us to download and Install the software as per the requirement.

Although there are many pre-created charts by the community for different-different uses, also we can create a customized one.

Helm Chart : Setup of Prometheus and Grafana on K8s

Pre-requisite for creating a Helm chart is:

  1. Kubernetes Cluster(here I gonna use minikube setup)
  2. Helm software

* for the setup of Helm, Please refer the link below: 👇

  1. After this setup, lets check the version of Helm
checking Helm Version

2. Create a directory, put the name same as your Helm Chart (say Prometheus_Grafana_on_kubernetes) and then go inside that directory.

creating directory

3. For creating the chart create a YAML file with name (Chart.yaml)that will be loaded when we start creating the Helm chart.

code of Chart.yaml:

Chart.yaml file

4. All the yml files for the further setup on kubernetes, we can put them in the templates folder.

creating templates directory
list of yml files for the setup

You can access all the code, on the GitHub repository below:

5. Now lets start the process of creating our Helm Chart, before that check for the existing pods or services on Kubernetes cluster

pods/services status on Kubernetes
Checking helm charts

So, no helm charts are there.

Create the helm chart using “helm install <chart-name> <directory/>

Chart created sucessfully
We can access the chart using helm list

6. Check for the services, installed or not?

Successfully created all deployments and services

7. Move to the Prometheus and Grafana Dashboard:

To get that, we need to use the minikube IP using command: “minikube ip

Minikube IP
Prometheus Dashboard
Grafana Dashboard

We can simply login and start using Grafana…😃

After the successful use you can delete it anytime and just in one go.

Successfully uninstalled the helm chart

Now it became very simple for us to create this setup just in one go, we can use this concept while automating the things.😁

Similarly, we can have any customized Helm Chart to make our work standardized, customized and easy to perform.

Stay tuned for more such interesting technical articles….😁😁

Till the time……..⏲️

Keep Sharing, Keep Learning..✨✨

--

--

Anshika Sharma
Anshika Sharma

Written by Anshika Sharma

I am a tech enthusiast, researcher and work for integrations. I love to explore and learn about the new technologies and their right concepts from its core.