let example generate
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
local configmap(name, namespace, data) = {
|
local configmap(name, namespace, data) = {
|
||||||
apiVersion: "v1",
|
apiVersion: 'v1',
|
||||||
kind: "ConfigMap",
|
kind: 'ConfigMap',
|
||||||
metadata: {
|
metadata: {
|
||||||
name: name,
|
name: name,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
@@ -11,18 +11,25 @@ local configmap(name, namespace, data) = {
|
|||||||
local kp =
|
local kp =
|
||||||
// different libsonnet imported
|
// different libsonnet imported
|
||||||
{
|
{
|
||||||
|
values+:: {
|
||||||
|
common+: {
|
||||||
|
namespace: 'monitoring',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
alertmanager+:: {
|
||||||
|
alertmanager+: {
|
||||||
|
spec+: {
|
||||||
|
// the important field configmaps:
|
||||||
|
configMaps: ['alert-templates'], // goes to etc/alermanager/configmaps
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
configmap+:: {
|
configmap+:: {
|
||||||
'alert-templates': configmap(
|
'alert-templates': configmap(
|
||||||
'alertmanager-alert-template.tmpl',
|
'alertmanager-alert-template.tmpl',
|
||||||
$._config.namespace,
|
$.values.common.namespace, // could be $._config.namespace to assign namespace once
|
||||||
{"data": importstr 'alertmanager-alert-template.tmpl'},
|
{ 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) }
|
{ [name + '-configmap']: kp.configmap[name] for name in std.objectFields(kp.configmap) }
|
||||||
|
|||||||
Reference in New Issue
Block a user