Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.92 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.92 KB

Kubernetes Reverse Proxy

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.

Dependencies

Local Bootstrap

Start a k3s node using colima:

colima start --kubernetes

Start up the Kong Gateway services:

make bootstrap

Use Cases

Proxy Gateway

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).

Response Caching

ToDo - example writeup

Rate Limiting

ToDo - example writeup