How to setup Grafana on Kubernetes cluster using helm chart

Shubham Khairnar
3 min readNov 24, 2020

--

Grafana on kubernetes cluster

Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. create, explore, and share dashboards with your team and foster a data driven culture.

I’m curious to read more!

We are now going to install Grafana using helm chart. for this, we are primarily using the Grafana defaults, but we are overriding several parameters. As with Prometheus, we are setting the storage class to gp2, admin password, configuring the datasource to point to Prometheus and MySQL, persisting dashboards and creating an external load balancer for the service.

Pre-requisite:

1) A kubernetes cluster up and running with kubectl setup on your workstation:

How to setup? 🤔, Please refer:

AWS EKS https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html

Google Cloudhttps://humanitec.com/blog/how-to-set-up-a-kubernetes-cluster-on-gcp

2) Connect to the cluster:

AWS EKShttps://aws.amazon.com/premiumsupport/knowledge-center/eks-cluster-connection/

Google Cloud https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl

Let’s get started:

Step-1:

Clone the below repositories:

Repo1: git clone https://github.com/helm/charts.git

Repo2: git clone https://github.com/ShubhamKhairnar/monitoring.git

Step-2:

After cloning Repo1; move to charts/stable/grafana folder

Step-3:

After cloning Repo2; Copy grafana.yaml and values.yaml to charts/stable/grafana folder.

Step-4:

Note: Please make necessary changes to grafana.yaml for datasource and values.yaml, if required.

Step-5:

Let’s deploy the work! 🤩

Create namespace named grafana:

kubectl create namespace grafana

Step-6:

Then, move to /charts/stable/ folder, and fire below command:

helm install grafana

— values grafana/values.yaml \

— namespace grafana \

— set persistence.storageClassName=”gp2" \

— set persistence.enabled=true \

— set adminPassword=’PASSWORD’ \

— values grafana/grafana.yaml \

— set service.type=LoadBalancer \

grafana/

Woooh!! Deployment is done!! isn’t it the simplest method to deploy?😎

I KNOW , it is! 😛

Step-7:

Check if everything is working fine by:

kubectl get all -n grafana

you would see something similar to following:

Grafana using Helm chart

Step-8:

Grab the external IP and shoot it over the browser and voilaa!! 🥳🥳

you have your brand new Grafana UI showing up!

Grafana UI

Step-9:

Login with admin credentials for the start, Username as admin and Password as which you had set in while shooting command.

After successful login, you can check moving to datasource tab from left panel, you will find datasource configured.

Datasource

You are free bird now!! create those astonishing and extremely eye-catching dashboards which will really help you to monitor your requirements.

All the best!! 😇

Thanks for being there with me till end of this article on How to Setup Grafana On Kubernetes cluster using helm chart, remember to Clap, Comment and Subscribe. 🥳

--

--

Shubham Khairnar
Shubham Khairnar

Written by Shubham Khairnar

AWS Certified Developer | DevOps Engineer at Citiustech | Photographer | Learner