From f033542d1395bc1c7aaee8d702a1cd3721393306 Mon Sep 17 00:00:00 2001 From: Hisashi A Date: Wed, 21 Aug 2024 14:39:07 +0700 Subject: [PATCH] feat: rolling update one pod at a time, adjust k8s resources --- k8s/templates/deployment.yaml | 5 +++++ k8s/values.prod.yaml | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/k8s/templates/deployment.yaml b/k8s/templates/deployment.yaml index 61f868f..021210e 100644 --- a/k8s/templates/deployment.yaml +++ b/k8s/templates/deployment.yaml @@ -11,6 +11,11 @@ metadata: {{- end }} spec: replicas: {{ .Values.replica }} + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: {{ .Values.strategy.rollingUpdate.maxUnavailable }} + maxSurge: {{ .Values.strategy.rollingUpdate.maxSurge }} selector: matchLabels: app: {{ .Values.name }} diff --git a/k8s/values.prod.yaml b/k8s/values.prod.yaml index c3e81f4..7ec2994 100644 --- a/k8s/values.prod.yaml +++ b/k8s/values.prod.yaml @@ -8,11 +8,16 @@ replica: 2 resource: requests: - memory: 16Gi - cpu: 4 + memory: "100Mi" + cpu: 0.1 limits: - memory: 32Gi - cpu: 8 + memory: "300Mi" + cpu: 0.3 + +strategy: + rollingUpdate: + maxUnavailable: 0 # Ensures at least one pod is always available + maxSurge: 1 # Only one pod is created at a time affinity: affinityTolerations: