본문으로 건너뛰기

Ingress - Path-based Routing

Ingress는 외부에서 클러스터 내부의 서비스로 HTTP/HTTPS 트래픽을 라우팅하는 규칙 모음

목차


라우팅 구조

클라이언트


┌─────────────────────────────────────────────────────────┐
│ Ingress Controller Service (NodePort) │
│ NodePort: 30080 │
│ ExternalIP: 172.100.100.20 │
└─────────────────────────────────────────────────────────┘


┌─────────────────────────────────────────────────────────┐
│ Ingress (gition-ingress) │
│ Host: gition.local │
└─────────────────────────────────────────────────────────┘
│ │ │
/api/* │ │ │ /*
/auth/* ▼ │ ▼
/health │
│ │ │
┌───────────────────────────────────────────────────────┐
│ api-svc │ │ frontend-svc │
│ :3001 │ │ :80 │
└───────────────────────────────────────────────────────┘

라우팅 테이블

PathServicePort설명
/apiapi-svc3001Backend API (Prefix)
/auth/githubapi-svc3001GitHub OAuth (Prefix)
/healthapi-svc3001Health Check (Exact)
/frontend-svc80Frontend catch-all (Prefix)

기본 설정

항목
Hostgition.local
IngressClassnginx
Namespacegition

Annotations (설정 주석)

Annotation설명
proxy-body-size50m파일 업로드 용량
proxy-connect-timeout60연결 타임아웃
proxy-read-timeout60응답 타임아웃

배포 명령어

# Ingress Controller NodePort 설정 (필요 시)
kubectl apply -f ingress-nginx-svc.yaml

# Ingress 라우팅 규칙 배포
kubectl apply -f ingress.yaml
kubectl get ingress -n gition

테스트 방법

# ExternalIP 사용 시
curl -H "Host: gition.local" http://172.100.100.20/

# NodePort 사용 시
curl -H "Host: gition.local" http://172.100.100.12:30080/

# API 테스트
curl -H "Host: gition.local" http://172.100.100.20/api/health

관련 문서

그래프 뷰

그래프 데이터 로딩 중…
현재: Ingress - Path-based Routing
노드 클릭 → 이동 · 드래그 → 위치 조정