Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Declarative Configuration in a lua file #5021
Comments
|
@hishamhm currently (after the issue you referenced is merged) this piece of code in
In addition, when you guys decide to fix that and support Lua declarative configuration, it would be nice to change this line It would be nice the be updated here if and when this support is going to be added. |
|
Should I make a different PR for these changes or continue in the last PR?
|
This enables the already present support for lua declarative configuration as per these [comments](Kong#5021 (comment))
|
@dorongold I'm currently trying to put together a tool that allows to configure Kong in a declarative way, pretty much like you described here. It's not open sourced yet, but I plan to do it in the foreseeable future. I have a question though: Is your idea only for Kong configurations in the DB-less mode? |
|
@andrepiske We only use DB-less mode, so that is the only use-case I was aiming at. |
|
@dorongold Oh that might be it, you're using DB-less mode. |


Summary
Currently Kong supports writing configuration in a file, in YAML or JSON.
To provide a more flexible configuration, especially for those running Kong in different environments (dev, staging, production), an option to write configuration in
luacan be very useful.Additional Details
There are many use-cases that come to mind:
Injecting parts of the configuration from a file, a Kubernetes config-map, or any other source which has different content in different environments.
This can be done using lua functions such as
dofile,load,loadfile,loadstring.etc.