Custom plugin deployment options

Uses: Kong Gateway

Docker image

A very popular choice for running Kong Gateway is using container runtime systems. Kong builds and verifies Docker images for use in your deployments and provides detailed instructions on Docker deployments.

You can deploy your custom plugins by building a Docker image that adds your custom plugin code and sets the necessary environment directly in the image. This solution requires more steps in the build stage of your deployment pipeline, but simplifies the data plane deployment as configuration and custom code is shipped directly in the data plane image.

For more details, see the example in the getting started guide.

Kubernetes

Many users choose to run Kong Gateway on Kubernetes. Kong Gateway can be deployed on Kubernetes directly or by using Kong Ingress Controller. In either case, deploying custom plugins on Kubernetes is achieved by adding the custom plugin code to the cluster in a ConfigMap or Secret and mounting it into the Kong Gateway proxy pods. Additionally, the pods must be configured to load the custom plugin code from the mounted volume.

Kong provides a Helm chart which simplifies this process by configuring the necessary environment for the proxy pods based on the plugin you configure. For a non-Helm deployment, you will need to modify the environment directly.

Package path

When running Kong Gateway in bare metal or virtual machine environments, overriding the location that the Lua VM looks for packages to include is a common strategy for deploying a custom plugin. Following the same file structure as shown above, you can distribute the source files on the host machines and modify the lua_package_path configuration value to point to this path. This configuration can also be modified using the KONG_LUA_PACKAGE_PATH environment variable.

See the custom plugin installation documentation for more details on this option.

Note: In addition to bare metal or virtual machine environments, this strategy can work for volume mounts on containerized systems.

LuaRocks package

LuaRocks is a package manager for Lua modules. It allows you to create and install Lua modules as self-contained packages called rocks. In order to create a rock package you author a rockspec file that specifies various information about your package. Using the luarocks tooling, you build an archive from the rockspec file and deliver and extract it to your data planes.

See the Packaging sources section of the custom plugin installation page for details on this distribution option.

Konnect

Konnect is Kong’s unified API platform as a service. Konnect supports custom plugins with some limitations. With an on-premise deployment, users manage Kong Gateway data planes as well as the control plane and, optionally, the backing database. In Konnect, the control plane and database are fully managed for you which limits support for custom data entities and Admin API extensions in your plugin.

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!