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: metadata:
name: alertmanager name: alertmanager
spec: spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/instance: alertmanager
app.kubernetes.io/name: alertmanager
alertmanagerConfigMatcherStrategy: alertmanagerConfigMatcherStrategy:
type: None type: None
alertmanagerConfigNamespaceSelector: {} alertmanagerConfigNamespaceSelector: {}

View File

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

View File

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

View File

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

View File

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

View File

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