example external custom alertmanager template

This commit is contained in:
Blizter
2020-11-26 12:54:35 -05:00
parent 8b3fb3e2c5
commit a01820692c
3 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
local configmap(name, namespace, data) = {
apiVersion: "v1",
kind: "ConfigMap",
metadate : {
name: name,
namespace: namespace,
},
data: data,
};
local kp =
// different libsonnet imported
{
configmap+:: {
'alert-templates': configmap(
'alertmanager-alert-template.tmpl',
$._config.namespace,
{"data": importstr 'alertmanager-alert-template.tmpl'},
)
},
alertmanager+:{
spec+:{
# the important field configmaps:
configMaps: ['alert-templates',], # goes to etc/alermanager/configmaps
},
},
};
{ [name + '-configmap']: kp.configmap[name] for name in std.objectFields(kp.configmap) }