---
title: "APISIX Ingress Controller에서 Gateway API 사용 방법 - API7.ai"
description: "이 글은 Kubernetes Gateway API, 즉 외부로 서비스를 노출하기 위한 명세를 소개하고, APISIX Ingress Controller에서 Gateway API를 사용하는 방법에 대해 설명합니다."
url: "https://api7.ai/ko/blog/how-to-use-gateway-api-in-apisix-ingress-controller"
---

[Blog](https://api7.ai/ko/blog)

[Products](https://api7.ai/ko/category/products)[Technology](https://api7.ai/ko/category/technology)[Ecosystem](https://api7.ai/ko/category/ecosystem)[Case Study](https://api7.ai/ko/category/usercase)[Team & Community](https://api7.ai/ko/category/community)

Search

⌘ + K

[Blog](https://api7.ai/blog)

Products

# APISIX Ingress Controller에서 Gateway API 사용 방법

Yeqi Peng

November 11, 2022

[Products](https://api7.ai/category/products)

## Kubernetes Gateway API란 무엇인가

[Gateway API](https://api7.ai/blog/a-quick-glance-at-the-kubernetes-gateway-api)는 Kubernetes 클러스터 외부로 서비스를 노출시키기 위해 커뮤니티에서 시작된 또 다른 명세서(sig-network가 관리)로, 기본적인 Service와 Ingress 외에도 다양한 기능을 제공합니다.

Gateway API는 HTTP, TCP, UDP와 같은 일반적인 네트워크 프로토콜과 TLS를 지원합니다. 또한, Gateway API는 Kubernetes API를 통해 프록시나 게이트웨이의 생명주기를 관리할 수 있는 Gateway 리소스를 포함하고 있습니다.

### Gateway API가 필요한 이유

Ingress와 비교했을 때, Gateway API는 Ingress의 기능적 상위 집합을 나타내며, 다음과 같은 개선점을 가지고 있습니다:

- 역할 지향적: Gateway는 Kubernetes 서비스 네트워킹을 사용하고 구성하는 조직 역할을 모델링하는 API 리소스로 구성됩니다.
- 표현력이 풍부: Gateway API 리소스는 헤더 기반 매칭, 트래픽 가중치 부여 등 Ingress에서는 커스텀 어노테이션을 통해서만 가능했던 핵심 기능을 지원합니다.
- 확장 가능: Gateway API는 API의 다양한 계층에서 커스텀 리소스를 연결할 수 있도록 하여, API 구조 내 적절한 위치에서 세분화된 사용자 정의가 가능합니다.

또한, 이 표준은 이식성, 공유 게이트웨이, 크로스 네임스페이스 참조와 같은 기능을 포함하고 있습니다.

다이어그램에서 보여주듯, 역할 지향적 설계는 클러스터 내 네트워크 인프라를 다른 팀 간에 공유하고, 클러스터 관리자가 설정한 정책과 제약 조건을 공유할 수 있도록 합니다. 이를 통해 인프라 제공자, 클러스터 관리자, 애플리케이션 개발자와 같은 다양한 유형의 역할이 자신의 작업에 집중하고 다른 역할이 담당하는 부분에 신경 쓰지 않을 수 있습니다.

![api-mode.png](https://static.api7.ai/2022/10/03/633a3b34999dd.png?imageMogr2/format/webp)

다양한 역할이 서로 다른 수준의 Gateway API 리소스를 구성하며, 이러한 수준들이 함께 작동합니다:

![gateway-roles.png](https://static.api7.ai/2022/11/09/636b86f7845a1.png?imageMogr2/format/webp)

### Gateway API의 현재 상태

현재 Gateway API v0.5.0이 출시되면서, GatewayClass, Gateway, HTTPRoute와 같은 중요한 핵심 API들이 처음으로 Beta 상태가 되었습니다.

## APISIX Ingress에서 Gateway API 사용 방법

[APISIX Ingress Controller](https://api7.ai/blog/apisix-ingress-vs-ingress-nginx)의 Gateway API 지원은 개발 중이며, 현재 Alpha 단계에 있으며, HTTPRoute, TCPRoute와 같은 리소스를 지원합니다.

### Gateway API CRD 설치

Gateway API를 사용하려면 먼저 Gateway API의 CRD를 설치해야 합니다. 이는 APISIX Ingress Controller 저장소 아래의 복사본이나 공식 저장소 [kubernetes-sigs/gateway-api](https://github.com/kubernetes-sigs/gateway-api/tree/main/config/crd/experimental)를 통해 설치할 수 있습니다. 여기서는 APISIX Ingress Controller 저장소의 CRD 복사본을 예로 사용합니다.

다음 명령을 실행하여 Gateway API의 CRD를 설치합니다.

```
git pull git@github.com:apache/apisix-ingress-controller.git
cd apisix-ingress-controller

kubectl apply -f ./samples/deploy/gateway-api/
```

### APISIX Ingress Controller 설치

APISIX Ingress Controller에서 Gateway API 지원은 기본적으로 활성화되어 있지 않으며, `-enable-gateway-api=true` 매개변수를 통해 활성화할 수 있습니다.

Helm을 사용하여 설치할 때는 values를 구성하여 활성화할 수 있습니다.

다음 명령을 사용하여 APISIX와 APISIX Ingress Controller를 설치합니다.

```
helm repo add apisix https://charts.apiseven.com
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create ns apisix-ingress

helm install apisix apisix/apisix --namespace apisix-ingress \
--set gateway.type=NodePort \
--set ingress-controller.enabled=true \
--set ingress-controller.config.apisix.serviceNamespace=apisix-ingress \
--set ingress-controller.config.kubernetes.enableGatewayAPI=true
```

`-set ingress-controller.config.kubernetes.enableGatewayAPI=true` 매개변수는 Gateway API 지원을 활성화하는 데 사용됩니다.

이 명령들은 `apisix-ingress` 네임스페이스 아래에 APISIX, etcd 및 APISIX Ingress Controller를 포함한 완전한 테스트 환경을 생성합니다.

### 테스트 로드 배포

테스트 로드로 `kennethreitz/httpbin` 이미지를 사용합니다.

다음 명령을 사용하여 기본 네임스페이스 아래에 이러한 로드를 배포합니다.

```
kubectl run httpbin --image kennethreitz/httpbin --port 80
kubectl expose pod httpbin --port 80
```

### HTTPRoute 구성

현재 APISIX Ingress Controller는 Gateway API 리소스의 `v1alpha2` 버전을 지원합니다.

테스트를 위해 다음 HTTPRoute 구성을 사용하고 `httproute.yaml` 파일로 저장합니다:

```
# httproute.yaml
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
name: basic-http-route
spec:
hostnames:
- local.httpbin.org
rules:
- backendRefs:
    - name: httpbin
    port: 80
    matches:
    - path:
        type: PathPrefix
        value: /
```

다음 명령을 사용하여 이 HTTPRoute 구성을 배포합니다:

```
kubectl apply -f ./httproute.yaml
```

### 검증

APISIX Pod에서 직접 다음 명령을 실행하여 검증할 수 있습니다:

```
kubectl -n apisix-ingress exec -it $(kubectl -n apisix-ingress get Pods -l "app.kubernetes.io/name=apisix" -o name) -c apisix -- curl -H "Host: local.httpbin.org" localhost:9080/ip
```

예상 출력은 다음과 같습니다:

```
{
"origin": "127.0.0.1"
}
```

이는 우리의 구성이 성공적으로 적용되었음을 나타냅니다.

### APISIX Ingress가 Gateway API를 지원하는 방법

현재 APISIX Ingress Controller는 Gateway API에 대한 지원을 추가 중이며, HTTPRoute, TCPRoute 등의 리소스를 지원합니다.

APISIX Ingress Controller의 Gateway 및 Gateway Class 지원은 활발히 개발 중이므로, 현재는 이러한 리소스의 구성이 적용되지 않습니다.

## 요약

이 글에서는 클러스터 외부로 서비스를 노출시키기 위한 커뮤니티의 새로운 명세서인 Gateway API를 소개하고, APISIX Ingress Controller에서 이를 사용하는 방법을 설명했습니다.

[APISIX Ingress Controller](https://api7.ai/blog/apisix-ingress-integrates-with-service-discovery)에서 Gateway API에 대한 완전한 지원은 현재 활발히 개발 중입니다.

Tags:

[APISIX Ingress Controller](https://api7.ai/tags/apisix-ingress-controller)

[Gateway API](https://api7.ai/tags/gateway-api)

[Kubernetes](https://api7.ai/tags/kubernetes)

Share article link

Share

Related Posts

[![Why Is APISIX Ingress Controller Better than NGINX Ingress Controller?](https://static.api7.ai/2023/01/05/63b6900e1d793.png)](https://api7.ai/blog/apisix-ingress-vs-ingress-nginx)

## [Why Is APISIX Ingress Controller Better than NGINX Ingress Controller?](https://api7.ai/blog/apisix-ingress-vs-ingress-nginx)

[![APISIX Ingress Controller가 Traefik에 비해 더 나은 선택인 이유는 무엇인가요?](https://static.api7.ai/uploads/2024/09/06/ldwwEzTf_APISIX%20Ingress%20Controller-3.png)](https://api7.ai/blog/apisix-ingress-better-than-traefik)

## [APISIX Ingress Controller가 Traefik에 비해 더 나은 선택인 이유는 무엇인가요?](https://api7.ai/blog/apisix-ingress-better-than-traefik)

Table of Contents

- [Kubernetes Gateway API란 무엇인가](#kubernetes-gateway-api%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80)

  - [Gateway API가 필요한 이유](#gateway-api%EA%B0%80-%ED%95%84%EC%9A%94%ED%95%9C-%EC%9D%B4%EC%9C%A0)
  - [Gateway API의 현재 상태](#gateway-api%EC%9D%98-%ED%98%84%EC%9E%AC-%EC%83%81%ED%83%9C)

- [APISIX Ingress에서 Gateway API 사용 방법](#apisix-ingress%EC%97%90%EC%84%9C-gateway-api-%EC%82%AC%EC%9A%A9-%EB%B0%A9%EB%B2%95)

  - [Gateway API CRD 설치](#gateway-api-crd-%EC%84%A4%EC%B9%98)
  - [APISIX Ingress Controller 설치](#apisix-ingress-controller-%EC%84%A4%EC%B9%98)
  - [테스트 로드 배포](#%ED%85%8C%EC%8A%A4%ED%8A%B8-%EB%A1%9C%EB%93%9C-%EB%B0%B0%ED%8F%AC)
  - [HTTPRoute 구성](#httproute-%EA%B5%AC%EC%84%B1)
  - [검증](#%EA%B2%80%EC%A6%9D)
  - [APISIX Ingress가 Gateway API를 지원하는 방법](#apisix-ingress%EA%B0%80-gateway-api%EB%A5%BC-%EC%A7%80%EC%9B%90%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95)

- [요약](#%EC%9A%94%EC%95%BD)

## Related Posts

[![APISIX Ingress Controller가 Emissary-ingress보다 더 나은 선택인 이유는 무엇인가요?](https://static.api7.ai/uploads/2024/12/24/CLpj341F_apisix-ingress-controller-vs-emissary.png)](https://api7.ai/ko/blog/apisix-ingress-vs-emissary-ingress)

Products

March 17, 2023

#### [APISIX Ingress Controller가 Emissary-ingress보다 더 나은 선택인 이유는 무엇인가요?](https://api7.ai/ko/blog/apisix-ingress-vs-emissary-ingress)

이 글은 APISIX Ingress Controller와 Emissary-ingress의 성능을 확장성 및 서비스 디스커버리 통합과 같은 다양한 측면에서 비교합니다.

[APISIX Ingress Controller](https://api7.ai/tags/apisix-ingress-controller)

[Kubernetes](https://api7.ai/tags/kubernetes)

[Emissary-Ingress](https://api7.ai/tags/emissary-ingress)

[![APISIX Ingress Controller가 Service Discovery와 통합](https://static.api7.ai/uploads/2024/12/25/yzN9mzLr_apisix-ingress-controller-service-discovery.png)](https://api7.ai/ko/blog/apisix-ingress-integrates-with-service-discovery)

Products

January 13, 2023

#### [APISIX Ingress Controller가 Service Discovery와 통합](https://api7.ai/ko/blog/apisix-ingress-integrates-with-service-discovery)

APISIX Ingress Controller는 서비스 디스커버리와 통합되어 마이크로서비스의 배포 비용을 줄입니다.

[APISIX Ingress Controller](https://api7.ai/tags/apisix-ingress-controller)

[Kubernetes](https://api7.ai/tags/kubernetes)

[Service Discovery](https://api7.ai/tags/service-discovery)

[![Apache APISIX Ingress Controller에서 외부 서비스 프록시하는 방법](https://static.api7.ai/uploads/2024/12/24/WADOMxsJ_proxy-services-using-ingress-controller.png)](https://api7.ai/ko/blog/proxy-services-in-apisix-ingress-controller)

Products

January 13, 2023

#### [Apache APISIX Ingress Controller에서 외부 서비스 프록시하는 방법](https://api7.ai/ko/blog/proxy-services-in-apisix-ingress-controller)

APISIX Ingress Controller에서 외부 서비스를 프록시하는 방법을 소개합니다.

[APISIX Ingress Controller](https://api7.ai/tags/apisix-ingress-controller)

[Kubernetes](https://api7.ai/tags/kubernetes)
