@@ -20,6 +20,7 @@ local defaults = {
2020 limits: { cpu: '200m' , memory: '200Mi' },
2121 },
2222
23+ alertings: {},
2324 dashboards: {},
2425 rawDashboards: {},
2526 folderDashboards: {},
@@ -86,6 +87,19 @@ function(params) {
8687 } + if g._config.ldap != null then { 'ldap.toml' : g._config.ldap } else {},
8788 },
8889
90+ alertingsDefinition: {
91+ apiVersion: 'v1' ,
92+ kind: 'Secret' ,
93+ type: 'Opaque' ,
94+ metadata: g._metadata {
95+ name: 'grafana-alertings' ,
96+ },
97+ stringData: {
98+ [name]: std.manifestJsonEx (g._config.alertings[name], ' ' )
99+ for name in std.objectFields (g._config.alertings)
100+ },
101+ },
102+
89103 dashboardDefinitions: {
90104 apiVersion: 'v1' ,
91105 kind: 'ConfigMapList' ,
@@ -213,6 +227,16 @@ function(params) {
213227 readOnly: false ,
214228 };
215229
230+ local alertingsVolume = {
231+ name: 'grafana-alertings' ,
232+ secret: { secretName: g.alertingsDefinition.metadata.name },
233+ };
234+ local alertingsVolumeMount = {
235+ name: alertingsVolume.name,
236+ mountPath: '/etc/grafana/provisioning/alerting' ,
237+ readOnly: false ,
238+ };
239+
216240 local datasourcesVolume = {
217241 name: 'grafana-datasources' ,
218242 secret: { secretName: g.dashboardDatasources.metadata.name },
@@ -251,6 +275,7 @@ function(params) {
251275 datasourcesVolumeMount,
252276 dashboardsVolumeMount,
253277 pluginTmpVolumeMount,
278+ alertingsVolumeMount,
254279 ] +
255280 [
256281 {
@@ -280,6 +305,7 @@ function(params) {
280305 datasourcesVolume,
281306 dashboardsVolume,
282307 pluginTmpVolume,
308+ alertingsVolume,
283309 ] +
284310 [
285311 {
0 commit comments