Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kube-prometheus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
prometheus-operator
kube-prometheus
Commits
1ffd6dfb
Commit
1ffd6dfb
authored
Oct 24, 2021
by
Blizter
Browse files
Options
Downloads
Patches
Plain Diff
let example generate
parent
7c748b98
Branches
master
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/alertmanager-config-template-external.jsonnet
+28
-21
28 additions, 21 deletions
examples/alertmanager-config-template-external.jsonnet
with
28 additions
and
21 deletions
examples/alertmanager-config-template-external.jsonnet
+
28
−
21
View file @
1ffd6dfb
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) = {
...
@@ -11,18 +11,25 @@ local configmap(name, namespace, data) = {
local
kp
=
local
kp
=
// different libsonnet imported
// different libsonnet imported
{
{
configmap
+::
{
values
+::
{
'alert-templates'
:
configmap
(
common
+:
{
'alertmanager-alert-template.tmpl'
,
namespace
:
'monitoring'
,
$
.
_config
.
namespace
,
{
"data"
:
importstr
'alertmanager-alert-template.tmpl'
},
)
},
},
},
alertmanager
+::
{
alertmanager
+:
{
alertmanager
+:
{
spec
+:
{
spec
+:
{
# the important field configmaps:
// the important field configmaps:
configMaps
:
[
'alert-templates'
,],
# goes to etc/alermanager/configmaps
configMaps
:
[
'alert-templates'
],
// goes to etc/alermanager/configmaps
},
},
},
},
},
configmap
+::
{
'alert-templates'
:
configmap
(
'alertmanager-alert-template.tmpl'
,
$
.
values
.
common
.
namespace
,
// could be $._config.namespace to assign namespace once
{
data
:
importstr
'alertmanager-alert-template.tmpl'
},
),
},
};
};
{
[
name
+
'-configmap'
]:
kp
.
configmap
[
name
]
for
name
in
std
.
objectFields
(
kp
.
configmap
)
}
{
[
name
+
'-configmap'
]:
kp
.
configmap
[
name
]
for
name
in
std
.
objectFields
(
kp
.
configmap
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment