apiVersion: apps/v1 kind: Deployment metadata: name: grafana-stack labels: app: grafana-stack spec: replicas: 1 selector: matchLabels: app: grafana-stack template: metadata: labels: app: grafana-stack spec: containers: - name: grafana image: docker.io/grafana/grafana:latest ports: - containerPort: 3000 hostPort: 3000 hostIP: 127.0.0.1 protocol: TCP volumeMounts: - mountPath: /etc/grafana/grafana.ini:Z name: grafana-config - mountPath: /var/lib/grafana:Z name: grafana - name: loki image: docker.io/grafana/loki:latest args: - --config.file=/mnt/config/loki-local-config.yaml securityContext: runAsUser: 1000 ports: - containerPort: 3100 hostPort: 3100 hostIP: 127.0.0.1 protocol: TCP - containerPort: 9096 hostPort: 9096 hostIP: 127.0.0.1 protocol: TCP volumeMounts: - mountPath: /tmp/loki:Z name: loki - mountPath: /mnt/config/loki-local-config.yaml:Z name: loki-config - name: prometheus image: docker.io/prom/prometheus:latest ports: - containerPort: 9090 hostPort: 9090 hostIP: 127.0.0.1 protocol: TCP volumeMounts: - mountPath: /tmp/prometheus:Z name: prometheus - mountPath: /etc/prometheus/prometheus.yml name: prometheus-config volumes: - hostPath: path: ./grafana/data type: Directory name: grafana - hostPath: path: ./grafana/grafana.ini type: File name: grafana-config - hostPath: path: ./loki/data type: Directory name: loki - hostPath: path: ./loki/loki-local-config.yaml type: File name: loki-config - hostPath: path: ./prometheus/data type: Directory name: prometheus - hostPath: path: ./prometheus/prometheus.yml type: File name: prometheus-config