-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.libsonnet
38 lines (34 loc) · 1.13 KB
/
config.libsonnet
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
local coredns = import 'github.com/povilasv/coredns-mixin/alerts/alerts.libsonnet';
local utils = import 'lib/utils.libsonnet';
coredns {
_config+:: {
// selector for metrics exposed by coredns plugin
corednsSelector: 'k8s_app="node-local-dns",name!="node-local-dns-metrics"',
// selector for metrics exposed by nodelocaldns pod
nodelocaldnsSelector: 'name="node-local-dns-metrics"',
instanceLabel: 'pod',
grafanaDashboardIDs: {
'nodelocaldns.json': 'ietaejooPhahp9lohc3azeuv7eiv0bootohN5toh',
},
grafana: {
dashboardNamePrefix: '',
dashboardTags: ['nodelocaldns-mixin'],
// The default refresh time for all dashboards, default to 10s
refresh: '60s',
},
},
} + {
prometheusAlerts+::
local addPrefix(rule) = rule {
alert: std.strReplace(rule.alert, 'CoreDNS', 'NodeLocalDNS'),
};
utils.mapRuleGroups(addPrefix),
} + {
prometheusAlerts+::
local addTeam(rule) = rule {
[if 'alert' in rule then 'annotations']+: {
message: std.strReplace(rule.annotations.message, 'CoreDNS', 'NodeLocalDNS'),
},
};
utils.mapRuleGroups(addTeam),
}