-
Notifications
You must be signed in to change notification settings - Fork 0
/
grafana-deployment.yaml
111 lines (109 loc) · 3.76 KB
/
grafana-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ include "hawk.fullname" . }}-grafana"
labels:
{{- include "hawk.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.grafana.replicaCount }}
selector:
matchLabels:
app: "{{ include "hawk.fullname" . }}-grafana"
template:
metadata:
{{- with .Values.grafana.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: "{{ include "hawk.fullname" . }}-grafana"
sidecar.istio.io/inject: "false"
spec:
{{- with .Values.grafana.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hawk.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.grafana.podSecurityContext | nindent 8 }}
containers:
- name: "{{ include "hawk.fullname" . }}-grafana"
securityContext:
{{- toYaml .Values.grafana.securityContext | nindent 12 }}
image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag | default "8.5.0" }}"
imagePullPolicy: {{ .Values.grafana.image.pullPolicy }}
env:
- name: GF_INSTALL_PLUGINS
value: simpod-json-datasource 0.3.0 , novatec-sdg-panel 4.0.3
ports:
- name: http
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
volumeMounts:
- mountPath: /etc/grafana/provisioning/datasources
name: {{ include "hawk.fullname" . }}-grafana-datasources
readOnly: false
- mountPath: /var/lib/grafana/dashboards/Hawk
name: {{ include "hawk.fullname" . }}-grafana-dashboards
readOnly: false
- mountPath: /etc/grafana/provisioning/dashboards
name: {{ include "hawk.fullname" . }}-grafana-providers
- mountPath: /etc/grafana/grafana.ini
subPath: grafana.ini
name: {{ include "hawk.fullname" . }}-grafana-config
readOnly: true
resources:
{{- toYaml .Values.grafana.resources | nindent 12 }}
{{- with .Values.grafana.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.grafana.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: {{ include "hawk.fullname" . }}-grafana-config
configMap:
defaultMode: 420
name: {{ include "hawk.fullname" . }}-grafana-config
- name: {{ include "hawk.fullname" . }}-grafana-datasources
configMap:
defaultMode: 420
name: {{ include "hawk.fullname" . }}-grafana-datasource
- name: {{ include "hawk.fullname" . }}-grafana-dashboards
configMap:
defaultMode: 420
name: {{ include "hawk.fullname" . }}-grafana-dashboards
- name: {{ include "hawk.fullname" . }}-grafana-providers
configMap:
defaultMode: 420
name: {{ include "hawk.fullname" . }}-grafana-providers
{{- with .Values.grafana.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: "{{ include "hawk.fullname" . }}-grafana"
labels:
{{- include "hawk.labels" . | nindent 4 }}
spec:
type: {{ .Values.grafana.service.type }}
ports:
- port: {{ .Values.grafana.service.port }}
targetPort: 3000
protocol: TCP
name: http
selector:
app: "{{ include "hawk.fullname" . }}-grafana"