This guide introduces anyone who is interested in doing local hands-on experience with Kong Gateway on k3d cluster
wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v5.3.0 bash
k3d cluster create k3s-local --k3s-arg '--no-deploy=traefik@server:*' --k3s-arg '--write-kubeconfig-mode=644@server:*' --servers 3
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ingress-admin.key -out ingress-admin.crt -subj "/CN=admin.kong.deejiw.com/O=admin.kong.deejiw.com"
kubectl create namespace kong
kubectl create secret generic kong-superuser-password -n kong --from-literal=password=changeit
\
kubectl create secret tls ingress-admin-tls-secret --key ./configmap/kong/ingress-admin.key --cert ./configmap/kong/ingress-admin.crt -n kong
helm install my-kong kong/kong -n kong --values ./charts/kong/minimal.yml
helm install konga ./charts/konga -n kong --values ./charts/konga/values.yml
kubectl delete jobs -n kong --all
kubectl apply -f ./manifests/echo.yml
export KONG_PROXY_LB=$(kubectl get svc/my-kong-kong-proxy -n kong -o=jsonpath='{.spec.clusterIP}')
export KONG_ADMIN_POD=$(kubectl get pod --selector=app=my-kong-kong -n kong -o=jsonpath='{.items[0].status.podIP}')
export KONG_GATEWAY_DOMAIN=apigw.kong.deejiw.com
https://$KONG_ADMIN_POD:8444
Service
Name: echo-foo
Protocol: http
Host: echo.default
Port: 80
Path: /foo \
Route
Name: echo-foo-route
Hosts: $KONG_GATEWAY_DOMAIN
Path: /echo/foo
kubectl edit cm/coredns -n kube-system
\
NodeHosts:
...
...
$KONG_PROXY_LB $KONG_GATEWAY_DOMAIN
kubectl exec -it my-kong-postgresql-0 -n kong -- curl http://apigw.kong.deejiw.com/echo/foo
kubectl exec -it my-kong-postgresql-0 -n kong -- curl -k https://apigw.kong.deejiw.com/echo/foo