lgtm-stack

by lucifer3618

Helm chartv0.1.3App 1.16.0Apache-2.0Verified publisher

A complete Kubernetes observability stack with Grafana, Mimir, Loki, Tempo, Alloy, and MinIO

About this chart

LGTM Stack Helm Chart

A production-ready, cloud-native observability stack for Kubernetes packaged as a single unified Helm chart. It brings together metrics, logs, distributed tracing, continuous telemetry collection, dashboards, database persistence, and local S3-compatible object storage.


Stack Components

ComponentRoleKubernetes ResourceDefault ImagePorts
GrafanaVisualization & DashboardsDeployment (1 replica)grafana/grafana:13.1.03000 (HTTP)
MimirLong-term Prometheus MetricsStatefulSet (2 replicas)grafana/mimir:3.2.09009 (HTTP)
LokiDistributed Log AggregationStatefulSet (2 replicas)grafana/loki:3.7.63100 (HTTP), 9095 (gRPC), 7946 (Memberlist)
TempoDistributed Tracing BackendStatefulSet (2 replicas)grafana/tempo:2.10.83200 (HTTP), 4317 (OTLP gRPC), 4318 (OTLP HTTP)
AlloyTelemetry Collector & AgentDaemonSet (1 per node)grafana/alloy:v1.18.112345 (Admin), 4317 (OTLP gRPC), 4318 (OTLP HTTP)
MinIOS3-compatible Object StorageStatefulSet (1 replica)minio/minio:RELEASE.2024-01-18T22-51-28Z9000 (S3 API), 9001 (Console)
PostgreSQLGrafana Session & State DBCloudNativePG Cluster (2 instances)Managed by CNPG5432 (PostgreSQL)

Architecture & Data Flow

flowchart TD
    subgraph Ingestion["1. Telemetry Ingestion (Nodes & Workloads)"]
        Apps["Kubernetes Applications / Pods"]
        Node["Host Nodes (kubelet, cAdvisor, kernel logs)"]
        Apps -- "OTLP Traces (4317/4318)\nPod Logs" --> Alloy["Grafana Alloy (DaemonSet)"]
        Node -- "Node Metrics\nk8s Workload Metrics" --> Alloy
    end

    subgraph Storage["2. Storage & Backends"]
        Alloy -- "Prometheus Remote Write" --> Mimir["Mimir (StatefulSet)"]
        Alloy -- "Push API" --> Loki["Loki (StatefulSet)"]
        Alloy -- "OTLP gRPC / HTTP" --> Tempo["Tempo (StatefulSet)"]
        
        Mimir -- "Chunks & Blocks" --> MinIO[("MinIO S3\n(mimir-data)")]
        Loki -- "Chunks & Indexes" --> MinIO[("MinIO S3\n(loki-data)")]
        Tempo -- "Trace Blocks" --> MinIO[("MinIO S3\n(tempo-data)")]
    end

    subgraph Persistence["3. Database Persistence"]
        CNPG[("CloudNativePG PostgreSQL\nCluster (2 instances)")]
    end

    subgraph Visualization["4. Presentation & Routing"]
        Ingress["Nginx Ingress Controller\n(TLS Termination)"]
        Grafana["Grafana (Deployment)"]
        
        Ingress -->|"grafana.local"| Grafana
        Ingress -->|"minio.local"| MinIO
        
        Grafana -->|"Mimir Datasource"| Mimir
        Grafana -->|"Loki Datasource"| Loki
        Grafana -->|"Tempo Datasource"| Tempo
        Grafana -->|"State & Dashboards"| CNPG
    end

Dependencies & Prerequisites

Before deploying this chart, ensure the following prerequisites are met in your Kubernetes cluster:

  1. Kubernetes Version: v1.24+
  2. Helm Version: v3.8+
  3. CloudNativePG Operator: The chart provisions a CloudNativePG Cluster resource for PostgreSQL persistence, but requires the CloudNativePG operator and its CRDs to be pre-installed in your cluster:
    kubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-1.22.1.yaml
    
  4. Nginx Ingress Controller: Required for external access and host-based routing (grafana.local, minio.local).
  5. StorageClass: Defaults to longhorn-1replica. You can override this with any existing StorageClass (e.g. gp3, standard, local-path) via values.yaml.
  6. Local DNS Resolution: For local/lab testing, map the configured ingress hosts to your Ingress controller's external IP in /etc/hosts (Linux/macOS) or C:\Windows\System32\drivers\etc\hosts (Windows):
    <INGRESS_CONTROLLER_IP>  grafana.local minio.local
    

Running Process & Lifecycle

When installing or upgrading the Helm chart, the following sequential process takes place:

[1. Chart Installation]
   │
   ├──► [Helm Hook Job: minio-create-bucket]
   │       └── Initializes MinIO and automatically provisions:
   │             - loki-data
   │             - mimir-data
   │             - tempo-data
   │
   ├──► [CloudNativePG Cluster Resource]
   │       └── CNPG Operator reconciles PostgreSQL instances and creates internal RW/RO services.
   │
   ├──► [StatefulSets Provisioning]
   │       └── MinIO, Mimir, Loki, and Tempo claim PVC storage and connect to object storage.
   │
   ├──► [Alloy DaemonSet Deployment]
   │       └── Runs on every node:
   │             - Tails Kubernetes pod logs from /var/log/pods
   │             - Discovers annotated pods and Prometheus endpoints
   │             - Listens on 4317/4318 for app traces and forwards to Tempo
   │
   ├──► [Grafana Deployment & ConfigMaps]
   │       └── Auto-configures:
   │             - Mimir, Loki, Tempo datasources
   │             - Pre-loaded Dashboards from dashboards/ folder
   │             - Connection to CloudNativePG PostgreSQL
   │
   └──► [Ingress & TLS Secrets]
           └── Exposes Grafana and MinIO Console via Nginx Ingress.

Pre-Packaged Dashboards

Grafana is provisioned with out-of-the-box dashboards mounted via ConfigMaps from the dashboards/ directory:

  1. Platform Observability Overview (dashboards/platform-observability-overview-v1.json): High-level platform health, aggregate ingestion rates, and service availability.
  2. Kubernetes Cluster Overview (dashboards/k8s-cluster-overview-v1.json): Cluster-wide CPU, memory, filesystem, and network utilization.
  3. Kubernetes Node Infrastructure (dashboards/k8s-node-infra-v1.json): Detailed per-node compute, disk I/O, pressure stalls, and container runtimes.
  4. Kubernetes Workload Health (dashboards/k8s-workload-health-v1.json): Pod restarts, OOMKilled events, CPU/Memory throttling, and pod status.
  5. Kubernetes Capacity Planning (dashboards/k8s-capacity-planning-v1.json): Cluster allocation ratios, resource requests vs usage trends, and headroom estimation.
  6. Loki Logs Operations (dashboards/loki-logs-operations-v1.json): Operational log stream exploration, error frequency, and volume analytics.

Quick Start

1. Add the Helm Repository

helm repo add lucifer3618 https://lucifer3618.github.io/lgtm-stack/
helm repo update

2. Install the Chart

# Create namespace and install
helm install lgtm-stack lucifer3618/lgtm-stack \
  --namespace monitoring \
  --create-namespace

3. Verify Deployment

# Check all running pods
kubectl get pods -n monitoring

# Check services and ingress
kubectl get svc,ingress -n monitoring

# Check CloudNativePG cluster status
kubectl get cluster.postgresql.cnpg.io -n monitoring

Configuration Reference

The following table lists the configurable parameters in values.yaml:

Common & TLS Settings

ParameterDescriptionDefault
tls.enabledEnable unified TLS secret generationtrue
tls.autoGenerateSecretAutomatically create Secret from cert and keytrue
tls.secretNameName of the Kubernetes TLS secret"monitoring-tls-secret"
tls.certPublic certificate chain in PEM format""
tls.keyPrivate key in PEM format""

MinIO Object Storage

ParameterDescriptionDefault
minio.image.repositoryMinIO container image"minio/minio"
minio.image.tagMinIO image tag"RELEASE.2024-01-18T22-51-28Z"
minio.replicasNumber of MinIO replicas1
minio.accessKeyIdRoot admin access key ID"admin"
minio.secretAccessKeyRoot admin secret access key"admin123"
minio.persistence.storageClassNameStorageClass for MinIO data"longhorn-1replica"
minio.persistence.sizePVC size for MinIO"1Gi"
minio.ingress.enabledEnable Ingress for MinIO Web Consoletrue
minio.ingress.hostHostname for MinIO Console"minio.local"

Loki (Logs)

ParameterDescriptionDefault
loki.image.repositoryLoki container image"grafana/loki"
loki.image.tagLoki image tag"3.7.6"
loki.replicasNumber of Loki cluster replicas2
loki.s3.bucketNameS3 bucket for Loki chunks/indexes"loki-data"
loki.pvc.storageClassNameStorageClass for Loki PVC"longhorn-1replica"
loki.pvc.sizeStorage volume size per replica"1Gi"

Mimir (Metrics)

ParameterDescriptionDefault
mimir.image.repositoryMimir container image"grafana/mimir"
mimir.image.tagMimir image tag"3.2.0"
mimir.replicasNumber of Mimir cluster replicas2
mimir.s3.bucketNameS3 bucket for metric blocks"mimir-data"
mimir.pvc.storageClassNameStorageClass for Mimir PVC"longhorn-1replica"
mimir.pvc.sizeStorage volume size per replica"1Gi"

Tempo (Traces)

ParameterDescriptionDefault
tempo.image.repositoryTempo container image"grafana/tempo"
tempo.image.tagTempo image tag"2.10.8"
tempo.replicasNumber of Tempo cluster replicas2
tempo.s3.bucketNameS3 bucket for trace data"tempo-data"
tempo.storage.classNameStorageClass for Tempo PVC"longhorn-1replica"
tempo.storage.sizeStorage volume size per replica"1Gi"

Alloy (Collector)

ParameterDescriptionDefault
alloy.image.repositoryAlloy container image repository"grafana/alloy"
alloy.image.tagAlloy image tag"v1.18.1"
alloy.image.pullPolicyImage pull policy"IfNotPresent"

Grafana & Database

ParameterDescriptionDefault
grafana.replicasGrafana deployment replicas1
grafana.image.repositoryGrafana container image"grafana/grafana"
grafana.image.tagGrafana container image tag"13.1.0"
grafana.adminUserInitial admin account username"admin"
grafana.adminPasswordInitial admin account password"admin123"
grafana.ingress.hostIngress hostname for Grafana"grafana.local"
database.clusterNameCloudNativePG cluster name"grafana-db-cluster"
database.instancesPostgreSQL replica instances2
database.storageSizeStorage volume size per PostgreSQL node"1Gi"
database.storageClassNameStorageClass for PostgreSQL"longhorn-1replica"

Security & Best Practices

[!WARNING] The default credentials in values.yaml (admin123) are provided for testing and demonstration only.

For production or shared environments:

  1. Provide custom values via an external secrets file or override parameters using --set:
    helm upgrade --install lgtm-stack lucifer3618/lgtm-stack \
      -n monitoring \
      -f values.production.yaml
    
  2. Disable tls.autoGenerateSecret and reference a cert-manager managed TLS secret using tls.secretName.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Deploy lgtm-stack with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has lgtm-stack on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlgtm-stack is pinned at v0.1.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply