Skip to main content

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.

ComponentDeployment TypeHelm Chart Source
LokiStatefulSetgrafana/loki-stack
PromtailDaemonSetgrafana/promtail
GrafanaDeploymentgrafana/grafana
MinIOStatefulSetbitnami/minio or minio/minio
IngressControllernginx/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​

ComponentCPUMemoryStorage
Promtail100–200m100–200Mi—
Loki Ingesters500m–1CPU1–2Gi50Gi PVC
Querier500m512Mi—
MinIO Node500m–1CPU1Gi100Gi per pod
Grafana300m512Mi10Gi PVC