Search code examples
kong

How to mix declarative (db-less) and regular mode with Kong


Kong provides a declarative mode with which the entire configuration can be put in a YAML file. This would be my preferred way of defining the config, since you can easily version control it, and have it deployed over and over again.

It is however imho undesirable to have to configure your consumers and e.g. their rate limits or ACL rights inside YAML configurations. It would mean consumers are exposed in version control tools, and it would not be possible for non-devs to manage users.

Is there a way for Kong to be setup with an initial declarative configuration, while having configurations more prone to change, like consumers and their rights to be in a database? The docs seem to mention a hybrid mode, but it immediately deep-dives into 'control planes' and different nodes, and if it's of any use to my case is entirely lost on me.


Solution

  • As you have realized, db-less and db-based are two different modes of operation. Hybrid mode is a different thing, where you dedicate some Kong nodes to do the proxying (the Data Plane) and other nodes to handle the configuration (the Control Plan). Not what you're looking for.

    I think in your case it's much better to keep on the regular, DB-based mode, and handle "declarativeness" via other means. Maybe decK is for you. It allows you to manage the configuration database via declarative YAML files.