Files
kubernetes_monitoring/templates/Grafana-Grafana.yaml

157 lines
5.8 KiB
YAML

---
{{ if .Values.nfc_monitoring.grafana.enabled -}}
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
labels:
{{ toYaml $.Values.nfc_monitoring.grafana.labels | nindent 4 }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
app.kubernetes.io/version: {{ $.Chart.Version }}
name: grafana
namespace: "{{ .Values.nfc_monitoring.grafana.namespace }}"
spec:
config:
{{ toYaml $.Values.nfc_monitoring.grafana.config | nindent 4 }}
deployment:
metadata:
labels:
{{ toYaml $.Values.nfc_monitoring.grafana.labels | nindent 8 }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
app.kubernetes.io/version: {{ $.Chart.Version }}
spec:
replicas: {{ .Values.nfc_monitoring.grafana.replicas | int }}
selector:
matchLabels:
{{ toYaml $.Values.nfc_monitoring.grafana.labels | nindent 10 }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
{{ toYaml $.Values.nfc_monitoring.grafana.labels | nindent 12 }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
app.kubernetes.io/version: {{ $.Chart.Version }}
spec:
affinity:
{{- toYaml .Values.nfc_monitoring.grafana.affinity | nindent 12 }}
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled }}
automountServiceAccountToken: true
{{ end }}
containers:
- name: grafana
image: "{{ .Values.nfc_monitoring.grafana.image.name }}:{{ .Values.nfc_monitoring.grafana.image.tag }}"
env:
- name: GF_INSTALL_PLUGINS
value: agenty-flowcharting-panel 0.9.1, ddurieux-glpi-app 1.3.1, grafana-oncall-app
- name: GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS
value: grafana-oncall-app 1.1.38
- name: GF_ANALYTICS_REPORTING_ENABLED
value: 'false'
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
name: grafana-http
readinessProbe:
failureThreshold: 3
httpGet:
path: /login
port: 3000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
resources:
limits:
cpu: 2000m
memory: 1Gi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
- mountPath: /etc/grafana/provisioning/plugins
name: plugin-config
readOnly: false
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled }}
- mountPath: /etc/grafana/provisioning/dashboards
name: provisioning-config
- mountPath: /var/lib/grafana/dashboards
name: dashboards
- image: "{{ .Values.nfc_monitoring.additions.dashboard_sidecar.image.name }}:{{ .Values.nfc_monitoring.additions.dashboard_sidecar.image.tag}}"
name: sidecar
env:
- name: LABEL
value: "{{ .Values.nfc_monitoring.additions.dashboard_sidecar.label_name }}"
- name: LABEL_VALUE
value: "{{ .Values.nfc_monitoring.additions.dashboard_sidecar.label_value }}"
- name: FOLDER
value: /var/lib/grafana/dashboards
- name: NAMESPACE
value: grafana
- name: RESOURCE
value: configmap
volumeMounts:
- mountPath: /var/lib/grafana/dashboards
name: dashboards
{{ end }}
securityContext:
fsGroup: 65534
volumes:
#- name: grafana-storage
- name: plugin-config
configMap:
# Provide the name of the ConfigMap you want to mount.
name: grafana-config
# An array of keys from the ConfigMap to create as files
items:
- key: "oncall-app.yaml"
path: "oncall-app.yaml"
{{ if .Values.nfc_monitoring.additions.dashboard_sidecar.enabled }}
- name: dashboards
emptyDir: {}
- name: provisioning-config
configMap:
name: provisioning-config
{{ end }}
- name: grafana-storage
persistentVolumeClaim:
claimName: grafana-pvc
serviceAccountName: grafana
nodeSelector:
kubernetes.io/os: linux
persistentVolumeClaim:
metadata:
annotations:
pv.beta.kubernetes.io/gid: "65534"
labels:
app.kubernetes.io/name: grafana
app.kubernetes.io/component: graphing
app.kubernetes.io/part-of: {{ $.Chart.Name }}
spec:
accessModes:
- {{ .Values.nfc_monitoring.grafana.storage_accessModes | default "ReadWriteOnce" }}
resources:
requests:
storage: "5Gi"
{{- end }}