From 06ac637fd85e51c50fc25ee630071e553a070105 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Mon, 21 Apr 2025 16:08:57 +0800 Subject: [PATCH] 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. --- today_ai_weather/load.yaml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/today_ai_weather/load.yaml b/today_ai_weather/load.yaml index 3065346..b28b48c 100644 --- a/today_ai_weather/load.yaml +++ b/today_ai_weather/load.yaml @@ -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