diff --git a/build/kube-prometheus/common-template.jsonnet b/build/kube-prometheus/common-template.jsonnet index b286a8f63..ca963ff9d 100644 --- a/build/kube-prometheus/common-template.jsonnet +++ b/build/kube-prometheus/common-template.jsonnet @@ -816,4 +816,5 @@ local kp = (if std.objectHas(vars, 'grafana_ingress_host') then { [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) } else {}) + (if std.objectHas(vars, 'prometheus_ingress_host') then { [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) } else {}) + // Rendering prometheusRules object. This is an object compatible with prometheus-operator CRD definition for prometheusRule +{ [o._config.name + '-grafana-dashboards']: o.grafanaDashboards for o in std.filter((function(o) o.grafanaDashboards != null), mixins) } + { [o._config.name + '-prometheus-rules']: o.prometheusRules for o in std.filter((function(o) o.prometheusRules != null), mixins) }