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:
parent
4ae38989f6
commit
06ac637fd8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user