-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalert
29 lines (26 loc) · 1.42 KB
/
alert
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
local k = import 'github.com/jsonnet-libs/k8s-libsonnet/1.22/main.libsonnet';
local secret = k.core.v1.secret;
local applyODPLabels = import 'odp-labels.libsonnet';
local kp = (import 'dp-corebe.libsonnet') + {
values+:: {
odp+: {},
alertmanager+: {},
},
extraManifests: [
(import 'my-alert.jsonnet') + {
prometheusRule+: { metadata +: { namespace: $.values.common.namespace } },
},
(import 'my-alert2.jsonnet') + {
prometheusRule+: { metadata +: { namespace: $.values.common.namespace } },
},
],
};
// serviceMonitor and prometheusRule are separated so that they can be created after the CRDs are ready
{ 'prometheus-operator-serviceMonitor': kp.prometheusOperator.serviceMonitor } +
{ 'prometheus-operator-prometheusRule': kp.prometheusOperator.prometheusRule } +
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +
{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
{ ['kubernetes-' + name]: kp.kubernetesControlPlane[name] for name in std.objectFields(kp.kubernetesControlPlane) } +
{ ['extra-manifests-' + name]: kp.extraManifests[name] for name in std.range(0, std.length(kp.extraManifests) - 1) }