feat: add node affinity for DaemonSet scheduling

- Implement node affinity to prevent scheduling on vkvm-us2
- Update affinity section in daemonset.yaml
- Ensure that the DaemonSet runs only on specific nodes

This change introduces a node affinity rule to the DaemonSet configuration,
allowing it to avoid scheduling on nodes labeled with `kubernetes.io/hostname`
set to `vkvm-us2`. This helps to ensure resource allocation and performance
by restricting the DaemonSet to the desired nodes.
This commit is contained in:
songtianlun 2025-04-22 16:06:51 +08:00
parent e5e9bfd9f3
commit f27876c6ab

View File

@ -14,10 +14,15 @@ spec:
spec:
#nodeSelector:
# kubernetes.io/hostname: "vkvm-us1"
#affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: NotIn
values:
- vkvm-us2
# - matchExpressions:
# #- key: region
# # operator: NotIn