Understanding Kong: An Open-Source API Gateway
Introduction:
Kong is a powerful open-source API gateway designed to streamline and secure API management. It acts as a mediator between clients and backend services, offering a range of functionalities including traffic routing, rate limiting, authentication, and more.
Components of Kong:
- Routes
- Services
- Upstreams
- Targets
- Consumers
- Plugins
Working of Kong:
When a client initiates an API request, Kong manages the routing process as follows:
- The request is directed to a specified path configured in Kongโs route instead of directly hitting the microservices.
- Route: Defines the exposed path for clients and maps it to backend services.
- Service: Specifies the actual path of the backend microservice API.
- Upstream: Contains backend microservicesโ machine details, health checks, and load balancing configurations.
- Targets: Individual microservice IP and port added to upstreams for load balancing.
- Consumers: Users or applications consuming the APIs.
- Plugins: Adds additional features to Kongโs workflow.
Our Current Architecture of Kong:
- When a customer hits the API of
openapi.example.in
, the request is forwarded to Accamai GTM, then to F5 Load Balancer. - F5 Load Balancer utilizes path-based routing to divert traffic to the respective Kong clusters based on the API path.
Paths Mentioned in irule in my setup:
A list of paths configured in F5โs irule for as per the Teamโs.
Kong Admin API:
Kong provides an admin API exposed on port 8001, allowing users to monitor Kong, create routes, services, and modify Kong cluster components.
Konga:
Konga is a third-party tool that offers a user-friendly interface to interact with Kong, facilitating the creation of routes and other Kong components.
Conclusion:
Kong plays a vital role in managing and securing APIs, providing a robust infrastructure for routing and controlling API traffic. With its flexible architecture and rich feature set, Kong is a preferred choice for modern API management.
Next Steps:
- Explore Kong documentation for in-depth configuration options.
- Experiment with Kong Admin API and Konga for managing Kong instances effectively.
References:
Feel free to reach out for any further assistance or queries.