Skip to content

How to Set Up Loki, Grafana, and Prometheus

This page is a short setup reference for a common monitoring stack.

Prerequisites

  • Install Helm.
  • Have a Kubernetes cluster available.
  • Make sure you can reach the cluster with kubectl.

Core steps

  1. Install the Prometheus Operator.
  2. Install Loki.
  3. Expose Grafana locally or through Minikube.
  4. Retrieve the Grafana credentials from the monitoring namespace.
  5. Install Fluentd if you want log shipping.

Example commands

helm install prom-op stable/prometheus-operator --namespace monitoring \
  --set prometheus.service.type=NodePort \
  --set grafana.service.type=NodePort \
  --set commonLabels.prometheus=prom-op \
  --set prometheus.prometheusSpec.serviceMonitorSelector.matchLabels.prometheus=prom-op
kubectl get secret --namespace monitoring prom-op-grafana -o yaml