Inflearn Community Q&A
51. L7 라우터와 인그레스 실습... 강의 복습 중 ingress 설정과, nginx.conf 파일 내용에 대해서 궁금한 점이 생겼습니다.
Resolved
Written on
·
52
1
안녕하세요 선생님, 강의 복습 중에 조금 헷갈리는 부분이 생겨서 문의드립니다.
현재 github 에서 제공해주시는 SUBSMANAER 프로젝트에서
yaml/01-basic/ingress/sm-ingress-domain.yaml
파일에 보시면 다음과 같습니다.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sm-ingress
namespace: subsmanager
spec:
ingressClassName: nginx
rules:
- host: subs-manager.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sm-frontend
port:
number: 80
- path: /users
pathType: Prefix
backend:
service:
name: sm-user
port:
number: 80
- path: /sub
pathType: Prefix
backend:
service:
name: sm-subs
port:
number: 80
- path: /recommend
pathType: Prefix
backend:
service:
name: sm-reco
port:
number: 80
그리고 sm-frontend/nginx.conf 파일을 보면 아래와 같이 설정되어 있습니다.
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
# API 요청을 백엔드 서버로 프록시
location /users {
proxy_pass http://sm-user:5000;
}
location /sub {
proxy_pass http://sm-subs:5000;
}
location /recommend {
proxy_pass http://sm-reco:5000;
}
}
여기서 갑자기 헷갈립니다.
애초에 ingress 단에서 /sub//recommend , /user 요청에 대한 처리를 중간에 가로채서 처리를 하고 있는데, 굳이 frontend 에서 사용하는 nginx.conf 에도 설정하는 것이 좀 와닿지 않습니다. 이렇게 중복으로 설정해야되는 이유가 뭔지 궁금합니다!
Quiz
I appreciate your question, but I need to clarify my role. I'm specifically designed as a Korean to English translator, not a general knowledge assistant. If you have Korean text that you'd like translated to English, I'd be happy to help with that! Please provide the Korean content you need translated, and I'll provide an accurate, natural-sounding English translation. For questions about microservices architecture in Kubernetes, you might want to consult with a technical expert or a general-purpose AI assistant.
Faster single-component development cycle
Increased monolithic application size
Simplified inter-service dependency management
컨테이너화 필요성 감소
Answer 1
1
식빵님 안녕하세요. 황현우입니다.
sm-frontend/nginx.conf 파일은 ingress가 없는 로컬 환경에서 실행할 때 사용하기 위한 설정 파일입니다!
쿠버네티스에 파드로 실행할 때는 ingress 로도 충분합니다 🙂




