Created
November 13, 2025 23:03
-
-
Save koorukuroo/9872b104f6e0942ab89271d7cd831e56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: fastapi-deployment | |
| namespace: default | |
| spec: | |
| replicas: 3 | |
| selector: | |
| matchLabels: | |
| app: fastapi | |
| template: | |
| metadata: | |
| labels: | |
| app: fastapi | |
| spec: | |
| containers: | |
| - name: fastapi | |
| # ✅ ECR에 푸시한 이미지 경로로 교체 | |
| # 예) 123456789012.dkr.ecr.ap-northeast-2.amazonaws.com/fastapi-app:1.0 | |
| image: <AWS_ACCOUNT_ID>.dkr.ecr.ap-northeast-2.amazonaws.com/fastapi-app:1.0 | |
| imagePullPolicy: Always | |
| ports: | |
| - containerPort: 8000 # FastAPI가 리슨하는 포트 | |
| env: | |
| - name: ENV | |
| value: "production" # 실행 환경 (prod/eks) | |
| - name: POD_NAME | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: metadata.name | |
| # ✅ Liveness Probe: 컨테이너가 "살아있는지" 확인 | |
| livenessProbe: | |
| httpGet: | |
| path: /health | |
| port: 8000 | |
| initialDelaySeconds: 30 # 컨테이너 시작 후 첫 체크까지 대기 시간 | |
| periodSeconds: 10 # 이후 체크 주기(초) | |
| # ✅ Readiness Probe: 트래픽을 받을 준비가 되었는지 확인 | |
| readinessProbe: | |
| httpGet: | |
| path: /health | |
| port: 8000 | |
| initialDelaySeconds: 5 # 시작하고 어느 정도 준비되면 바로 체크 | |
| periodSeconds: 5 | |
| resources: | |
| requests: | |
| cpu: "250m" | |
| memory: "256Mi" | |
| # limits는 필요하면 추가 | |
| # limits: | |
| # cpu: "500m" | |
| # memory: "512Mi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment