This commit is contained in:
2026-04-06 21:36:15 +07:00
commit 35874bf520
29 changed files with 1625 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "loki-stack.fullname" . }}-grafana
labels:
{{- include "loki-stack.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
spec:
replicas: {{ .Values.grafana.replicas }}
selector:
matchLabels:
{{- include "loki-stack.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: grafana
template:
metadata:
labels:
{{- include "loki-stack.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: grafana
spec:
securityContext:
fsGroup: 472
containers:
- name: grafana
image: {{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}
env:
- name: GF_SECURITY_ADMIN_USER
value: {{ .Values.grafana.adminUser }}
- name: GF_SECURITY_ADMIN_PASSWORD
value: {{ .Values.grafana.adminPassword }}
- name: GF_AUTH_ANONYMOUS_ENABLED
value: {{ .Values.grafana.anonymousAccess | quote }}
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: Admin
ports:
- name: http
containerPort: 3000
readinessProbe:
httpGet:
path: /api/health
port: http
initialDelaySeconds: 10
periodSeconds: 10
volumeMounts:
- name: datasources
mountPath: /etc/grafana/provisioning/datasources
- name: data
mountPath: /var/lib/grafana
resources:
{{- toYaml .Values.grafana.resources | nindent 12 }}
volumes:
- name: datasources
configMap:
name: {{ include "loki-stack.fullname" . }}-grafana-datasources
- name: data
persistentVolumeClaim:
claimName: {{ include "loki-stack.fullname" . }}-grafana