Skip to content
Snippets Groups Projects
Unverified Commit 373e2b41 authored by Philip Gough's avatar Philip Gough Committed by GitHub
Browse files

Merge pull request #1678 from dnsmichi/docs-mon-namespaces-0-8-values

Docs: Use `values` config in 'Monitoring other namespaces' example
parents 2e78414b 16f3640e
No related merge requests found
...@@ -22,22 +22,35 @@ This is done in the variable `prometheus.roleSpecificNamespaces`. You usually se ...@@ -22,22 +22,35 @@ This is done in the variable `prometheus.roleSpecificNamespaces`. You usually se
Example to create the needed `Role` and `RoleBinding` for the Namespace `foo` : Example to create the needed `Role` and `RoleBinding` for the Namespace `foo` :
``` ```
local kp = (import 'kube-prometheus/main.libsonnet') + { local kp =
_config+:: { (import 'kube-prometheus/main.libsonnet') +
{
values+:: {
common+: {
namespace: 'monitoring', namespace: 'monitoring',
},
prometheus+:: { prometheus+:: {
namespaces: ["default", "kube-system", "foo"], namespaces: ["default", "kube-system", "monitoring", "foo"],
}, },
}, },
}; };
{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } + { 'setup/0namespace-namespace': kp.kubePrometheus.namespace } +
{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } + {
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } + ['setup/prometheus-operator-' + name]: kp.prometheusOperator[name]
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } + for name in std.filter((function(name) name != 'serviceMonitor' && name != 'prometheusRule'), std.objectFields(kp.prometheusOperator))
} +
// 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 } +
{ 'kube-prometheus-prometheusRule': kp.kubePrometheus.prometheusRule } +
{ ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } + { ['alertmanager-' + name]: kp.alertmanager[name] for name in std.objectFields(kp.alertmanager) } +
{ ['blackbox-exporter-' + name]: kp.blackboxExporter[name] for name in std.objectFields(kp.blackboxExporter) } +
{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } +
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +
{ ['kubernetes-' + name]: kp.kubernetesControlPlane[name] for name in std.objectFields(kp.kubernetesControlPlane) }
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
{ ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } { ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) }
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment