63 lines
2.0 KiB
YAML

{{- if .Values.grafana.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nomos-runner.fullname" . }}-grafana
labels:
app: {{ include "nomos-runner.name" . }}
chart: {{ include "nomos-runner.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ include "nomos-runner.name" . }}
component: grafana
template:
metadata:
labels:
app: {{ include "nomos-runner.name" . }}
component: grafana
spec:
containers:
- name: grafana
image: {{ .Values.grafana.image }}
imagePullPolicy: {{ .Values.grafana.imagePullPolicy }}
env:
- name: GF_SECURITY_ADMIN_USER
value: {{ .Values.grafana.adminUser | quote }}
- name: GF_SECURITY_ADMIN_PASSWORD
value: {{ .Values.grafana.adminPassword | quote }}
ports:
- containerPort: 3000
name: http
volumeMounts:
- name: grafana-config
mountPath: /etc/grafana/provisioning/datasources/datasources.yaml
subPath: datasources.yaml
readOnly: true
- name: grafana-config
mountPath: /etc/grafana/provisioning/dashboards/dashboards.yaml
subPath: dashboards.yaml
readOnly: true
- name: grafana-dashboards
mountPath: /var/lib/grafana/dashboards
readOnly: true
volumes:
- name: grafana-config
configMap:
name: {{ include "nomos-runner.fullname" . }}-grafana-config
items:
- key: datasources.yaml
path: datasources.yaml
- key: dashboards.yaml
path: dashboards.yaml
- name: grafana-dashboards
configMap:
name: {{ include "nomos-runner.fullname" . }}-grafana-config
items:
- key: testnet_metrics.json
path: testnet_metrics.json
{{- end }}