helmfile.yaml
4.63 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
environments:
default:
values:
- namespace: monitoring
namePrefix: ""
grafana:
oauth:
enabled: false
authUrl: ""
tokenUrl: ""
userinfoUrl: ""
clientId: ""
clientSecret: ""
virtualService:
enabled: true
jsonPatches: []
strategicMergePatches: []
gateways:
- default/cluster-local-gateway
vhost: grafana.local
repositories:
- name: prometheus-community
url: https://prometheus-community.github.io/helm-charts
- name: kube-state-metrics
url: https://kubernetes.github.io/kube-state-metrics
- name: grafana
url: https://grafana.github.io/helm-charts
---
releases:
- name: monitoring-config
chart: ./charts/monitoring-config
namespace: {{ .Values.namespace }}
values:
- set-common-values.yaml.gotmpl
jsonPatches:
- target:
kind: ConfigMap
name: {{ .Values.namePrefix }}grafana-generic-oauth-config
namespace: {{ .Values.namespace }}
version: v1
patch:
- op: replace
path: /data/GF_SERVER_ROOT_URL
value: https://{{ .Values.grafana.virtualService.vhost }}
{{- if .Values.grafana.oauth.enabled }}
- op: replace
path: /data/GF_AUTH_GENERIC_OAUTH_AUTH_URL
value: {{ .Values.grafana.oauth.authUrl }}
- op: replace
path: /data/GF_AUTH_GENERIC_OAUTH_TOKEN_URL
value: {{ .Values.grafana.oauth.tokenUrl }}
- op: replace
path: /data/GF_AUTH_GENERIC_OAUTH_API_URL
value: {{ .Values.grafana.oauth.userinfoUrl }}
{{- end }}
{{- if .Values.grafana.oauth.enabled }}
- target:
kind: Secret
name: {{ .Values.namePrefix }}grafana-generic-oauth-secret
namespace: {{ .Values.namespace }}
version: v1
patch:
- op: replace
path: /stringData/GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET
value: {{ .Values | get "grafana.keycloak.client-id" ""}}
- op: replace
path: /stringData/GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET
value: {{ .Values | get "grafana.keycloak.client-secret" ""}}
{{- end }}
- name: kube-prometheus-stack
chart: prometheus-community/kube-prometheus-stack
namespace: {{ .Values.namespace }}
values:
- set-common-values.yaml.gotmpl
- prometheus:
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
probeSelectorNilUsesHelmValues: false
disableValidation: true
strategicMergePatches:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.namePrefix }}kube-prometheus-stack-grafana
namespace: {{ .Values.namespace }}
spec:
template:
spec:
containers:
- name: grafana
{{- if .Values.grafana.oauth.enabled }}
envFrom:
- configMapRef:
name: {{ .Values.namePrefix }}grafana-generic-oauth-config
- secretRef:
name: {{ .Values.namePrefix }}grafana-generic-oauth-secret
{{- end }}
- name: monitoring-istio
chart: ./charts/monitoring-istio
namespace: {{ .Values.namespace }}
values:
- set-common-values.yaml.gotmpl
jsonPatches:
{{- if .Values.grafana.virtualService.enabled }}
- target:
kind: VirtualService
name: {{ .Values.namePrefix }}grafana
namespace: {{ .Values.namespace }}
version: v1beta3
group: networking.istio.io
patch:
- op: replace
path: /spec/http/0/route/0/destination/host
value: {{ .Values.namePrefix }}grafana
{{- end }}
{{- if not (empty (.Values.grafana.virtualService.jsonPatches)) }}
{{- .Values.grafana.virtualService.jsonPatches | toYaml | indent 6 }}
{{- end }}
strategicMergePatches:
- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ .Values.namePrefix }}grafana
namespace: {{ .Values.namespace }}
{{- if .Values.grafana.virtualService.enabled }}
spec:
hosts:
- {{ .Values.grafana.virtualService.vhost }}
gateways:
{{- range $gateway_index, $gateway := .Values.grafana.virtualService.gateways }}
- {{ $gateway | quote }}
{{- end }}
{{- else }}
$patch: delete
{{- end }}