2 # Copyright 2018 Intel Corporation, Inc
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 {{- if .Values.global.grafana.enabled -}}
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
25 app: {{ include "common.name" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27 release: {{ include "common.release" . }}
28 heritage: {{ .Release.Service }}
30 replicas: {{ .Values.replicaCount }}
33 app: {{ include "common.name" . }}
37 app: {{ include "common.name" . }}
38 release: {{ include "common.release" . }}
39 name: {{ include "common.name" . }}
41 {{- if .Values.dashboards }}
43 - name: {{ include "common.name" . }}-download-dashboards
44 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.downloadDashboardsImage.repository }}:{{ .Values.downloadDashboardsImage.tag }}
45 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 command: ["sh", "/etc/grafana/download_dashboards.sh"]
48 - name: {{ include "common.fullname" . }}-config
49 mountPath: "/etc/grafana/download_dashboards.sh"
50 subPath: download_dashboards.sh
51 - name: {{ include "common.fullname" . }}-storage
52 mountPath: {{ .Values.persistence.containerMountPath }}
56 - name: {{ include "common.name" . }}
57 image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
58 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 {{ toYaml .Values.resources | indent 10 }}
62 - containerPort: {{ .Values.service.internalPort }}
64 {{- if .Values.liveness.enabled }}
68 port: {{ .Values.service.internalPort }}
69 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
70 periodSeconds: {{ .Values.liveness.periodSeconds }}
71 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
73 {{- if .Values.readiness.enabled }}
77 port: {{ .Values.service.internalPort }}
78 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
80 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
83 - name: {{ include "common.fullname" . }}-config
84 mountPath: "/etc/grafana/grafana.ini"
86 - name: {{ include "common.fullname" . }}-storage
87 mountPath: {{ .Values.persistence.containerMountPath }}
88 {{- if .Values.dashboards }}
89 {{- range $provider, $dashboards := .Values.dashboards }}
90 {{- range $key, $value := $dashboards }}
91 {{- if hasKey $value "json" }}
92 - name: {{ include "common.fullname" $ }}-dashboards-{{ $provider }}
93 mountPath: "/var/lib/grafana/dashboards/{{ $provider }}/{{ $key }}.json"
94 subPath: "{{ $key }}.json"
99 {{- if .Values.datasources }}
100 - name: {{ include "common.fullname" . }}-config
101 mountPath: "/etc/grafana/provisioning/datasources/datasources.yaml"
102 subPath: datasources.yaml
104 {{- if .Values.dashboardProviders }}
105 - name: {{ include "common.fullname" . }}-config
106 mountPath: "/etc/grafana/provisioning/dashboards/dashboardproviders.yaml"
107 subPath: dashboardproviders.yaml
109 {{- if .Values.nodeSelector }}
111 {{ toYaml .Values.nodeSelector | indent 8 }}
113 {{- if .Values.affinity }}
115 {{ toYaml .Values.affinity | indent 8 }}
118 - name: {{ include "common.fullname" . }}-config
120 name: {{ include "common.fullname" . }}
121 - name: {{ include "common.fullname" . }}-storage
122 {{- if .Values.persistence.enabled }}
123 persistentVolumeClaim:
124 claimName: {{ include "common.fullname" . }}
128 {{- if .Values.dashboards }}
129 {{- range keys .Values.dashboards }}
130 - name: {{ include "common.fullname" $ }}-dashboards-{{ . }}
132 name: {{ include "common.fullname" $ }}-dashboards-{{ . }}
136 - name: "{{ include "common.namespace" . }}-docker-registry-key"
137 restartPolicy: Always