feat: change deployment to daemonset with scheduling rules

- Change kind from Deployment to DaemonSet
- Remove previous node selector configuration
- Add tolerations for scheduling restrictions
- Introduce node affinity for specific hostnames

These changes facilitate deployment across all nodes instead of a single replica,
allowing for improved resource utilization and management in the
Kubernetes environment.
This commit is contained in:
songtianlun 2025-04-21 16:08:57 +08:00
parent 4ae38989f6
commit 06ac637fd8

View File

@ -1,12 +1,13 @@
apiVersion: apps/v1
kind: Deployment
#kind: Deployment
kind: DaemonSet
metadata:
name: app
namespace: taw
labels:
app: taw
spec:
replicas: 1
#replicas: 1
selector:
matchLabels:
app: taw
@ -16,9 +17,25 @@ spec:
labels:
app: taw
spec:
nodeSelector:
region: us
dc: vkus
#nodeSelector:
# region: us
# dc: vkus
tolerations:
- key: "scheduling"
operator: "Equal"
value: "restricted"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- vkvm-us1
- vkvm-us2
- zgocloud-us1
containers:
- name: app
image: songtianlun/today_ai_weather:main