1차 cilium gateway api

진웅·2025년 7월 1일

CILIUM

목록 보기
2/14

Cilium Gateway API 간단 테스트 가이드

1. 준비 확인 (1분)

# Cilium이 Gateway API를 지원하는지 확인
kubectl get crd | grep gateway
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml

2. 테스트 앱 만들기 (2분)

# 간단한 웹 서버 배포
kubectl create deployment nginx --image=nginx
kubectl expose deployment nginx --port=80 --target-port=80

3. Gateway 만들기 (1분)

# gateway.yaml 파일 생성
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-gateway
spec:
  gatewayClassName: cilium
  listeners:
  - protocol: HTTP
    port: 80
    name: web
kubectl apply -f gateway.yaml

4. 라우팅 설정 (1분)

# route.yaml 파일 생성
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: nginx-route
spec:
  parentRefs:
  - name: my-gateway
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: nginx
      port: 80
kubectl apply -f route.yaml

5. 테스트하기 (1분)

# Gateway IP 확인
kubectl get gateway my-gateway

# 서비스 확인
kubectl get svc | grep gateway

# 테스트 (IP 주소는 위에서 확인한 것 사용)
curl http://[GATEWAY-IP]/

성공하면: nginx 기본 페이지가 보입니다!

간단 문제해결

Gateway IP가 안 보이면:

# NodePort로 접근
kubectl get svc -o wide | grep gateway
# [NODE-IP]:[NODE-PORT] 로 접근

여전히 안되면:

# 포트포워딩으로 테스트
kubectl port-forward svc/[gateway-service-name] 8080:80
curl http://localhost:8080

끝! 🎉

총 5분이면 Cilium Gateway API가 작동하는지 확인할 수 있습니다.

profile
bytebliss

0개의 댓글