Observability stack - Loki for logs, Grafana for visualization, Prometheus for metrics, and Grafana Alloy for log collection (alternative to deprecated Promtail).
DOCS: https://rishang.github.io/helm-chart/loki-stack/introduction
This Helm chart deploys a complete observability stack on Kubernetes, providing:
- Loki: Log aggregation system for storing and querying logs
- Grafana: Visualization and dashboards for logs and metrics
- Prometheus: Metrics collection and monitoring via kube-prometheus-stack
- Grafana Alloy: Modern log collection agent (replaces deprecated Promtail)
- Kubernetes 1.22+
- Helm 3.0+
- Persistent storage (optional, but recommended for production)
helm repo add common-charts https://rishang.github.io/helm-chart/charts
helm repo updatehelm install loki-stack common-charts/loki-stack --namespace monitoring --create-namespacehelm install loki-stack . --namespace monitoring --create-namespace --values custom-values.yaml| Parameter | Description | Default |
|---|---|---|
loki.enabled |
Enable Loki log aggregation | true |
loki.deploymentMode |
Loki deployment mode | SingleBinary |
loki.singleBinary.persistence.enabled |
Enable persistent storage for Loki | false |
alloy.enabled |
Enable Grafana Alloy log collector | true |
kube-prometheus-stack.enabled |
Enable Prometheus and Grafana | true |
kube-prometheus-stack.grafana.enabled |
Enable Grafana dashboard | true |
loki:
singleBinary:
persistence:
enabled: true
size: 10Gi
storageClass: standard# Disable Prometheus stack, keep only Loki and Alloy
kube-prometheus-stack:
enabled: falsePort-forward to access Grafana:
kubectl port-forward -n monitoring svc/loki-stack-grafana 3000:80Default credentials:
- Username:
admin - Password: Run
kubectl get secret -n monitoring loki-stack-grafana -o jsonpath="{.data.admin-password}" | base64 --decode
Port-forward to access Loki directly:
kubectl port-forward -n monitoring svc/loki-stack-loki 3100:3100Query logs: http://localhost:3100/loki/api/v1/query
This chart deploys:
- Loki (SingleBinary mode): Stores and indexes logs
- Grafana Alloy (DaemonSet): Collects logs from
/var/log/podson each node - Grafana: Provides UI for log exploration and visualization
- Prometheus: Collects metrics from Kubernetes and applications
- Alertmanager: Handles alerts from Prometheus
Grafana Alloy is configured to:
- Mount
/var/logfrom each node - Discover and tail logs from
/var/log/pods/*/*/*.log - Parse Kubernetes metadata (namespace, pod, container)
- Forward logs to Loki with proper labels
helm upgrade loki-stack . --namespace monitoring --values custom-values.yamlhelm uninstall loki-stack --namespace monitoringNote: PersistentVolumeClaims are not automatically deleted. Remove them manually if needed:
kubectl delete pvc -n monitoring -l app.kubernetes.io/instance=loki-stackGenerate manifest for validation:
helm template loki-stack . --namespace monitoring --values test/values.yaml > loki-stack-manifest.yamlThis chart depends on:
For issues and questions:
- Chart Issues: GitHub Issues
- Loki Documentation: https://grafana.com/docs/loki/
- Alloy Documentation: https://grafana.com/docs/alloy/