Company
Date Published
Author
Zhi Qu
Word count
1743
Language
English
Hacker News points
None

Summary

Nylas utilizes the Kong API gateway to efficiently manage its API requests by authenticating, controlling routing, and transforming requests and responses through custom plugins. The necessity for a custom plugin arises from the limitations of Kong's built-in plugins, which cannot handle complex logic such as authentication and routing based on user account information. Nylas opted for a custom plugin written in Go due to its speed and lightweight nature, aligning with their existing backend services. The API gateway is divided into a control plane, establishing routing policies and managing system configurations, and a data plane, which processes external requests, enhancing reliability and scalability. Testing the custom plugin involves creating a developer environment using minikube to simulate real-world functionality, as unit tests are insufficient due to the Lua-based nature of Kong's PDK libraries. Deployment requires compiling the plugin for Linux, building a Docker image, and configuring Helm to register the plugin, ensuring it's available within Kong. Troubleshooting involves monitoring logs for plugin crashes, as Kong lacks native alerting for such issues, and leveraging the file-log plugin to aid in debugging.