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
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
#kind: Deployment
|
||||||
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
name: app
|
name: app
|
||||||
namespace: taw
|
namespace: taw
|
||||||
labels:
|
labels:
|
||||||
app: taw
|
app: taw
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
#replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: taw
|
app: taw
|
||||||
@ -16,9 +17,25 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: taw
|
app: taw
|
||||||
spec:
|
spec:
|
||||||
nodeSelector:
|
#nodeSelector:
|
||||||
region: us
|
# region: us
|
||||||
dc: vkus
|
# 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:
|
containers:
|
||||||
- name: app
|
- name: app
|
||||||
image: songtianlun/today_ai_weather:main
|
image: songtianlun/today_ai_weather:main
|
||||||
|
Loading…
Reference in New Issue
Block a user