apiVersion: apps/v1 kind: Deployment metadata: name: loki namespace: monitoring labels: app: loki spec: replicas: 1 selector: matchLabels: app: loki template: metadata: labels: app: loki spec: securityContext: fsGroup: 10001 runAsGroup: 10001 runAsNonRoot: true runAsUser: 10001 containers: - name: loki image: grafana/loki:2.9.2 args: - "-config.file=/etc/loki/loki.yaml" ports: - name: http containerPort: 3100 protocol: TCP - name: grpc containerPort: 9096 protocol: TCP resources: requests: memory: "256Mi" cpu: "100m" limits: memory: "512Mi" cpu: "300m" volumeMounts: - name: config mountPath: /etc/loki - name: storage mountPath: /loki livenessProbe: httpGet: path: /ready port: http initialDelaySeconds: 45 periodSeconds: 10 readinessProbe: httpGet: path: /ready port: http initialDelaySeconds: 45 periodSeconds: 10 volumes: - name: config configMap: name: loki-config - name: storage emptyDir: {} # For production, replace emptyDir with PVC: # - name: storage # persistentVolumeClaim: # claimName: loki-storage