2023-01-11 12:08:18 +00:00
|
|
|
{{- $sts := list "sts" "StatefulSet" "statefulset" -}}
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- if (or (.Values.useStatefulSet) (and .Values.persistence.enabled (not .Values.persistence.existingClaim) (has .Values.persistence.type $sts)))}}
|
2020-12-18 00:46:15 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
2022-12-06 20:43:11 +00:00
|
|
|
name: {{ include "grafana.fullname" . }}
|
|
|
|
namespace: {{ include "grafana.namespace" . }}
|
2020-12-18 00:46:15 +00:00
|
|
|
labels:
|
|
|
|
{{- include "grafana.labels" . | nindent 4 }}
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- with .Values.annotations }}
|
2020-12-18 00:46:15 +00:00
|
|
|
annotations:
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-12-18 00:46:15 +00:00
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicas }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "grafana.selectorLabels" . | nindent 6 }}
|
2022-12-06 20:43:11 +00:00
|
|
|
serviceName: {{ include "grafana.fullname" . }}-headless
|
2020-12-18 00:46:15 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "grafana.selectorLabels" . | nindent 8 }}
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- with .Values.podLabels }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-12-18 00:46:15 +00:00
|
|
|
annotations:
|
|
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
|
|
checksum/dashboards-json-config: {{ include (print $.Template.BasePath "/dashboards-json-configmap.yaml") . | sha256sum }}
|
|
|
|
checksum/sc-dashboard-provider-config: {{ include (print $.Template.BasePath "/configmap-dashboard-provider.yaml") . | sha256sum }}
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- if and (or (and (not .Values.admin.existingSecret) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD__FILE) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD)) (and .Values.ldap.enabled (not .Values.ldap.existingSecret))) (not .Values.env.GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION) }}
|
2020-12-18 00:46:15 +00:00
|
|
|
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-12-18 00:46:15 +00:00
|
|
|
spec:
|
|
|
|
{{- include "grafana.pod" . | nindent 6 }}
|
2022-08-24 15:13:39 +00:00
|
|
|
{{- if .Values.persistence.enabled}}
|
2020-12-18 00:46:15 +00:00
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: storage
|
|
|
|
spec:
|
|
|
|
accessModes: {{ .Values.persistence.accessModes }}
|
|
|
|
storageClassName: {{ .Values.persistence.storageClassName }}
|
|
|
|
resources:
|
|
|
|
requests:
|
2021-02-26 21:25:43 +00:00
|
|
|
storage: {{ .Values.persistence.size }}
|
|
|
|
{{- with .Values.persistence.selectorLabels }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2022-12-06 20:43:11 +00:00
|
|
|
{{- toYaml . | nindent 10 }}
|
2021-02-26 21:25:43 +00:00
|
|
|
{{- end }}
|
2022-08-24 15:13:39 +00:00
|
|
|
{{- end }}
|
2020-12-18 00:46:15 +00:00
|
|
|
{{- end }}
|