Microservice Gateway (Kong) and Container Service Integration
This article explains microservice architecture and the role of API gateways, introduces Kong as a high‑availability gateway, and provides a step‑by‑step guide for deploying containerized AI services (face, pet, and content moderation) and integrating them with Kong for authentication, rate‑limiting, and secure access.
The 360 private‑cloud container service team collaborated with the AI research institute to enhance machine‑learning efficiency in the cloud, delivering services such as face detection, screen‑artifact detection, porn detection, pet detection, image stylization, OCR, and smart cropping. The article then focuses on the "Microservice Gateway and Container Service" technologies used in this practice.
Microservice architecture breaks a monolithic application into many small, independent components that can be developed, deployed, and scaled separately, possibly using different languages and teams. Each component collaborates to accomplish the overall task, embodying the principles of being smaller, faster, and stronger.
In contrast, traditional monolithic web applications (e.g., a Java WAR file) are packaged as a single unit, which simplifies testing and deployment but limits scalability, reliability, iterative development, multi‑language support, and team collaboration.
To address these drawbacks, the monolith can be split into independent services, allowing each team to choose its own technology stack and iterate without affecting the whole system.
An API gateway provides a unified entry point for external clients to access one or more internal APIs, offering features such as load balancing, rate limiting, authentication, monitoring, and caching. It hides internal services while exposing only the necessary APIs, and can enforce security and stability policies.
Kong is a high‑availability, extensible API gateway built on the nginx_lua module. It consists of a Kong server (based on nginx) that receives external API requests and a PostgreSQL database for storing configuration data. Kong’s plugin mechanism, written in Lua, allows custom functionality to be executed during the request‑response lifecycle.
The integration example shows how three containerized AI services—face detection, pet detection, and content‑moderation—are deployed on the container platform, each receiving a VIP address. These services are then registered with Kong, which persists the registration in PostgreSQL and configures plugins for authentication, rate limiting, CORS, etc.
Step 1: Deploy the three service instances on the container platform and obtain VIPs. Step 2: Register the services with Kong; Kong stores the information in PostgreSQL and applies necessary plugins. Step 3: Clients obtain an authorized token and access the desired services through Kong.
The article provides a high‑level overview of the workflow; each part requires further in‑depth study by the reader.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
360 Tech Engineering
Official tech channel of 360, building the most professional technology aggregation platform for the brand.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
