Skip to content

Commit

Permalink
feat: rolling update one pod at a time, adjust k8s resources
Browse files Browse the repository at this point in the history
  • Loading branch information
hasakura12 committed Aug 21, 2024
1 parent c373dc9 commit f033542
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions k8s/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 9 additions & 4 deletions k8s/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f033542

Please sign in to comment.