GatewayAPI 역할 분리와 트래픽 흐름
![]()
![]()
Gateway API를 지원하는 오픈소스 주요 구현체
- Envoy Gateway
- Nginx Gateway Fabric
- Cilium → Envoy Proxy
- Traefik
- Kong Gateway
- Tyk
- Istio → Envoy Proxy
- Kgateway → Envoy Proxy
- AWS LoadBalancer Controller → v3.0 이상이어야 한다. v2.x 권고 되지 않음
- Contour → Envoy Proxy
Ingress API, Gateway API 비교
| Ingress | Gateway | |
|---|---|---|
| 리소스 |
IngressController IngressClass Ingress |
Gateway Control Plane GatewayClass Gateway, HTTPRoutes |
| 역할 분리 | 가능 | 인프라 제공자, 클러스터 운영자, 개발자 분리 |
| 프로토콜 | HTTP/HTTPS | HTTP/HTTPS, TCP, UDP, gRPC, TLS |
| 라우팅 | 호스트, 경로 기반 | 헤더, 쿼리스트링, 메서드 매칭 |
| 트래픽 분할 | 지원 | 지원 |
| TLS | Termination | Termination, Passthrough, BackendTLSPolicy |
| 교차 네임스페이스 | 미지원 | 지원, ReferenceGrant |
Envoy Gateway Architecture
![]()
| Field | Type | Required | Description |
|---|---|---|---|
envoyProxy |
EnvoyProxySpec |
false |
EnvoyProxy defines the default EnvoyProxy configuration that applies to all managed Envoy Proxy fleet. This is an optional field and when provided, the settings from this EnvoyProxySpec serve as the base defaults for all Envoy Proxy instances. The hierarchy for EnvoyProxy configuration is (highest to lowest priority):
Currently, the most specific EnvoyProxy configuration wins completely (replace semantics). A future release will introduce merge semantics to allow combining configurations across multiple levels. |
GatewayClass가 EnvoyProxy의 설정을 참조하기 때문에,
GatewayClass를 상속받아 Gateway에서 배포하는 Envoy Proxy Deployment는 GatewayClass와 EnvoyProxy 설정을 모두 따른다.
즉, 동일한 GatewayClass를 상속받아 배포되는 Gateway는 모두 동일한 설정을 갖는다.
다른 설정이 필요하다면 GatewayClass와 EnvoyProxy를 모두 분리하는 방법을 쓰거나,
Gateway.spec.infrastructure.parametersRef로 Gateway마다 다른 EnvoyProxy를 지정할 수 있어 GatewayClass를 분리하지 않고도 배포할 수 있다.
로드밸런서(NLB) 분리의 기준은 Gateway Custom Resource이다.
Gateway의 교차 네임스페이스를 지원하려면 ReferenceGrant Custom Resource를 배포해야 한다.
설계 고려 사항
1. Gateway CR을 만들 때 고려사항
- 1개의
Gateway(NLB)를 공유해서 여러 서비스(Routes)가 사용할 경우 - 서비스마다
Gateway(NLB)를 분리할 경우
2. Envoy Gateway Helm, Custom Resources 배포 방식
Helm Chart는 플랫폼 IaC 레포에서 배포하고, 클러스터마다 배포해야 하는 Custom Resources(CR)가 다를 수 있기 때문에 Envoy Gateway CR은 ArgoCD App-of-Apps 패턴으로 별도 레포에서 배포하는 편이 나을 것으로 보인다.
3. RateLimit
RateLimit 기능을 사용하려면 Redis가 필요하다.
BackendTrafficPolicy CR을 통해 RateLimit을 설정할 수 있는데, 이 CR은 서비스 개발팀(서비스 네임스페이스)에서 배포해야 한다.
- CRD 스키마가
LocalPolicyTargetReference를 사용하기 때문에 플랫폼(Gateway 네임스페이스)에서 배포하는 것은 불가능하다. gateway.envoyproxy.io의BackendTrafficPolicy스키마에서targetRefs항목은LocalPolicyTargetReferenceWithSectionName타입이며,group/kind/name/sectionName만 있고 namespace 필드 자체가 없다.
차후 이 기능이 필요할 경우 Redis는 플랫폼 제공자가 ElastiCache 또는 Pod로 제공하고, BackendTrafficPolicy CR은 개발팀 레포에서 배포하는 방향으로 설계한다.
Ref.
Gateway API Introduction : Gateway API
Kubernetes Gateway : Kubernetes Gateway
Envoy Gateway Extension API : Envoy Gateway API Reference