This should be a fast start to understand and use an api gateway on kubernetes leveraging the Kong ingress.
Kong Gateway is an open-source, lightweight API gateway optimized for microservices, delivering unparalleled latency, performance, and scalability.
- Installs Kong ingress controller
- Installs the echo server with relative service
- Modify the metadata of the echo server to install it again as a version 2.0
- Update the ingress to route the requests to different APIs to the different services
- Use 'uri-rewrites' to delete the "api" part from the invoked URI, before sending the request to the endpoint app. [docs]
The best way to use the code is to read the comments and to copy-paste the instructions from install_echo_apis.sh
, understanding what is going on under the hoods, this is also why I have added some extra monitoring command.
If you don't have a K8S cluster available you can use the Katacoda environment or install minikube on your machine.
- Go on your preferred environment. Katacoda some times gets stuck, so don't rely on that terminal state.. ;)
- Star and fork this repo :)
- Clone your forked repo on the machine
cd kubernetes_kong_api_management/
- Since this is a didactical repo, it has no meaning to do a blind-run script. So it is better to copy paste a command at a time.
A preview of how the ingress can eat the "api" part of the URI, so to be transparent to the backend endpoint clusters.