1
0
forked from k-space/kube

monitoring: Move to topologySpreadConstraints

This commit is contained in:
Lauri Võsandi 2024-08-21 07:11:06 +03:00
parent 3280b25a83
commit f1a2051838
6 changed files with 44 additions and 30 deletions

View File

@ -31,6 +31,14 @@ kind: Alertmanager
metadata:
name: alertmanager
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: alertmanager
app.kubernetes.io/name: alertmanager
alertmanagerConfigMatcherStrategy:
type: None
alertmanagerConfigNamespaceSelector: {}

View File

@ -188,16 +188,13 @@ spec:
operator: Equal
value: monitoring
effect: NoSchedule
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- blackbox-exporter
topologyKey: "kubernetes.io/hostname"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: blackbox-exporter
---
kind: Service
apiVersion: v1

View File

@ -77,6 +77,13 @@ spec:
envFrom:
- secretRef:
name: mikrotik-exporter
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: mikrotik-exporter
nodeSelector:
dedicated: monitoring
tolerations:

View File

@ -45,16 +45,13 @@ spec:
operator: Equal
value: monitoring
effect: NoSchedule
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- ping-exporter
topologyKey: "kubernetes.io/hostname"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: ping-exporter
---
kind: Service
apiVersion: v1

View File

@ -15,6 +15,14 @@ kind: Prometheus
metadata:
name: prometheus
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: prometheus
app.kubernetes.io/name: prometheus
nodeSelector:
dedicated: monitoring
tolerations:

View File

@ -45,16 +45,13 @@ spec:
operator: Equal
value: monitoring
effect: NoSchedule
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- snmp-exporter
topologyKey: "kubernetes.io/hostname"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: snmp-exporter
---
kind: Service
apiVersion: v1