Ingress에서 GatewayAPI로 전환해야 하는 이유는 더이상 kubernetes는 Ingress 관련 추가 기능을 제공하지 않기 때문이다.
Ingress is frozen. New features are being added to the Gateway API.
https://kubernetes.io/docs/concepts/services-networking/ingress/
추가 기능을 제공하지 않은 이유는 다음과 같다.
- Ingress는 Kubernetes-Native하지 못하고 특정 벤더 종속성을 띈다.
Ingress 구조 자체가 단순하여 복잡한 기능을 제공하려면 Ingress에 어노테이션을 달아야 하는데, 특정 벤더에 종속된 어노테이션이다보니 k8s 리소스인 Ingress가 특정 벤더 설정으로 오염되어 버려 Native하지 못한 상태가 되어버린다. Gateway API는 특정 벤더의 CRD가 K8S 리소스(Gateway, HttpRoute 등..)을 타겟으로 참조하는 방식을 사용하여, K8S 리소스가 특정 벤더에 종속되지 않은채 사용이 가능하다.
- Ingress에서 특정 벤더 어노테이션에 의존하여 제공되던 몇 가지 주요 기능이 표준으로 제공된다.
특정 벤더(nginx)에 종속된 어노테이션 설정을 활용하는 ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-weight: "10" # 전체의 10%를 canary로
공식 표준으로 제공하는 Gateway API
https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/
filters:
- type: RequestRewrite
requestRewrite:
path:
replacePrefixMatch: /
filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 308 # 301/302/308 선택 가능
https://gateway-api.sigs.k8s.io/guides/traffic-splitting
backendRefs:
- name: app-stable
port: 80
weight: 90 # 90%
- name: app-canary
port: 80
weight: 10
- Ingress는 HTTP/HTTPS 중심 L7 통신 기반에 책임이 통합되어 있지만 GatwayAPI TCP 통신도 지원함과 통신에 책임이 분리되어 있다.
Ingress는 HTTP/HTTPS 프로토콜로 들어온 트래픽을 어떤 경로로 라우팅 할지를 정의하는 L7 기반이므로 확장성에 한계가 있다. GatewayAPI는 Gateway + HTTPRoute/TCPRoute/UDPRoute 으로 구성되어 있어 확장성이 있고 책임을 분리할 수 있다. Infra 엔지니어가 Gateway를 정의하여 진입점의 도메인과 TLS를 설정하면 APP 개발자는 담당 서비스를 위한 HTTPRoute를 정의하여 책임을 분리하니 관리가 편해진다. Ingress는 진입점과 라우팅이 하나의 리소스안에 포함되어 있어 변경에 대한 영향도가 확산될 수 있다.
'Ops > Kubernetes' 카테고리의 다른 글
| [이슈] 파드가 반복해서 Evicted되는 현상 (0) | 2025.09.16 |
|---|---|
| K8S NFS 동적 프로비저닝 구현하기 (0) | 2025.09.16 |
| kubectl로 여러 Kubernetes 클러스터 제어하기 (3) | 2025.08.25 |
| [이슈] Traefik에서 대량으로 포트 오픈 시 발생한 이슈 (1) | 2025.08.07 |
| ETCD BackUp / Restore ( ETCD 백업 및 복원 ) (0) | 2025.06.22 |