diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f069eb2..12c57e608 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Remove prometheus remote write agent configuration when mimir is enabled. +- Remove unnecessary prometheus control-plane affinity. ## [4.75.0] - 2024-05-13 diff --git a/service/controller/resource/monitoring/prometheus/resource.go b/service/controller/resource/monitoring/prometheus/resource.go index 8765b02f9..62a6de42b 100644 --- a/service/controller/resource/monitoring/prometheus/resource.go +++ b/service/controller/resource/monitoring/prometheus/resource.go @@ -164,22 +164,6 @@ func toPrometheus(ctx context.Context, v interface{}, config Config) (metav1.Obj }, Key: key.PrometheusAdditionalScrapeConfigsName(), }, - Affinity: &corev1.Affinity{ - NodeAffinity: &corev1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{ - NodeSelectorTerms: []corev1.NodeSelectorTerm{ - { - MatchExpressions: []corev1.NodeSelectorRequirement{ - { - Key: "node-role.kubernetes.io/control-plane", - Operator: corev1.NodeSelectorOpDoesNotExist, - }, - }, - }, - }, - }, - }, - }, EnableRemoteWriteReceiver: true, ExternalLabels: map[string]string{ key.ClusterIDKey: key.ClusterID(cluster), diff --git a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-1-capa-mc.golden b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-1-capa-mc.golden index cc8e3df12..5969974a7 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-1-capa-mc.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-1-capa-mc.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-2-capa.golden b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-2-capa.golden index 92413bcdc..9840a90ab 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-2-capa.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-2-capa.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-3-capz.golden b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-3-capz.golden index c63ba9029..0e1703ed9 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-3-capz.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-3-capz.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-4-eks.golden b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-4-eks.golden index 6144ec40c..cbabaef4f 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-4-eks.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-4-eks.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-5-gcp.golden b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-5-gcp.golden index 2c73a7c0c..4501855ea 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/capi/case-5-gcp.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/capi/case-5-gcp.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-1-vintage-mc.golden b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-1-vintage-mc.golden index fcaf8588c..659d4da83 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-1-vintage-mc.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-1-vintage-mc.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /var/run/secrets/kubernetes.io/serviceaccount/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-2-aws-v16.golden b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-2-aws-v16.golden index 657827c96..48fa67da8 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-2-aws-v16.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-2-aws-v16.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-3-aws-v18.golden b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-3-aws-v18.golden index 587b04a8f..d625f318f 100644 --- a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-3-aws-v18.golden +++ b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-3-aws-v18.golden @@ -14,13 +14,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-1-capa-mc.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-1-capa-mc.golden index d0c3f8269..94f6e6389 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-1-capa-mc.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-1-capa-mc.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-2-capa.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-2-capa.golden index 3ce90f0d3..54a573b55 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-2-capa.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-2-capa.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-3-capz.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-3-capz.golden index 0f298c706..0ef8f2748 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-3-capz.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-3-capz.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-4-eks.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-4-eks.golden index c27083322..e47ff1750 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-4-eks.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-4-eks.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-5-gcp.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-5-gcp.golden index 595dc624a..6162c5c64 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-5-gcp.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/capi/case-5-gcp.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-1-vintage-mc.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-1-vintage-mc.golden index 26f0c202b..11e26ceee 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-1-vintage-mc.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-1-vintage-mc.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /var/run/secrets/kubernetes.io/serviceaccount/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-2-aws-v16.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-2-aws-v16.golden index aa64f8f0b..eea244c23 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-2-aws-v16.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-2-aws-v16.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-3-aws-v18.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-3-aws-v18.golden index f069751c7..24d46e486 100644 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-3-aws-v18.golden +++ b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-3-aws-v18.golden @@ -11,13 +11,6 @@ spec: additionalScrapeConfigs: key: prometheus-additional.yaml name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist apiserverConfig: authorization: credentialsFile: /etc/prometheus/secrets/cluster-certificates/token