liyuntao / kong-init

Declarative configuration tool for Kong
Apache License 2.0
38 stars 8 forks source link

How to create Configuration dump from the existing kong? #5

Open maneet8 opened 6 years ago

maneet8 commented 6 years ago

In Kongfig, we have a command 'dump' which actually dumps the configuration of existing kong to yaml file. Do we have sone kind of command in this project?

liyuntao commented 6 years ago

Currently, kong-init do not have such a dump command. Mainly for two reason:

  1. kong-init was originally created for cloud environment(kubernetes/rancher). In our workflow, the developer maintain a git repo contains several yaml files for different environment. These configs are versioned and progressive growing. After CI step finished, there will be a versioned docker image for idempotent initialization afterwards (an example initialization image demonstrated under /example/Dockerfile). There is no dump demand in such scenario/workflow.

  2. For convenience, syntax/structure design of configuration files in kong-init is a bit different from kongfig(plugin applying & directives & env-var support). It's easy for user to write it by hand, but hard to restore dumped data to original configuration.

However the lack of 'dump' command seems unfriendly for users who intends to migrate between such init-tools. I've been thinking about the necessity of implementing the dump command.