diff --git a/jsonnet/kube-prometheus/components/blackbox-exporter.libsonnet b/jsonnet/kube-prometheus/components/blackbox-exporter.libsonnet index 299b29b015e49dd4cb085ba89b854326d19f7cbb..cd3caa312810f8c9efe0e7f2cbf21324cd28410b 100644 --- a/jsonnet/kube-prometheus/components/blackbox-exporter.libsonnet +++ b/jsonnet/kube-prometheus/components/blackbox-exporter.libsonnet @@ -147,7 +147,10 @@ function(params) { clusterRoleBinding: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRoleBinding', - metadata: bb._metadata, + metadata: { + name: 'blackbox-exporter', + labels: bb._config.commonLabels, + }, roleRef: { apiGroup: 'rbac.authorization.k8s.io', kind: 'ClusterRole', diff --git a/jsonnet/kube-prometheus/components/node-exporter.libsonnet b/jsonnet/kube-prometheus/components/node-exporter.libsonnet index c380b8faf0ed1da6faa041d10807ec47366c6a03..ae2d04d7a3183c059781e1d878a227c8a20a9794 100644 --- a/jsonnet/kube-prometheus/components/node-exporter.libsonnet +++ b/jsonnet/kube-prometheus/components/node-exporter.libsonnet @@ -92,7 +92,10 @@ function(params) { clusterRoleBinding: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRoleBinding', - metadata: ne._metadata, + metadata: { + name: ne._config.name, + labels: ne._config.commonLabels, + }, roleRef: { apiGroup: 'rbac.authorization.k8s.io', kind: 'ClusterRole', @@ -108,7 +111,10 @@ function(params) { clusterRole: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRole', - metadata: ne._metadata, + metadata: { + name: ne._config.name, + labels: ne._config.commonLabels, + }, rules: [ { apiGroups: ['authentication.k8s.io'], diff --git a/jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet b/jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet index 6c603b9341026138a9b273be3db33cd91256f1ad..acd8bea978d4c4b1a8a55df8805f37ba1804ab63 100644 --- a/jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet +++ b/jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet @@ -133,6 +133,11 @@ function(params) { labels: pa._config.commonLabels, }, + _metadata_no_ns:: { + name: pa._config.name, + labels: pa._config.commonLabels, + }, + apiService: { apiVersion: 'apiregistration.k8s.io/v1', kind: 'APIService', @@ -322,7 +327,7 @@ function(params) { clusterRole: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRole', - metadata: pa._metadata, + metadata: pa._metadata_no_ns, rules: [{ apiGroups: [''], resources: ['nodes', 'namespaces', 'pods', 'services'], @@ -333,7 +338,7 @@ function(params) { clusterRoleBinding: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRoleBinding', - metadata: pa._metadata, + metadata: pa._metadata_no_ns, roleRef: { apiGroup: 'rbac.authorization.k8s.io', kind: 'ClusterRole', @@ -349,7 +354,7 @@ function(params) { clusterRoleBindingDelegator: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRoleBinding', - metadata: pa._metadata { + metadata: pa._metadata_no_ns { name: 'resource-metrics:system:auth-delegator', }, roleRef: { @@ -367,7 +372,7 @@ function(params) { clusterRoleServerResources: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRole', - metadata: pa._metadata { + metadata: pa._metadata_no_ns { name: 'resource-metrics-server-resources', }, rules: [{ @@ -380,7 +385,7 @@ function(params) { clusterRoleAggregatedMetricsReader: { apiVersion: 'rbac.authorization.k8s.io/v1', kind: 'ClusterRole', - metadata: pa._metadata { + metadata: pa._metadata_no_ns { name: 'system:aggregated-metrics-reader', labels+: { 'rbac.authorization.k8s.io/aggregate-to-admin': 'true', diff --git a/manifests/blackboxExporter-clusterRoleBinding.yaml b/manifests/blackboxExporter-clusterRoleBinding.yaml index 1247e61b1bf85b945a127146dd55f901907ede8a..822288978dfa788da35d6945113889bae737148d 100644 --- a/manifests/blackboxExporter-clusterRoleBinding.yaml +++ b/manifests/blackboxExporter-clusterRoleBinding.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 0.24.0 name: blackbox-exporter - namespace: monitoring roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/manifests/nodeExporter-clusterRole.yaml b/manifests/nodeExporter-clusterRole.yaml index f8d8ed3e442a45639b28ec59f7adf4e2a7866aa3..e1a8e32c23c9091279ce3c65b6114822c14a0d27 100644 --- a/manifests/nodeExporter-clusterRole.yaml +++ b/manifests/nodeExporter-clusterRole.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 1.6.0 name: node-exporter - namespace: monitoring rules: - apiGroups: - authentication.k8s.io diff --git a/manifests/nodeExporter-clusterRoleBinding.yaml b/manifests/nodeExporter-clusterRoleBinding.yaml index 544eba98f378993b5a5a43bd45a43f7ffe1b355f..57a8df85243986f543c3021062beeb35261da0b0 100644 --- a/manifests/nodeExporter-clusterRoleBinding.yaml +++ b/manifests/nodeExporter-clusterRoleBinding.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 1.6.0 name: node-exporter - namespace: monitoring roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/manifests/prometheusAdapter-clusterRole.yaml b/manifests/prometheusAdapter-clusterRole.yaml index 57e49253841df68c046563e9d8588bf0586ce4f3..06ad34c8d7dc6906da3ac11f57500e9f6d40afdb 100644 --- a/manifests/prometheusAdapter-clusterRole.yaml +++ b/manifests/prometheusAdapter-clusterRole.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 0.10.0 name: prometheus-adapter - namespace: monitoring rules: - apiGroups: - "" diff --git a/manifests/prometheusAdapter-clusterRoleAggregatedMetricsReader.yaml b/manifests/prometheusAdapter-clusterRoleAggregatedMetricsReader.yaml index b1f31754d357a52f1bde84446ad5caaba7992b4e..ec5b4f7926802218cb19e498c1ef7d893d733da1 100644 --- a/manifests/prometheusAdapter-clusterRoleAggregatedMetricsReader.yaml +++ b/manifests/prometheusAdapter-clusterRoleAggregatedMetricsReader.yaml @@ -10,7 +10,6 @@ metadata: rbac.authorization.k8s.io/aggregate-to-edit: "true" rbac.authorization.k8s.io/aggregate-to-view: "true" name: system:aggregated-metrics-reader - namespace: monitoring rules: - apiGroups: - metrics.k8s.io diff --git a/manifests/prometheusAdapter-clusterRoleBinding.yaml b/manifests/prometheusAdapter-clusterRoleBinding.yaml index 749fc66a544d7d6740a1229934579c869415afd7..e7a937dad919ecd7b16d0dd5606a70ce7142ba53 100644 --- a/manifests/prometheusAdapter-clusterRoleBinding.yaml +++ b/manifests/prometheusAdapter-clusterRoleBinding.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 0.10.0 name: prometheus-adapter - namespace: monitoring roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/manifests/prometheusAdapter-clusterRoleBindingDelegator.yaml b/manifests/prometheusAdapter-clusterRoleBindingDelegator.yaml index eb8fc9e7d2f604d05fe5e1a22ea560b344d492d2..c653e83fc187c0ab9cfe8e862168b46b9bbd8fe7 100644 --- a/manifests/prometheusAdapter-clusterRoleBindingDelegator.yaml +++ b/manifests/prometheusAdapter-clusterRoleBindingDelegator.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 0.10.0 name: resource-metrics:system:auth-delegator - namespace: monitoring roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/manifests/prometheusAdapter-clusterRoleServerResources.yaml b/manifests/prometheusAdapter-clusterRoleServerResources.yaml index 73d78b06f570e00d78a3738ed8560ff8f7fe9581..a13d63a47b9a208d8e221f6787cfff7203d3e758 100644 --- a/manifests/prometheusAdapter-clusterRoleServerResources.yaml +++ b/manifests/prometheusAdapter-clusterRoleServerResources.yaml @@ -7,7 +7,6 @@ metadata: app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 0.10.0 name: resource-metrics-server-resources - namespace: monitoring rules: - apiGroups: - metrics.k8s.io