Skip to content

Commit

Permalink
Removes control-plane affinity from Prometheus (#1625)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSalisbury authored May 23, 2024
1 parent 78a50d1 commit 4947e28
Show file tree
Hide file tree
Showing 18 changed files with 1 addition and 128 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 0 additions & 16 deletions service/controller/resource/monitoring/prometheus/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4947e28

Please sign in to comment.