노드 다운사이징(2×1OCPU/6GB) 이후 backend CPU request 500m이 노드 한도 의 절반을 차지해 rollingUpdate 데드락 발생. 임시 패치(maxSurge=0/ maxUnavailable=1) 상태를 합리화하여 25%/25% 기본 정책으로 복귀. 변경: - cpu 500m/1 → 300m/800m - mem 768Mi/1536Mi → 512Mi/1024Mi - strategy 25%/25% 명시 (기본값 복귀) 근거: 실측 idle CPU 0.7%, RSS ~305 MB. peak 30-40% 추정 안에서 안전. 검증: 적용 후 노드 잔여 330m → 다음 배포 시 두 Pod 공존 가능 (무중단). 다운타임: 이번 1회 ~25초 (구 500m Pod 점유 해제), 다음 배포부터 0초. 설계서: docs/design/316-backend-resource-rightsize/README.md (Approved). Refs: #316
76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
namespace: tasteby
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 25%
|
|
maxUnavailable: 25%
|
|
selector:
|
|
matchLabels:
|
|
app: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: ocir-secret
|
|
containers:
|
|
- name: backend
|
|
image: icn.ocir.io/idyhsdamac8c/tasteby/backend:latest
|
|
ports:
|
|
- containerPort: 8000
|
|
envFrom:
|
|
- configMapRef:
|
|
name: tasteby-config
|
|
- secretRef:
|
|
name: tasteby-secrets
|
|
volumeMounts:
|
|
- name: oracle-wallet
|
|
mountPath: /etc/oracle/wallet
|
|
readOnly: true
|
|
- name: oci-config
|
|
mountPath: /root/.oci
|
|
readOnly: true
|
|
resources:
|
|
requests:
|
|
cpu: 300m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: 800m
|
|
memory: 1024Mi
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 8000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 8000
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 30
|
|
volumes:
|
|
- name: oracle-wallet
|
|
secret:
|
|
secretName: oracle-wallet
|
|
- name: oci-config
|
|
secret:
|
|
secretName: oci-config
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: backend
|
|
namespace: tasteby
|
|
spec:
|
|
selector:
|
|
app: backend
|
|
ports:
|
|
- port: 8000
|
|
targetPort: 8000
|