title: Ingress + API Gateway = Kubernetes Gateway API
description: k8s ingress의 superset에 해당하는 Kubernetes Gateway API에 대해 논한다.
cleanUrl: /sw-engineer/kubernetes-gateway-api-1
ogImage: "<https://oopy.lazyrockets.com/api/v2/notion/image?src=https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F7570d2fc-66b1-4e23-bb3c-ff7b56842b0d%2Fcb5e8524-a2ac-42dd-8917-f3a4c0556355%2FUntitled.png&blockId=65aee252-3280-43f6-b2e4-8d0972923b1d>"
floatFirstTOC: right

Gateway API 기반 k8s resources(Gateway, HTTPRoute)와 타 k8s resources(Service, Pod)와의 관계
이미지 출처 : https://gateway-api.sigs.k8s.io/api-types/httproute/

Gateway API 기반 k8s resources(Gateway, HTTPRoute)와 타 k8s resources(Service, Pod)와의 관계 이미지 출처 : https://gateway-api.sigs.k8s.io/api-types/httproute/

Introduction

k8s ingress의 superset에 해당하는 Kubernetes Gateway API에 대해 논한다. 사실 상 Kubernetes Gateway API 공식 문서인 https://gateway-api.sigs.k8s.io/를 주로 참조한 개념적 요약이다.

Motivation

k8s Gateway API는 이들 문제에 대한 해결안이다.

<aside> 💡 Kubernetes Gateway API는 23.09.24 현재 v0.8.1로 베타 버전이다. 그럼에도 istio ingress gateway를 포함한 많은 API Gateway 솔루션이 현재 본 API를 지원 중이다.

</aside>

What is k8s Gateway API?

*Gateway API는 SIG-NETWORK 커뮤니티 에서 관리하는 오픈 소스 프로젝트로서, Kubernetes에서 서비스 네트워킹을 모델링하는 API(리소스 모음)입니다… 이전 Ingress API 에 익숙하다면 Gateway API를 해당 API의 더욱 표현력이 풍부한 차세대 버전과 유사하다고 생각할 수 있습니다.

from* k8s Gateway API 공식 site

위의 공식 site의 정의 중 둘째 문장이 중요한데, Gateway API는 ingress API를 사실 상 대체 가능한 superset임을 암시한다. 참고로, ingress와 API Gateway 모두는 Network 관점에서 보면 L7 Load balancer에 해당하지만, API Gateway는 ingress와는 달리 L7 protocol(e.g. HTTP)에 특화된 다양한 작업을 수행 가능하다.

한마디로 말해, k8s Gateway API란 ingress + API Gateway인 셈이다.

k8s Gateway API의 resources 및 이들 간 관계

다음 그림은 Gateway API의 주요 resources 식별 및 resource 간의 관계 및 담당자를 보여준다. 주목할 점으로 resource 별 담당자의 역할 분배를 고려했음이 보인다. ingress와는 달리 k8s Gateway API는 단일 runtime에 대해(API Gateway - ingress) GatewayHTTPRoute 라는 두 개의 resource로 나누어, Cluster와 application level 담당자를 분리 가능하도록 함과 동시에 application level 내에서도 각기 담당하는 resource를 분리 가능하도록 한다.

이미지 출처 : https://gateway-api.sigs.k8s.io/

이미지 출처 : https://gateway-api.sigs.k8s.io/