Deployment Strategy
This section describes the deployment strategy for the Grafana Loki Stack on an on-premise Kubernetes cluster using Helm charts and persistent volumes.
1. Overview​
We use Helm for managing deployment lifecycle of each component. All components are deployed via helm upgrade --install
with customized values.yaml
files.
Component | Deployment Type | Helm Chart Source |
---|---|---|
Loki | StatefulSet | grafana/loki-stack |
Promtail | DaemonSet | grafana/promtail |
Grafana | Deployment | grafana/grafana |
MinIO | StatefulSet | bitnami/minio or minio/minio |
Ingress | Controller | nginx/nginx-ingress |
2. Deployment Steps​
🔹 Step 1: Add Helm Repos​
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
🔹 Step 2: Deploy MinIO (S3-compatible storage)​
helm install minio bitnami/minio \
--namespace logging \
--create-namespace \
-f minio-values.yaml
Example minio-values.yaml:
mode: distributed
replicas: 4
persistence:
enabled: true
size: 100Gi
resources:
requests:
memory: 512Mi
cpu: 250m
🔹 Step 3: Deploy Loki Stack​
helm upgrade --install loki grafana/loki-stack \
--namespace logging \
-f loki-values.yaml
Example loki-values.yaml:
loki:
storage:
type: 's3'
s3:
bucketnames: loki-data
endpoint: http://minio.logging.svc.cluster.local:9000
access_key_id: lokiadmin
secret_access_key: lokipassword
insecure: true
persistence:
enabled: true
size: 50Gi
storageClassName: "nfs" # or "cephfs"
schemaConfig:
configs:
- from: 2022-01-01
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: index_
period: 24h
promtail:
enabled: true
config:
clients:
- url: http://loki:3100/loki/api/v1/push
🔹 Step 4: Deploy Grafana​
helm upgrade --install grafana grafana/grafana \
--namespace logging \
-f grafana-values.yaml
Example grafana-values.yaml:
adminPassword: admin123
persistence:
enabled: true
size: 10Gi
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://loki:3100
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
hosts:
- grafana.example.local
3. Resource Recommendations​
Component | CPU | Memory | Storage |
---|---|---|---|
Promtail | 100–200m | 100–200Mi | — |
Loki Ingesters | 500m–1CPU | 1–2Gi | 50Gi PVC |
Querier | 500m | 512Mi | — |
MinIO Node | 500m–1CPU | 1Gi | 100Gi per pod |
Grafana | 300m | 512Mi | 10Gi PVC |