Skip to content
Snippets Groups Projects
Unverified Commit 2c25661f authored by Paweł Krupa's avatar Paweł Krupa Committed by GitHub
Browse files

Merge pull request #1476 from paulfantom/alerting

parents 102d4dc2 dbc64a03
No related branches found
No related tags found
No related merge requests found
......@@ -2,20 +2,21 @@ local defaults = {
local defaults = self,
// Convention: Top-level fields related to CRDs are public, other fields are hidden
// If there is no CRD for the component, everything is hidden in defaults.
name:: error 'must provide name',
namespace:: error 'must provide namespace',
version: error 'must provide version',
image: error 'must provide image',
resources: {
requests: { memory: '400Mi' },
},
name:: error 'must provide name',
//TODO: remove alertmanagerName and convert to plain 'alerting' object
alertmanagerName:: error 'must provide alertmanagerName',
//TODO(paulfantom): remove alertmanagerName after release-0.10 and convert to plain 'alerting' object.
alertmanagerName:: '',
alerting: {},
namespaces:: ['default', 'kube-system', defaults.namespace],
replicas: 2,
externalLabels: {},
enableFeatures: [],
ruleSelector: {},
commonLabels:: {
'app.kubernetes.io/name': 'prometheus',
'app.kubernetes.io/version': defaults.version,
......@@ -27,7 +28,6 @@ local defaults = {
for labelName in std.objectFields(defaults.commonLabels)
if !std.setMember(labelName, ['app.kubernetes.io/version'])
} + { prometheus: defaults.name },
ruleSelector: {},
mixin:: {
ruleLabels: {},
_config: {
......@@ -273,7 +273,7 @@ function(params) {
serviceMonitorNamespaceSelector: {},
nodeSelector: { 'kubernetes.io/os': 'linux' },
resources: p._config.resources,
alerting: {
alerting: if p._config.alerting != {} then p._config.alerting else {
alertmanagers: [{
namespace: p._config.namespace,
name: 'alertmanager-' + p._config.alertmanagerName,
......
......@@ -91,7 +91,14 @@ local utils = import './lib/utils.libsonnet';
version: $.values.common.versions.prometheus,
image: $.values.common.images.prometheus,
name: 'k8s',
alertmanagerName: $.values.alertmanager.name,
alerting: {
alertmanagers: [{
namespace: $.values.common.namespace,
name: 'alertmanager-' + $.values.alertmanager.name,
port: $.alertmanager.service.spec.ports[0].name,
apiVersion: 'v2',
}],
},
mixin+: { ruleLabels: $.values.common.ruleLabels },
},
prometheusAdapter: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment