2023-08-10 15:29:04 +02:00

116 lines
3.4 KiB
YAML

{{- define "grafana.deploy" }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: grafana
name: grafana
spec:
selector:
matchLabels:
app.kubernetes.io/name: grafana
template:
metadata:
labels:
app.kubernetes.io/name: grafana
spec:
serviceAccount: grafana
serviceAccountName: grafana
initContainers:
- name: grafana-sc-datasources
env:
- name: METHOD
value: LIST
- name: LABEL
value: datasource
- name: LABEL_VALUE
value: "true"
- name: FOLDER
value: /etc/grafana/provisioning/datasources
- name: RESOURCE
value: secret
image: quay.io/kiwigrid/k8s-sidecar:1.25.0
resources:
limits:
cpu: 200m
memory: 128Mi
requests:
cpu: 50m
memory: 32Mi
volumeMounts:
- mountPath: /etc/grafana/provisioning/datasources
name: datasource-volume
containers:
- name: grafana-sc-dashboard
env:
- name: LABEL
value: dashboard
- name: LABEL_VALUE
value: "true"
- name: FOLDER
value: /var/lib/grafana/dashboards/general
- name: RESOURCE
value: configmap
image: quay.io/kiwigrid/k8s-sidecar:1.25.0
resources:
limits:
cpu: 1
memory: 128Mi
requests:
cpu: 50m
memory: 32Mi
volumeMounts:
- mountPath: /var/lib/grafana/dashboards/general
name: dashboard-volume
- name: grafana
env:
- name: GF_ANALYTICS_REPORTING_ENABLED
value: "false"
- name: TZ
value: "Europe/Zurich"
image: grafana/grafana:10.0.3
livenessProbe:
failureThreshold: 10
httpGet:
path: /api/health
port: 3000
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
ports:
- containerPort: 3000
name: grafana-http
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /api/health
port: 3000
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
volumeMounts:
- mountPath: /etc/grafana/provisioning/dashboards/
name: grafana-dashboardproviders
- mountPath: /var/lib/grafana/data
name: grafana-volume
- mountPath: /var/lib/grafana/dashboards/general
name: dashboard-volume
- mountPath: /etc/grafana/provisioning/datasources/
name: datasource-volume
volumes:
- name: grafana-dashboardproviders
configMap:
defaultMode: 420
name: grafana-dashboardproviders
- emptyDir: {}
name: grafana-volume
- emptyDir: {}
name: dashboard-volume
- emptyDir: {}
name: datasource-volume
{{- end }}