본문으로 건너뛰기

Frontend (React + Nginx) Deployment

ConfigMap으로 nginx 설정을 관리하고, Ingress 규칙에 따라 트래픽을 받음

목차​


구성 요소​

리소스이름네임스페이스
ConfigMapnginx-configgition
Deploymentfrontendgition
Servicefrontend-svcgition

라우팅 구조​

Ingress (gition.local)
│
├───> /api/* -> api-svc:3001
├───> /auth/* -> api-svc:3001
└───> /* -> frontend-svc:80
│
└──> nginx (ConfigMap 설정)
└──> 정적 파일 서빙

컨테이너 설정​

항목값
Replicas2
이미지172.100.100.8:5050/root/gition/frontend:latest
포트80
imagePullSecretsgitlab-registry
ConfigMapnginx-config

ConfigMap (nginx 설정)​

설정값
Gzip 압축활성화
정적 파일 캐시1년
Health endpoint/health -> 200 OK
SPA fallbacktry_files $uri /index.html

리소스 제한​

항목RequestsLimits
CPU50m200m
Memory64Mi256Mi

Health Check​

ProbePathInitial DelayPeriod
Liveness/health5s10s
Readiness/health3s5s

배포 명령어​

kubectl apply -f frontend.yaml
kubectl get pods -n gition -l app=frontend

nginx 설정 변경 시​

ConfigMap이 수정되면 Pod를 재시작해야 적용됨

kubectl apply -f frontend.yaml
kubectl rollout restart deployment/frontend -n gition

새 이미지를 배포 하는 경우 (frontend)​

kubectl rollout restart deployment/frontend -n gition && kubectl rollout status deployment/frontend -n gition

관련 문서​

그래프 뷰

…
그래프 데이터 로딩 중…
현재: Frontend (React + Nginx) Deployment
노드 클릭 → 이동 · 드래그 → 위치 조정