Istio 인그레스 게이트웨이
Istio 인그레스 게이트웨이 (Ingress Gateways)
서비스 메시 바깥에서 들어오는 외부 요청을 받아줄 지점이 필요해요. 쿠버네티스의 Ingress API를 쓸 수도 있지만, Istio의 게이트웨이를 쓰면 L4~L6 로드밸런싱 속성을 설정하면서도 Istio 트래픽 라우팅의 기능을 그대로 가져올 수 있어요.
출처: https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/
인그레스 게이트웨이는 메시 가장자리에 위치한 전용 Envoy 프록시예요. 관례대로 istio-ingressgateway라는 이름을 쓰지만, 원하는대로 이름을 정하거나 필요에 따라 게이트웨이를 여러 개 둘 수도 있어요.
설정은 두 단계로 나뉘어요.
apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
name: my-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "httpbin.example.com"
Gateway 리소스는 "어느 포트·프로토콜로 들어온 어떤 호스트를 이 프록시가 받을지"만 선언해요. 실제로 그 요청을 어느 서비스로 보낼지는 VirtualService가 결정해요. 게이트웨이는 트래픽을 받는 문, VirtualService는 그 문으로 들어온 요청의 길을 정하는 길잡이로 생각하면 돼요.
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- "httpbin.example.com"
gateways:
- my-gateway
http:
- match:
- uri:
prefix: /status
route:
- destination:
host: httpbin
port:
number: 8000
gateways 필드에 게이트웨이 이름을 적으면 그 게이트웨이로 들어온 요청에 이 라우팅 규칙이 적용돼요. 트래픽을 메시 밖으로 보내면서 TLS까지 적용하고 싶다면 Secure Gateways 태스크에서 mTLS/TLS 설정을 다뤄요.
더 알아보기
- HTTPS/TLS까지 걸고 싶다면 Secure Gateways
- 게이트웨이 리소스 전체 필드: Gateway reference