사전 요구사항 및 설치

사전 요구사항 및 설치 (Prerequisites & Installation)

Cilium Gateway API 컨트롤러를 사용하려면 필요한 사전 요구사항을 충족하고 Gateway API CRD를 설치한 뒤, Helm 또는 Cilium CLI로 컨트롤러를 활성화해야 해요.

출처: Prerequisites

본문

사전 요구사항 (Prerequisites)

  • Cilium은 kubeProxyReplacement=true로 kube-proxy 교체가 구성되어야 해요. 자세한 내용은 kube-proxy replacement를 참고해주세요.
  • Cilium은 l7Proxy=true(기본 활성화)로 L7 프록시가 활성화되어야 해요.
  • Gateway의 Service에 도착한 트래픽은 TPROXY 커널 기능을 사용해 Envoy로 투명하게 전달돼요. 기본 bpf.tproxy=false에서는 TPROXY가 iptables로 구현되므로, 노드는 L7 프록시 시스템 요구사항에 나열된 netfilter 모듈과 함께 iptables를 제공해야 해요. 일부 배포판은 기본적으로 이를 제공하지 않아서, Gateway에 대한 연결이 Envoy에 도달하지 못한 채 타임아웃될 수 있어요. eBPF 기반 bpf.tproxy=true(베타)는 이 iptables 의존성을 제거해요.
  • 기본적으로 Cilium Gateway API 컨트롤러는 LoadBalancer 유형의 서비스를 만들므로, 환경이 이를 지원해야 해요. 또는 Cilium 1.16부터 호스트 네트워크에서 Cilium L7 프록시를 직접 노출할 수 있어요.

설치 (Installation)

Gateway API v1.6.1의 아래 CRD들이 반드시 설치되어야 해요.

  • GatewayClass
  • Gateway
  • HTTPRoute
  • GRPCRoute
  • BackendTLSPolicy
  • ReferenceGrant
  • TLSRoute

설치 단계는 이 문서들을 참고해주세요. 또는 아래 스니펫을 사용할 수도 있어요.

experimental 릴리스 채널에는 standard 릴리스 채널의 모든 것과 일부 실험 리소스/필드가 포함돼 있어요. 현재 experimental로 표시된 기능(예: HTTPRoute 리소스의 HTTPRoute Retry)이 필요하다면 해당 CRD를 설치해야 해요. 실험 기능 전체 목록은 experimental GEP 목록을 참고해주세요.

기존 설치를 업데이트하는 경우, 항상 먼저 Upgrade Guide를 확인해서 새 버전에 필요한 breaking changes, deprecated 기능, 중요한 구성 업데이트를 검토해주세요. Cilium 1.20 업그레이드의 경우, Gateway API CRD를 업데이트하기 전에 업그레이드 가이드의 Gateway API v1.6.1과 TLSRoute 참고 사항을 검토하세요.

필요한 CRD 집합은 다음과 같이 설치할 수 있어요:

kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_gateways.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_referencegrants.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_backendtlspolicies.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_tlsroutes.yaml

kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_referencegrants.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml

TCPRoute, UDPRoute 또는 ListenerSet CRD는 선택 사항이며, 이 기능을 사용하려면 해당 CRD 리소스를 설치해야 해요. 설치하지 않으면 Cilium은 이 기능들에 대한 지원을 비활성화해요.

선택적 CRD 집합은 다음과 같이 설치할 수 있어요:

kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_listenersets.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_tcproutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/standard/gateway.networking.k8s.io_udproutes.yaml

kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_listenersets.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_tcproutes.yaml
kubectl apply --server-side -f https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v1.6.1/config/crd/experimental/gateway.networking.k8s.io_udproutes.yaml

CRD가 설치되면 Helm 또는 Cilium CLI를 사용해 Cilium Gateway API 컨트롤러를 활성화해주세요.

Helm으로 활성화하기 — 최신 버전의 Cilium CLI를 사용하려면 Cilium CLI 설치 지침을 따르세요. Cilium Gateway API Controller는 helm 플래그 gatewayAPI.enabled를 true로 설정해서 활성화할 수 있어요. 새 설치에 대해서는 Installation using Helm을 참고해주세요.

helm upgrade cilium cilium/cilium --version 1.20.2 \
   --namespace kube-system \
   --reuse-values \
   --set kubeProxyReplacement=true \
   --set gatewayAPI.enabled=true
kubectl -n kube-system rollout restart deployment/cilium-operator
kubectl -n kube-system rollout restart ds/cilium

helm upgrade cilium oci://quay.io/cilium/charts/cilium 1.20.2 \
   --namespace kube-system \
   --reuse-values \
   --set kubeProxyReplacement=true \
   --set gatewayAPI.enabled=true
kubectl -n kube-system rollout restart deployment/cilium-operator
kubectl -n kube-system rollout restart ds/cilium

Cilium CLI로 활성화하기 — Cilium CLI를 설치한 뒤, Cilium Gateway API Controller는 아래 명령으로 활성화할 수 있어요.

$ cilium upgrade 1.20.2 \
    --set kubeProxyReplacement=true \
    --set gatewayAPI.enabled=true

다음으로 Cilium agent와 operator의 상태를 확인할 수 있어요:

$ cilium status

더 알아보기 (Learn more)