Kong Ingress Controller는 Kong Gateway를 Kubernetes Ingress로 실행하여 Kubernetes 클러스터에 대한 인바운드 요청을 담당할 수 있도록 한다. KIC는 Ingress 또는 HTTPRoute와 같은 k8s resource를 생성하면 유효한 Kong gateway configuration으로 변환시켜준다.
helm repo add kong https://charts.konghq.com
helm repo update
helm upgrade -n kong-system -i --create-namespace kgo kong/gateway-operator
kubectl -n kong-system wait --for=condition=Available-true --timeout=120s deployment/kgo-gateway-operator-controller-manager
k8s Gateway-api CRD 생성
Gateway api는 standard와 experimental이 있으며 experimetal에는 standard에는 없는 tcproute, tlsroute, udproute등의 CRD가 추가로 정의되어 있음.
standard | experimetal |
---|---|
gatewayclasses.gateway.networking.k8s.io | gatewayclasses.gateway.networking.k8s.io |
gateways.gateway.networking.k8s.io | gateways.gateway.networking.k8s.io |
grpcroutes.gateway.networking.k8s.io | grpcroutes.gateway.networking.k8s.io |
httproutes.gateway.networking.k8s.io | httproutes.gateway.networking.k8s.io |
referencegrants.gateway.networking.k8s.io | referencegrants.gateway.networking.k8s.io |
tcproutes.gateway.networking.k8s.io | |
tlsroutes.gateway.networking.k8s.io | |
udproutes.gateway.networking.k8s.io | |
backendlbpolicies.gateway.networking.k8s.io | |
backendtlspolicies.gateway.networking.k8s.io |
글 작성시점에 v1.2.1이 최신버전이나 kong문서에는 v1.1.0을 사용하도록 되어 있음.
$ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml
$ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml
echo "
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: kong
annotations:
konghq.com/gatewayclass-unmanaged: 'true'
spec:
controllerName: konghq.com/kic-gateway-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: kong
spec:
gatewayClassName: kong
listeners:
- name: proxy
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: All
"_텍스트_ | kubectl apply -f -
$ helm repo add kong https://charts.konghq.com
$ helm repo update
$ helm install kong kong/ingress -n kong --create-namespace
$ kubectl -n kong get pods
NAME READY STATUS RESTARTS AGE
kong-gateway-dcff885c4-mkq5t 1/1 Running 0 3h48m
kong-controller-596d4d6995-thm8k 1/1 Running 2 (3h48m ago) 3h48m
$ kubectl -n kong get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kong-gateway-admin ClusterIP None <none> 8444/TCP 3h48m
kong-controller-metrics ClusterIP 10.43.177.67 <none> 10255/TCP,10254/TCP 3h48m
kong-controller-validation-webhook ClusterIP 10.43.208.206 <none> 443/TCP 3h48m
kong-gateway-manager NodePort 10.43.246.102 <none> 8002:30003/TCP,8445:30004/TCP 3h48m
kong-gateway-proxy NodePort 10.43.55.222 <none> 80:30005/TCP,443:30006/TCP 3h48m
Kong Ingress Controller - https://docs.konghq.com/kubernetes-ingress-controller/3.4.x
Kong Gateway Operator - https://docs.konghq.com/gateway-operator/1.4.x/