From 4ee0c86a03a7be6c4744bbc5eeb4a78a7d7fc4cc Mon Sep 17 00:00:00 2001 From: CarlosEDP Date: Mon, 25 Mar 2019 18:01:00 -0300 Subject: [PATCH] Fix for the unused namespaces in case of disabling additional addons --- base_operator_stack.jsonnet | 2 +- elasticsearch_exporter.jsonnet | 4 ++++ manifests/prometheus-roleBindingSpecificNamespaces.yaml | 4 ++-- manifests/prometheus-roleSpecificNamespaces.yaml | 4 ++-- metallb.jsonnet | 5 +++++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/base_operator_stack.jsonnet b/base_operator_stack.jsonnet index eba4af2..6ffa13b 100644 --- a/base_operator_stack.jsonnet +++ b/base_operator_stack.jsonnet @@ -13,7 +13,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; prometheus+:: { names: 'k8s', replicas: 1, - namespaces: ['default', 'kube-system', 'monitoring', 'logging', 'metallb-system'], + namespaces: ['default', 'kube-system', 'monitoring'], }, alertmanager+:: { diff --git a/elasticsearch_exporter.jsonnet b/elasticsearch_exporter.jsonnet index 6313022..111bf69 100644 --- a/elasticsearch_exporter.jsonnet +++ b/elasticsearch_exporter.jsonnet @@ -13,6 +13,10 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; elasticExporter: 'justwatch/elasticsearch_exporter', }, + prometheus+:: { + namespaces+:: ['logging'], + }, + // Add custom dashboards grafanaDashboards+:: { 'elasticsearch-dashboard.json': (import 'grafana-dashboards/elasticsearch-dashboard.json'), diff --git a/manifests/prometheus-roleBindingSpecificNamespaces.yaml b/manifests/prometheus-roleBindingSpecificNamespaces.yaml index 888e95a..62fa122 100644 --- a/manifests/prometheus-roleBindingSpecificNamespaces.yaml +++ b/manifests/prometheus-roleBindingSpecificNamespaces.yaml @@ -43,7 +43,7 @@ items: kind: RoleBinding metadata: name: prometheus-k8s - namespace: logging + namespace: metallb-system roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -56,7 +56,7 @@ items: kind: RoleBinding metadata: name: prometheus-k8s - namespace: metallb-system + namespace: logging roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/manifests/prometheus-roleSpecificNamespaces.yaml b/manifests/prometheus-roleSpecificNamespaces.yaml index 378b939..ddeb547 100644 --- a/manifests/prometheus-roleSpecificNamespaces.yaml +++ b/manifests/prometheus-roleSpecificNamespaces.yaml @@ -52,7 +52,7 @@ items: kind: Role metadata: name: prometheus-k8s - namespace: logging + namespace: metallb-system rules: - apiGroups: - "" @@ -68,7 +68,7 @@ items: kind: Role metadata: name: prometheus-k8s - namespace: metallb-system + namespace: logging rules: - apiGroups: - "" diff --git a/metallb.jsonnet b/metallb.jsonnet index 1e57692..8500a9d 100644 --- a/metallb.jsonnet +++ b/metallb.jsonnet @@ -3,6 +3,11 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; { _config+:: { namespace: 'monitoring', + + prometheus+:: { + namespaces+:: ['metallb-system'], + }, + }, metallb+:: {