Skip to content

Grafana Helm deployment

Grafana can be deployed on Kubernetes using the official community Helm charts^[400-devops-03-containerization-prometheus.md]. The following guide outlines the steps to install Grafana and configure it to access a Prometheus data source.

Prerequisites

A running Prometheus instance is required to serve as the data source^[400-devops-03-containerization-prometheus.md]. This is typically installed via the prometheus-community/prometheus chart^[400-devops-03-containerization-prometheus.md]. Once deployed, Prometheus exposes a service (usually prometheus-server) within the cluster, accessible via a ClusterIP (e.g., http://prometheus-server:80 or http://10.111.94.209:80)^[400-devops-03-containerization-prometheus.md].

Installation Steps

Add the official Grafana Helm repository and install the chart using the following commands^[400-devops-03-containerization-prometheus.md]:

[Helm](<./helm.md>) repo add [Grafana](<./grafana.md>) https://grafana.github.io/helm-charts
[Helm](<./helm.md>) repo update
[Helm](<./helm.md>) install [Grafana](<./grafana.md>) [Grafana](<./grafana.md>)/[Grafana](<./grafana.md>)

After installation, the Helm output provides instructions for accessing the Grafana UI^[400-devops-03-containerization-prometheus.md].

Access and Credentials

The Grafana server is exposed internally via a ClusterIP service (e.g., grafana.default.svc.cluster.local)^[400-devops-03-containerization-prometheus.md]. To access the UI from your local machine, you must use kubectl port-forward to target the deployed Grafana pod^[400-devops-03-containerization-prometheus.md].

The default login credentials are: * Username: admin * Password: Retrieved from the Kubernetes secret^[400-devops-03-containerization-prometheus.md].

To get the password, run: kubectl get secret --namespace default [Grafana](<./grafana.md>) -o jsonpath="{.data.admin-password}" | base64 --decode

Data Source Configuration

To visualize Metrics, you must add Prometheus as a data source in Grafana^[400-devops-03-containerization-prometheus.md].

  1. Navigate to the data source configuration settings in Grafana.
  2. Set the URL to the internal Prometheus service address (e.g., http://prometheus-server:80).

Once connected, you can import dashboards, such as ID 6417, to monitor Kubernetes metrics^[400-devops-03-containerization-prometheus.md]. Additional dashboards can be found in the Grafana Labs community collection^[400-devops-03-containerization-prometheus.md].

Sources

^[400-devops-03-containerization-prometheus.md]