2020-12-18 00:46:15 +00:00
{ { - define "grafana.pod" - } }
2023-01-11 12:08:18 +00:00
{ { - $sts : = list "sts" "StatefulSet" "statefulset" - } }
2022-12-06 20:43:11 +00:00
{ { - $root : = . - } }
{ { - with . Values . schedulerName } }
schedulerName: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
serviceAccountName: { { include "grafana.serviceAccountName" . } }
2021-07-29 11:50:16 +00:00
automountServiceAccountToken: { { . Values . serviceAccount . autoMount } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . securityContext } }
2020-12-18 00:46:15 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . hostAliases } }
2020-12-18 00:46:15 +00:00
hostAliases:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . priorityClassName } }
priorityClassName: { { . } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-10-27 12:27:42 +00:00
{ { - if ( or . Values . persistence . enabled . Values . dashboards . Values . extraInitContainers ( and . Values . sidecar . datasources . enabled . Values . sidecar . datasources . initDatasources ) ( and . Values . sidecar . notifiers . enabled . Values . sidecar . notifiers . initNotifiers ) ) } }
2020-12-18 00:46:15 +00:00
initContainers:
{ { - end } }
{ { - if ( and . Values . persistence . enabled . Values . initChownData . enabled ) } }
- name: init-chown-data
{ { - if . Values . initChownData . image . sha } }
image: " { { . Values . initChownData . image . repository } } : { { . Values . initChownData . image . tag } } @sha256: { { . Values . initChownData . image . sha } } "
{ { - else } }
image: " { { . Values . initChownData . image . repository } } : { { . Values . initChownData . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . initChownData . image . pullPolicy } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . initChownData . securityContext } }
2020-12-18 00:46:15 +00:00
securityContext:
2022-12-06 20:43:11 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
command:
- chown
- -R
- { { . Values . securityContext . runAsUser } } : { { . Values . securityContext . runAsGroup } }
- /var/lib/grafana
2022-09-16 09:21:38 +00:00
{ { - with . Values . initChownData . resources } }
2020-12-18 00:46:15 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
volumeMounts:
- name: storage
mountPath: "/var/lib/grafana"
2022-12-06 20:43:11 +00:00
{ { - with . Values . persistence . subPath } }
subPath: { { tpl . $root } }
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - end } }
{ { - if . Values . dashboards } }
- name: download-dashboards
{ { - if . Values . downloadDashboardsImage . sha } }
image: " { { . Values . downloadDashboardsImage . repository } } : { { . Values . downloadDashboardsImage . tag } } @sha256: { { . Values . downloadDashboardsImage . sha } } "
{ { - else } }
image: " { { . Values . downloadDashboardsImage . repository } } : { { . Values . downloadDashboardsImage . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . downloadDashboardsImage . pullPolicy } }
command: ["/bin/sh"]
2021-07-29 11:50:16 +00:00
args: [ "-c", "mkdir -p /var/lib/grafana/dashboards/default && /bin/sh -x /etc/grafana/download_dashboards.sh" ]
2022-09-16 09:21:38 +00:00
{ { - with . Values . downloadDashboards . resources } }
2020-12-18 00:46:15 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
env:
2022-12-06 20:43:11 +00:00
{ { - range $key , $value : = . Values . downloadDashboards . env } }
2020-12-18 00:46:15 +00:00
- name: " { { $key } } "
value: " { { $value } } "
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range $key , $value : = . Values . downloadDashboards . envValueFrom } }
- name: { { $key | quote } }
valueFrom:
{ { - tpl ( toYaml $value ) $ | nindent 1 0 } }
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . downloadDashboards . securityContext } }
securityContext:
{ { - toYaml . | nindent 6 } }
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . downloadDashboards . envFromSecret } }
2021-03-22 09:23:27 +00:00
envFrom:
- secretRef:
2022-12-06 20:43:11 +00:00
name: { { tpl . $root } }
{ { - end } }
2020-12-18 00:46:15 +00:00
volumeMounts:
- name: config
mountPath: "/etc/grafana/download_dashboards.sh"
subPath: download_dashboards.sh
- name: storage
mountPath: "/var/lib/grafana"
2022-12-06 20:43:11 +00:00
{ { - with . Values . persistence . subPath } }
subPath: { { tpl . $root } }
{ { - end } }
{ { - range . Values . extraSecretMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
mountPath: { { . mountPath } }
readOnly: { { . readOnly } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-04-08 15:08:28 +00:00
{ { - if and . Values . sidecar . datasources . enabled . Values . sidecar . datasources . initDatasources } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -init-sc-datasources
2022-04-08 15:08:28 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
2022-09-16 09:21:38 +00:00
{ { - range $key , $value : = . Values . sidecar . datasources . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . datasources . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: METHOD
value: "LIST"
- name: LABEL
value: " { { . Values . sidecar . datasources . label } } "
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . datasources . labelValue } }
2022-04-08 15:08:28 +00:00
- name: LABEL_VALUE
2022-12-06 20:43:11 +00:00
value: { { quote . } }
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if or . Values . sidecar . logLevel . Values . sidecar . datasources . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . datasources . logLevel } }
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: FOLDER
value: "/etc/grafana/provisioning/datasources"
- name: RESOURCE
value: { { quote . Values . sidecar . datasources . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2022-04-08 15:08:28 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
{ { - if . Values . sidecar . datasources . searchNamespace } }
- name: NAMESPACE
2022-10-27 12:27:42 +00:00
value: " { { tpl ( . Values . sidecar . datasources . searchNamespace | join "," ) . } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . skipTlsVerify } }
2022-04-08 15:08:28 +00:00
- name: SKIP_TLS_VERIFY
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . sidecar . resources } }
2022-04-08 15:08:28 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
2022-04-08 15:08:28 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2022-04-08 15:08:28 +00:00
volumeMounts:
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
{ { - end } }
2022-10-27 12:27:42 +00:00
{ { - if and . Values . sidecar . notifiers . enabled . Values . sidecar . notifiers . initNotifiers } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -init-sc-notifiers
2020-12-18 00:46:15 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
2022-09-16 09:21:38 +00:00
{ { - range $key , $value : = . Values . sidecar . notifiers . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . notifiers . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
2020-12-18 00:46:15 +00:00
- name: METHOD
value: LIST
- name: LABEL
value: " { { . Values . sidecar . notifiers . label } } "
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . notifiers . labelValue } }
2022-09-16 09:21:38 +00:00
- name: LABEL_VALUE
2022-12-06 20:43:11 +00:00
value: { { quote . } }
2022-09-16 09:21:38 +00:00
{ { - end } }
{ { - if or . Values . sidecar . logLevel . Values . sidecar . notifiers . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . notifiers . logLevel } }
{ { - end } }
2020-12-18 00:46:15 +00:00
- name: FOLDER
value: "/etc/grafana/provisioning/notifiers"
- name: RESOURCE
2021-05-11 08:07:38 +00:00
value: { { quote . Values . sidecar . notifiers . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2020-12-18 00:46:15 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . notifiers . searchNamespace } }
2020-12-18 00:46:15 +00:00
- name: NAMESPACE
2022-12-06 20:43:11 +00:00
value: " { { tpl ( . | join "," ) $root } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . skipTlsVerify } }
2020-12-18 00:46:15 +00:00
- name: SKIP_TLS_VERIFY
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . sidecar . livenessProbe } }
2022-08-24 15:13:39 +00:00
livenessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
2022-08-24 15:13:39 +00:00
readinessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
2020-12-18 00:46:15 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
2021-12-09 18:03:55 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
volumeMounts:
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . extraInitContainers } }
{ { - tpl ( toYaml . ) $root | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - if or . Values . image . pullSecrets . Values . global . imagePullSecrets } }
2020-12-18 00:46:15 +00:00
imagePullSecrets:
2022-12-06 20:43:11 +00:00
{ { - include "grafana.imagePullSecrets" ( dict "root" $root "imagePullSecrets" . Values . image . pullSecrets ) | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-01-28 16:19:41 +00:00
{ { - if not . Values . enableKubeBackwardCompatibility } }
2021-06-30 16:26:06 +00:00
enableServiceLinks: { { . Values . enableServiceLinks } }
2022-01-28 16:19:41 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
containers:
2022-10-27 12:27:42 +00:00
{ { - if . Values . sidecar . alerts . enabled } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -sc-alerts
2022-10-27 12:27:42 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
{ { - range $key , $value : = . Values . sidecar . alerts . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . alerts . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
- name: METHOD
value: { { . Values . sidecar . alerts . watchMethod } }
- name: LABEL
value: " { { . Values . sidecar . alerts . label } } "
{ { - with . Values . sidecar . alerts . labelValue } }
- name: LABEL_VALUE
value: { { quote . } }
{ { - end } }
{ { - if or . Values . sidecar . logLevel . Values . sidecar . alerts . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . alerts . logLevel } }
{ { - end } }
- name: FOLDER
value: "/etc/grafana/provisioning/alerting"
- name: RESOURCE
value: { { quote . Values . sidecar . alerts . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2022-10-27 12:27:42 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-10-27 12:27:42 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . alerts . searchNamespace } }
2022-10-27 12:27:42 +00:00
- name: NAMESPACE
value: { { . | join "," | quote } }
{ { - end } }
{ { - with . Values . sidecar . alerts . skipTlsVerify } }
- name: SKIP_TLS_VERIFY
value: { { quote . } }
{ { - end } }
{ { - with . Values . sidecar . alerts . script } }
- name: SCRIPT
value: { { quote . } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_USERNAME
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_PASSWORD
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if not . Values . sidecar . alerts . skipReload } }
- name: REQ_URL
value: { { . Values . sidecar . alerts . reloadURL } }
- name: REQ_METHOD
value: POST
{ { - end } }
{ { - if . Values . sidecar . alerts . watchServerTimeout } }
{ { - if ne . Values . sidecar . alerts . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.alerts.watchServerTimeout with .Values.sidecar.alerts.watchMethod %s" . Values . sidecar . alerts . watchMethod ) } }
{ { - end } }
- name: WATCH_SERVER_TIMEOUT
value: " { { . Values . sidecar . alerts . watchServerTimeout } } "
{ { - end } }
{ { - if . Values . sidecar . alerts . watchClientTimeout } }
{ { - if ne . Values . sidecar . alerts . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.alerts.watchClientTimeout with .Values.sidecar.alerts.watchMethod %s" . Values . sidecar . alerts . watchMethod ) } }
{ { - end } }
- name: WATCH_CLIENT_TIMEOUT
value: " { { . Values . sidecar . alerts . watchClientTimeout } } "
{ { - end } }
{ { - with . Values . sidecar . livenessProbe } }
livenessProbe:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
readinessProbe:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
resources:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
securityContext:
{ { - toYaml . | nindent 6 } }
{ { - end } }
volumeMounts:
- name: sc-alerts-volume
mountPath: "/etc/grafana/provisioning/alerting"
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - if . Values . sidecar . dashboards . enabled } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -sc-dashboard
2020-12-18 00:46:15 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
2022-09-16 09:21:38 +00:00
{ { - range $key , $value : = . Values . sidecar . dashboards . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . dashboards . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
2020-12-18 00:46:15 +00:00
- name: METHOD
value: { { . Values . sidecar . dashboards . watchMethod } }
- name: LABEL
value: " { { . Values . sidecar . dashboards . label } } "
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . labelValue } }
2021-02-26 21:25:43 +00:00
- name: LABEL_VALUE
2022-12-06 20:43:11 +00:00
value: { { quote . } }
2021-02-26 21:25:43 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if or . Values . sidecar . logLevel . Values . sidecar . dashboards . logLevel } }
2022-08-24 15:13:39 +00:00
- name: LOG_LEVEL
2022-09-16 09:21:38 +00:00
value: { { default . Values . sidecar . logLevel . Values . sidecar . dashboards . logLevel } }
2022-08-24 15:13:39 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
- name: FOLDER
value: " { { . Values . sidecar . dashboards . folder } } { { - with . Values . sidecar . dashboards . defaultFolderName } } / { { . } } { { - end } } "
- name: RESOURCE
2021-05-11 08:07:38 +00:00
value: { { quote . Values . sidecar . dashboards . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2020-12-18 00:46:15 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . searchNamespace } }
2020-12-18 00:46:15 +00:00
- name: NAMESPACE
2022-12-06 20:43:11 +00:00
value: " { { tpl ( . | join "," ) $root } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . skipTlsVerify } }
2020-12-18 00:46:15 +00:00
- name: SKIP_TLS_VERIFY
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . folderAnnotation } }
2020-12-18 00:46:15 +00:00
- name: FOLDER_ANNOTATION
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . script } }
2021-04-25 09:59:54 +00:00
- name: SCRIPT
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2021-12-09 18:03:55 +00:00
{ { - end } }
2023-01-11 12:08:18 +00:00
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_USERNAME
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_PASSWORD
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if not . Values . sidecar . dashboards . skipReload } }
- name: REQ_URL
value: { { . Values . sidecar . dashboards . reloadURL } }
- name: REQ_METHOD
value: POST
{ { - end } }
2022-04-08 15:08:28 +00:00
{ { - if . Values . sidecar . dashboards . watchServerTimeout } }
2022-09-16 09:21:38 +00:00
{ { - if ne . Values . sidecar . dashboards . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.dashboards.watchServerTimeout with .Values.sidecar.dashboards.watchMethod %s" . Values . sidecar . dashboards . watchMethod ) } }
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: WATCH_SERVER_TIMEOUT
value: " { { . Values . sidecar . dashboards . watchServerTimeout } } "
{ { - end } }
{ { - if . Values . sidecar . dashboards . watchClientTimeout } }
2022-09-16 09:21:38 +00:00
{ { - if ne . Values . sidecar . dashboards . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.dashboards.watchClientTimeout with .Values.sidecar.dashboards.watchMethod %s" . Values . sidecar . dashboards . watchMethod ) } }
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: WATCH_CLIENT_TIMEOUT
2022-12-06 20:43:11 +00:00
value: { { . Values . sidecar . dashboards . watchClientTimeout | quote } }
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . sidecar . livenessProbe } }
2022-08-24 15:13:39 +00:00
livenessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
2022-08-24 15:13:39 +00:00
readinessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
2020-12-18 00:46:15 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
2021-12-09 18:03:55 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
volumeMounts:
- name: sc-dashboard-volume
mountPath: { { . Values . sidecar . dashboards . folder | quote } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . extraMounts } }
{ { - toYaml . | trim | nindent 6 } }
2021-12-09 18:03:55 +00:00
{ { - end } }
2022-01-28 16:19:41 +00:00
{ { - end } }
{ { - if . Values . sidecar . datasources . enabled } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -sc-datasources
2022-01-28 16:19:41 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
2022-09-16 09:21:38 +00:00
{ { - range $key , $value : = . Values . sidecar . datasources . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . datasources . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
2022-01-28 16:19:41 +00:00
- name: METHOD
value: { { . Values . sidecar . datasources . watchMethod } }
- name: LABEL
value: " { { . Values . sidecar . datasources . label } } "
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . datasources . labelValue } }
2022-01-28 16:19:41 +00:00
- name: LABEL_VALUE
2022-12-06 20:43:11 +00:00
value: { { quote . } }
2022-01-28 16:19:41 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if or . Values . sidecar . logLevel . Values . sidecar . datasources . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . datasources . logLevel } }
{ { - end } }
2022-01-28 16:19:41 +00:00
- name: FOLDER
value: "/etc/grafana/provisioning/datasources"
- name: RESOURCE
value: { { quote . Values . sidecar . datasources . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2022-01-28 16:19:41 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-01-28 16:19:41 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . datasources . searchNamespace } }
2022-01-28 16:19:41 +00:00
- name: NAMESPACE
2022-12-06 20:43:11 +00:00
value: " { { tpl ( . | join "," ) $root } } "
2022-01-28 16:19:41 +00:00
{ { - end } }
{ { - if . Values . sidecar . skipTlsVerify } }
- name: SKIP_TLS_VERIFY
value: " { { . Values . sidecar . skipTlsVerify } } "
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if . Values . sidecar . datasources . script } }
- name: SCRIPT
value: " { { . Values . sidecar . datasources . script } } "
{ { - end } }
2022-01-28 16:19:41 +00:00
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_USERNAME
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2022-01-28 16:19:41 +00:00
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_PASSWORD
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2022-01-28 16:19:41 +00:00
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if not . Values . sidecar . datasources . skipReload } }
- name: REQ_URL
value: { { . Values . sidecar . datasources . reloadURL } }
- name: REQ_METHOD
value: POST
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if . Values . sidecar . datasources . watchServerTimeout } }
{ { - if ne . Values . sidecar . datasources . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.datasources.watchServerTimeout with .Values.sidecar.datasources.watchMethod %s" . Values . sidecar . datasources . watchMethod ) } }
{ { - end } }
- name: WATCH_SERVER_TIMEOUT
value: " { { . Values . sidecar . datasources . watchServerTimeout } } "
{ { - end } }
{ { - if . Values . sidecar . datasources . watchClientTimeout } }
{ { - if ne . Values . sidecar . datasources . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.datasources.watchClientTimeout with .Values.sidecar.datasources.watchMethod %s" . Values . sidecar . datasources . watchMethod ) } }
{ { - end } }
- name: WATCH_CLIENT_TIMEOUT
value: " { { . Values . sidecar . datasources . watchClientTimeout } } "
{ { - end } }
{ { - with . Values . sidecar . livenessProbe } }
2022-08-24 15:13:39 +00:00
livenessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
2022-08-24 15:13:39 +00:00
readinessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
2022-01-28 16:19:41 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
2022-01-28 16:19:41 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2022-01-28 16:19:41 +00:00
volumeMounts:
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-10-27 12:27:42 +00:00
{ { - if . Values . sidecar . notifiers . enabled } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -sc-notifiers
2022-10-27 12:27:42 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
{ { - range $key , $value : = . Values . sidecar . notifiers . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . notifiers . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
- name: METHOD
value: { { . Values . sidecar . notifiers . watchMethod } }
- name: LABEL
value: " { { . Values . sidecar . notifiers . label } } "
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . notifiers . labelValue } }
2022-10-27 12:27:42 +00:00
- name: LABEL_VALUE
2022-12-06 20:43:11 +00:00
value: { { quote . } }
2022-10-27 12:27:42 +00:00
{ { - end } }
{ { - if or . Values . sidecar . logLevel . Values . sidecar . notifiers . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . notifiers . logLevel } }
{ { - end } }
- name: FOLDER
value: "/etc/grafana/provisioning/notifiers"
- name: RESOURCE
value: { { quote . Values . sidecar . notifiers . resource } }
{ { - if . Values . sidecar . enableUniqueFilenames } }
- name: UNIQUE_FILENAMES
value: " { { . Values . sidecar . enableUniqueFilenames } } "
{ { - end } }
2023-01-11 12:08:18 +00:00
{ { - with . Values . sidecar . notifiers . searchNamespace } }
2022-10-27 12:27:42 +00:00
- name: NAMESPACE
2022-12-06 20:43:11 +00:00
value: " { { tpl ( . | join "," ) $root } } "
2022-10-27 12:27:42 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . skipTlsVerify } }
2022-10-27 12:27:42 +00:00
- name: SKIP_TLS_VERIFY
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-10-27 12:27:42 +00:00
{ { - end } }
{ { - if . Values . sidecar . notifiers . script } }
- name: SCRIPT
value: " { { . Values . sidecar . notifiers . script } } "
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_USERNAME
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_PASSWORD
valueFrom:
secretKeyRef:
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if not . Values . sidecar . notifiers . skipReload } }
- name: REQ_URL
value: { { . Values . sidecar . notifiers . reloadURL } }
- name: REQ_METHOD
value: POST
{ { - end } }
{ { - if . Values . sidecar . notifiers . watchServerTimeout } }
{ { - if ne . Values . sidecar . notifiers . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.notifiers.watchServerTimeout with .Values.sidecar.notifiers.watchMethod %s" . Values . sidecar . notifiers . watchMethod ) } }
{ { - end } }
- name: WATCH_SERVER_TIMEOUT
value: " { { . Values . sidecar . notifiers . watchServerTimeout } } "
{ { - end } }
{ { - if . Values . sidecar . notifiers . watchClientTimeout } }
{ { - if ne . Values . sidecar . notifiers . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.notifiers.watchClientTimeout with .Values.sidecar.notifiers.watchMethod %s" . Values . sidecar . notifiers . watchMethod ) } }
{ { - end } }
- name: WATCH_CLIENT_TIMEOUT
value: " { { . Values . sidecar . notifiers . watchClientTimeout } } "
{ { - end } }
{ { - with . Values . sidecar . livenessProbe } }
livenessProbe:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
readinessProbe:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
resources:
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
securityContext:
{ { - toYaml . | nindent 6 } }
{ { - end } }
volumeMounts:
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
{ { - end } }
2022-04-08 15:08:28 +00:00
{ { - if . Values . sidecar . plugins . enabled } }
2022-12-06 20:43:11 +00:00
- name: { { include "grafana.name" . } } -sc-plugins
2022-04-08 15:08:28 +00:00
{ { - if . Values . sidecar . image . sha } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } @sha256: { { . Values . sidecar . image . sha } } "
{ { - else } }
image: " { { . Values . sidecar . image . repository } } : { { . Values . sidecar . image . tag } } "
{ { - end } }
imagePullPolicy: { { . Values . sidecar . imagePullPolicy } }
env:
2022-09-16 09:21:38 +00:00
{ { - range $key , $value : = . Values . sidecar . plugins . env } }
- name: " { { $key } } "
value: " { { $value } } "
{ { - end } }
{ { - if . Values . sidecar . plugins . ignoreAlreadyProcessed } }
- name: IGNORE_ALREADY_PROCESSED
value: "true"
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: METHOD
value: { { . Values . sidecar . plugins . watchMethod } }
- name: LABEL
value: " { { . Values . sidecar . plugins . label } } "
{ { - if . Values . sidecar . plugins . labelValue } }
- name: LABEL_VALUE
value: { { quote . Values . sidecar . plugins . labelValue } }
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if or . Values . sidecar . logLevel . Values . sidecar . plugins . logLevel } }
- name: LOG_LEVEL
value: { { default . Values . sidecar . logLevel . Values . sidecar . plugins . logLevel } }
{ { - end } }
2022-04-08 15:08:28 +00:00
- name: FOLDER
value: "/etc/grafana/provisioning/plugins"
- name: RESOURCE
value: { { quote . Values . sidecar . plugins . resource } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . enableUniqueFilenames } }
2022-04-08 15:08:28 +00:00
- name: UNIQUE_FILENAMES
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . plugins . searchNamespace } }
2022-04-08 15:08:28 +00:00
- name: NAMESPACE
2022-12-06 20:43:11 +00:00
value: " { { tpl ( . | join "," ) $root } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . plugins . script } }
2022-09-16 09:21:38 +00:00
- name: SCRIPT
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-09-16 09:21:38 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . skipTlsVerify } }
2022-04-08 15:08:28 +00:00
- name: SKIP_TLS_VERIFY
2022-12-06 20:43:11 +00:00
value: " { { . } } "
2022-04-08 15:08:28 +00:00
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_USERNAME
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2022-04-08 15:08:28 +00:00
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
- name: REQ_PASSWORD
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2022-04-08 15:08:28 +00:00
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if not . Values . sidecar . plugins . skipReload } }
- name: REQ_URL
value: { { . Values . sidecar . plugins . reloadURL } }
- name: REQ_METHOD
value: POST
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - if . Values . sidecar . plugins . watchServerTimeout } }
{ { - if ne . Values . sidecar . plugins . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.plugins.watchServerTimeout with .Values.sidecar.plugins.watchMethod %s" . Values . sidecar . plugins . watchMethod ) } }
{ { - end } }
- name: WATCH_SERVER_TIMEOUT
value: " { { . Values . sidecar . plugins . watchServerTimeout } } "
{ { - end } }
{ { - if . Values . sidecar . plugins . watchClientTimeout } }
{ { - if ne . Values . sidecar . plugins . watchMethod "WATCH" } }
{ { - fail ( printf "Cannot use .Values.sidecar.plugins.watchClientTimeout with .Values.sidecar.plugins.watchMethod %s" . Values . sidecar . plugins . watchMethod ) } }
{ { - end } }
- name: WATCH_CLIENT_TIMEOUT
value: " { { . Values . sidecar . plugins . watchClientTimeout } } "
{ { - end } }
{ { - with . Values . sidecar . livenessProbe } }
2022-08-24 15:13:39 +00:00
livenessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . readinessProbe } }
2022-08-24 15:13:39 +00:00
readinessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . resources } }
2022-04-08 15:08:28 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . sidecar . securityContext } }
2022-04-08 15:08:28 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2022-04-08 15:08:28 +00:00
volumeMounts:
- name: sc-plugins-volume
mountPath: "/etc/grafana/provisioning/plugins"
2020-12-18 00:46:15 +00:00
{ { - end } }
- name: { { . Chart . Name } }
{ { - if . Values . image . sha } }
2022-08-24 15:13:39 +00:00
image: " { { . Values . image . repository } } : { { . Values . image . tag | default . Chart . AppVersion } } @sha256: { { . Values . image . sha } } "
2020-12-18 00:46:15 +00:00
{ { - else } }
2022-08-24 15:13:39 +00:00
image: " { { . Values . image . repository } } : { { . Values . image . tag | default . Chart . AppVersion } } "
2020-12-18 00:46:15 +00:00
{ { - end } }
imagePullPolicy: { { . Values . image . pullPolicy } }
2022-12-06 20:43:11 +00:00
{ { - if . Values . command } }
2020-12-18 00:46:15 +00:00
command:
{ { - range . Values . command } }
2022-10-27 12:27:42 +00:00
- { { . | quote } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . containerSecurityContext } }
2021-02-26 21:25:43 +00:00
securityContext:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
volumeMounts:
- name: config
mountPath: "/etc/grafana/grafana.ini"
subPath: grafana.ini
{ { - if . Values . ldap . enabled } }
- name: ldap
mountPath: "/etc/grafana/ldap.toml"
subPath: ldap.toml
{ { - end } }
{ { - range . Values . extraConfigmapMounts } }
2022-08-24 15:13:39 +00:00
- name: { { tpl . name $root } }
mountPath: { { tpl . mountPath $root } }
subPath: { { ( tpl . subPath $root ) | default "" } }
2020-12-18 00:46:15 +00:00
readOnly: { { . readOnly } }
{ { - end } }
- name: storage
mountPath: "/var/lib/grafana"
2022-12-06 20:43:11 +00:00
{ { - with . Values . persistence . subPath } }
subPath: { { tpl . $root } }
{ { - end } }
{ { - with . Values . dashboards } }
{ { - range $provider , $dashboards : = . } }
{ { - range $key , $value : = $dashboards } }
{ { - if ( or ( hasKey $value "json" ) ( hasKey $value "file" ) ) } }
2020-12-18 00:46:15 +00:00
- name: dashboards- { { $provider } }
mountPath: "/var/lib/grafana/dashboards/ { { $provider } } / { { $key } } .json"
subPath: " { { $key } } .json"
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - end } }
{ { - end } }
{ { - with . Values . dashboardsConfigMaps } }
{ { - range ( keys . | sortAlpha ) } }
2020-12-18 00:46:15 +00:00
- name: dashboards- { { . } }
mountPath: "/var/lib/grafana/dashboards/ { { . } } "
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - with . Values . datasources } }
{ { - range ( keys . | sortAlpha ) } }
2020-12-18 00:46:15 +00:00
- name: config
2021-09-27 15:34:47 +00:00
mountPath: "/etc/grafana/provisioning/datasources/ { { . } } "
subPath: { { . | quote } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - with . Values . notifiers } }
{ { - range ( keys . | sortAlpha ) } }
2020-12-18 00:46:15 +00:00
- name: config
2021-09-27 15:34:47 +00:00
mountPath: "/etc/grafana/provisioning/notifiers/ { { . } } "
subPath: { { . | quote } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - with . Values . alerting } }
{ { - range ( keys . | sortAlpha ) } }
2022-09-16 09:21:38 +00:00
- name: config
mountPath: "/etc/grafana/provisioning/alerting/ { { . } } "
subPath: { { . | quote } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - with . Values . dashboardProviders } }
{ { - range ( keys . | sortAlpha ) } }
2020-12-18 00:46:15 +00:00
- name: config
2021-09-27 15:34:47 +00:00
mountPath: "/etc/grafana/provisioning/dashboards/ { { . } } "
subPath: { { . | quote } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - with . Values . sidecar . alerts . enabled } }
2022-10-27 12:27:42 +00:00
- name: sc-alerts-volume
mountPath: "/etc/grafana/provisioning/alerting"
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - if . Values . sidecar . dashboards . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-dashboard-volume
mountPath: { { . Values . sidecar . dashboards . folder | quote } }
2022-12-06 20:43:11 +00:00
{ { - if . Values . sidecar . dashboards . SCProvider } }
2020-12-18 00:46:15 +00:00
- name: sc-dashboard-provider
mountPath: "/etc/grafana/provisioning/dashboards/sc-dashboardproviders.yaml"
subPath: provider.yaml
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . datasources . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - if . Values . sidecar . plugins . enabled } }
2022-04-08 15:08:28 +00:00
- name: sc-plugins-volume
mountPath: "/etc/grafana/provisioning/plugins"
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - if . Values . sidecar . notifiers . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range . Values . extraSecretMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
mountPath: { { . mountPath } }
readOnly: { { . readOnly } }
subPath: { { . subPath | default "" } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range . Values . extraVolumeMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
mountPath: { { . mountPath } }
subPath: { { . subPath | default "" } }
readOnly: { { . readOnly } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range . Values . extraEmptyDirMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
mountPath: { { . mountPath } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
ports:
- name: { { . Values . podPortName } }
2022-09-16 09:21:38 +00:00
containerPort: { { . Values . service . targetPort } }
2020-12-18 00:46:15 +00:00
protocol: TCP
env:
2021-06-01 16:40:34 +00:00
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_USER ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
2020-12-18 00:46:15 +00:00
- name: GF_SECURITY_ADMIN_USER
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2020-12-18 00:46:15 +00:00
key: { { . Values . admin . userKey | default "admin-user" } }
{ { - end } }
2021-06-01 16:40:34 +00:00
{ { - if and ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD ) ( not . Values . env . GF_SECURITY_ADMIN_PASSWORD__FILE ) ( not . Values . env . GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION ) } }
2020-12-18 00:46:15 +00:00
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
2022-08-24 15:13:39 +00:00
name: { { ( tpl . Values . admin . existingSecret . ) | default ( include "grafana.fullname" . ) } }
2020-12-18 00:46:15 +00:00
key: { { . Values . admin . passwordKey | default "admin-password" } }
{ { - end } }
{ { - if . Values . plugins } }
- name: GF_INSTALL_PLUGINS
valueFrom:
configMapKeyRef:
2022-12-06 20:43:11 +00:00
name: { { include "grafana.fullname" . } }
2020-12-18 00:46:15 +00:00
key: plugins
{ { - end } }
{ { - if . Values . smtp . existingSecret } }
- name: GF_SMTP_USER
valueFrom:
secretKeyRef:
name: { { . Values . smtp . existingSecret } }
key: { { . Values . smtp . userKey | default "user" } }
- name: GF_SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: { { . Values . smtp . existingSecret } }
key: { { . Values . smtp . passwordKey | default "password" } }
{ { - end } }
2022-01-28 16:19:41 +00:00
{ { - if . Values . imageRenderer . enabled } }
2020-12-18 00:46:15 +00:00
- name: GF_RENDERING_SERVER_URL
2022-12-06 20:43:11 +00:00
value: http:// { { include "grafana.fullname" . } } -image-renderer. { { include "grafana.namespace" . } } : { { . Values . imageRenderer . service . port } } /render
2020-12-18 00:46:15 +00:00
- name: GF_RENDERING_CALLBACK_URL
2022-12-06 20:43:11 +00:00
value: { { . Values . imageRenderer . grafanaProtocol } } :// { { include "grafana.fullname" . } } . { { include "grafana.namespace" . } } : { { . Values . service . port } } / { { . Values . imageRenderer . grafanaSubPath } }
2022-01-28 16:19:41 +00:00
{ { - end } }
2021-06-30 16:26:06 +00:00
- name: GF_PATHS_DATA
value: { { ( get . Values "grafana.ini" ) . paths . data } }
- name: GF_PATHS_LOGS
value: { { ( get . Values "grafana.ini" ) . paths . logs } }
- name: GF_PATHS_PLUGINS
value: { { ( get . Values "grafana.ini" ) . paths . plugins } }
- name: GF_PATHS_PROVISIONING
value: { { ( get . Values "grafana.ini" ) . paths . provisioning } }
2022-12-06 20:43:11 +00:00
{ { - range $key , $value : = . Values . envValueFrom } }
2020-12-18 00:46:15 +00:00
- name: { { $key | quote } }
valueFrom:
2022-12-06 20:43:11 +00:00
{ { - tpl ( toYaml $value ) $ | nindent 1 0 } }
{ { - end } }
{ { - range $key , $value : = . Values . env } }
2020-12-18 00:46:15 +00:00
- name: " { { tpl $key $ } } "
value: " { { tpl ( print $value ) $ } } "
2022-12-06 20:43:11 +00:00
{ { - end } }
2022-04-08 15:08:28 +00:00
{ { - if or . Values . envFromSecret ( or . Values . envRenderSecret . Values . envFromSecrets ) . Values . envFromConfigMaps } }
2020-12-18 00:46:15 +00:00
envFrom:
2022-12-06 20:43:11 +00:00
{ { - if . Values . envFromSecret } }
2020-12-18 00:46:15 +00:00
- secretRef:
name: { { tpl . Values . envFromSecret . } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - if . Values . envRenderSecret } }
2020-12-18 00:46:15 +00:00
- secretRef:
2022-12-06 20:43:11 +00:00
name: { { include "grafana.fullname" . } } -env
{ { - end } }
{ { - range . Values . envFromSecrets } }
2021-09-27 15:34:47 +00:00
- secretRef:
2022-04-08 15:08:28 +00:00
name: { { tpl . name $ } }
optional: { { . optional | default false } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range . Values . envFromConfigMaps } }
2022-04-08 15:08:28 +00:00
- configMapRef:
name: { { tpl . name $ } }
2021-09-27 15:34:47 +00:00
optional: { { . optional | default false } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2021-09-27 15:34:47 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . livenessProbe } }
2020-12-18 00:46:15 +00:00
livenessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
{ { - with . Values . readinessProbe } }
2020-12-18 00:46:15 +00:00
readinessProbe:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - with . Values . lifecycleHooks } }
lifecycle:
{ { - tpl ( toYaml . ) $root | nindent 6 } }
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . resources } }
2020-12-18 00:46:15 +00:00
resources:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 6 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - with . Values . extraContainers } }
2022-12-06 20:43:11 +00:00
{ { - tpl . $ | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
{ { - with . Values . nodeSelector } }
nodeSelector:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
{ { - with . Values . affinity } }
affinity:
2022-12-06 20:43:11 +00:00
{ { - tpl ( toYaml . ) $root | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
2022-09-16 09:21:38 +00:00
{ { - with . Values . topologySpreadConstraints } }
topologySpreadConstraints:
{ { - toYaml . | nindent 2 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - with . Values . tolerations } }
tolerations:
2022-09-16 09:21:38 +00:00
{ { - toYaml . | nindent 2 } }
2020-12-18 00:46:15 +00:00
{ { - end } }
volumes:
- name: config
configMap:
2022-12-06 20:43:11 +00:00
name: { { include "grafana.fullname" . } }
{ { - range . Values . extraConfigmapMounts } }
2022-08-24 15:13:39 +00:00
- name: { { tpl . name $root } }
2020-12-18 00:46:15 +00:00
configMap:
2022-08-24 15:13:39 +00:00
name: { { tpl . configMap $root } }
2022-12-06 20:43:11 +00:00
{ { - with . items } }
items:
{ { - toYaml . | nindent 8 } }
2022-08-24 15:13:39 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - if . Values . dashboards } }
2022-12-06 20:43:11 +00:00
{ { - range ( keys . Values . dashboards | sortAlpha ) } }
2020-12-18 00:46:15 +00:00
- name: dashboards- { { . } }
configMap:
2022-12-06 20:43:11 +00:00
name: { { include "grafana.fullname" $ } } -dashboards- { { . } }
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - end } }
{ { - if . Values . dashboardsConfigMaps } }
2022-12-06 20:43:11 +00:00
{ { - range $provider , $name : = . Values . dashboardsConfigMaps } }
2020-12-18 00:46:15 +00:00
- name: dashboards- { { $provider } }
configMap:
name: { { tpl $name $root } }
2022-12-06 20:43:11 +00:00
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - end } }
{ { - if . Values . ldap . enabled } }
- name: ldap
secret:
{ { - if . Values . ldap . existingSecret } }
secretName: { { . Values . ldap . existingSecret } }
{ { - else } }
2022-12-06 20:43:11 +00:00
secretName: { { include "grafana.fullname" . } }
2020-12-18 00:46:15 +00:00
{ { - end } }
items:
- key: ldap-toml
path: ldap.toml
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - if and . Values . persistence . enabled ( eq . Values . persistence . type "pvc" ) } }
2020-12-18 00:46:15 +00:00
- name: storage
persistentVolumeClaim:
2022-08-24 15:13:39 +00:00
claimName: { { tpl ( . Values . persistence . existingClaim | default ( include "grafana.fullname" . ) ) . } }
2023-01-11 12:08:18 +00:00
{ { - else if and . Values . persistence . enabled ( has . Values . persistence . type $sts ) } }
{ { / * nothing * / } }
2022-12-06 20:43:11 +00:00
{ { - else } }
2020-12-18 00:46:15 +00:00
- name: storage
2022-12-06 20:43:11 +00:00
{ { - if . Values . persistence . inMemory . enabled } }
2021-02-26 21:25:43 +00:00
emptyDir:
medium: Memory
2022-12-06 20:43:11 +00:00
{ { - with . Values . persistence . inMemory . sizeLimit } }
sizeLimit: { { . } }
{ { - end } }
{ { - else } }
2020-12-18 00:46:15 +00:00
emptyDir: { }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . alerts . enabled } }
2022-10-27 12:27:42 +00:00
- name: sc-alerts-volume
emptyDir:
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . alerts . sizeLimit } }
sizeLimit: { { . } }
{ { - else } }
{ }
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . dashboards . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-dashboard-volume
2022-08-24 15:13:39 +00:00
emptyDir:
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . dashboards . sizeLimit } }
sizeLimit: { { . } }
{ { - else } }
{ }
{ { - end } }
{ { - if . Values . sidecar . dashboards . SCProvider } }
2020-12-18 00:46:15 +00:00
- name: sc-dashboard-provider
configMap:
2022-12-06 20:43:11 +00:00
name: { { include "grafana.fullname" . } } -config-dashboards
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . datasources . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-datasources-volume
2022-08-24 15:13:39 +00:00
emptyDir:
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . datasources . sizeLimit } }
sizeLimit: { { . } }
{ { - else } }
{ }
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . plugins . enabled } }
2022-04-08 15:08:28 +00:00
- name: sc-plugins-volume
2022-08-24 15:13:39 +00:00
emptyDir:
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . plugins . sizeLimit } }
sizeLimit: { { . } }
{ { - else } }
{ }
{ { - end } }
{ { - end } }
{ { - if . Values . sidecar . notifiers . enabled } }
2020-12-18 00:46:15 +00:00
- name: sc-notifiers-volume
2022-08-24 15:13:39 +00:00
emptyDir:
2022-12-06 20:43:11 +00:00
{ { - with . Values . sidecar . notifiers . sizeLimit } }
sizeLimit: { { . } }
{ { - else } }
{ }
{ { - end } }
{ { - end } }
{ { - range . Values . extraSecretMounts } }
{ { - if . secretName } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
secret:
secretName: { { . secretName } }
defaultMode: { { . defaultMode } }
2022-12-06 20:43:11 +00:00
{ { - with . items } }
items:
{ { - toYaml . | nindent 8 } }
2022-08-24 15:13:39 +00:00
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - else if . projected } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
2022-12-06 20:43:11 +00:00
projected:
{ { - toYaml . projected | nindent 6 } }
{ { - else if . csi } }
2021-02-26 21:25:43 +00:00
- name: { { . name } }
2022-12-06 20:43:11 +00:00
csi:
{ { - toYaml . csi | nindent 6 } }
{ { - end } }
{ { - end } }
{ { - range . Values . extraVolumeMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
2021-04-15 13:03:52 +00:00
{ { - if . existingClaim } }
2020-12-18 00:46:15 +00:00
persistentVolumeClaim:
claimName: { { . existingClaim } }
2021-04-15 13:03:52 +00:00
{ { - else if . hostPath } }
hostPath:
path: { { . hostPath } }
2022-09-16 09:21:38 +00:00
{ { - else if . csi } }
csi:
data:
2022-12-06 20:43:11 +00:00
{ { - toYaml . data | nindent 8 } }
2021-04-15 13:03:52 +00:00
{ { - else } }
emptyDir: { }
{ { - end } }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - range . Values . extraEmptyDirMounts } }
2020-12-18 00:46:15 +00:00
- name: { { . name } }
emptyDir: { }
2022-12-06 20:43:11 +00:00
{ { - end } }
{ { - with . Values . extraContainerVolumes } }
{ { - tpl ( toYaml . ) $root | nindent 2 } }
{ { - end } }
2020-12-18 00:46:15 +00:00
{ { - end } }