Kong offers an open source reverse-proxy service built on top of nginx that can run on Kubernetes.
This repo demos how to run the Kong Gateway on K8s.
Start a k3s node using colima:
colima start --kubernetes
Start up the Kong Gateway services:
make bootstrap
A reverse proxy enables a single ingress point to upstream web services. The Kong Gateway accomplishes this through path based routing.
Create Service A:
curl "localhost:8001/services" -d name=serviceA -d url="https://speerportfolio.com"
And a corresponding Route:
curl "localhost:8001/services/serviceA/routes" -d paths="/"
Create Service B:
curl "localhost:8001/services" -d name=serviceB -d url="https://github.com/kspeer825"
And it's corresponding Route:
curl "localhost:8001/services/serviceB/routes" -d paths="/gh" -d preserve_host=true
You can now proxy requests from your local k8s cluster to my personal web site, and my Github profile via localhost/ and localhost/gh. This is useful for scenarios where you have upstream web apps or APIs that are non-public facing, yet you need to expose them safely to the internet. You can configure paths to your private web services in Kong, expose the K8s ingress entrypoint, and apply one of the supported authentication methods at the proxy level (see Kong Auth plugins).
ToDo - example writeup
ToDo - example writeup