# Declarative config

**URL:** <https://discuss.konghq.com/t/declarative-config/3993>\
**Category:** General\
**Created:** [July 16, 2019, 10:36am UTC](https://discuss.konghq.com/t/declarative-config/3993 "2019-07-16T10:36:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/arun/32/1889_2.png) [@Arun](https://discuss.konghq.com/u/Arun)\
**Post date:** [July 16, 2019, 10:36am UTC](https://discuss.konghq.com/t/declarative-config/3993/1 "2019-07-16T10:36:49Z")

</div>

Hi,

We badly require a good declarative config tool, as we automate all Kong deployments across environments,

_ **Kongfig** _ (used it very happily) but its doesn’t support (services, routes…) - It did cater for all our requirements in the older versions of Kong

_ **decK** _ (I have to mention @hbagdi was very helpful ) - It doesn’t seem to support Consumer credentials, we require key-auth, jwt and basic auth - (I am not sure that credentials are not supported, have raised it as a question with @hbagdi hopefully he says they are supported 🙂)  
Plus it’s missing this feature - [https://github.com/hbagdi/deck/issues/22](https://github.com/hbagdi/deck/issues/22) which is a must for a complete declarative configuration.

_ **kong config** _ - It has a `kong config db_import` - but doesn’t have an export - how are we supposed to guess the syntaxes. I normally create sample entities (services, routes, consumers, including all the plugins I require) and export - so I know what to script. Seems to be early days and again it seems to be an all in one file, tool.

_ **Ansible** _ - Finally I am thinking of using Ansible to script the whole thing.  
It does give me complete freedom, but its going to take a long time to create something that’s production worthy, you know including error handling and so on. Are there scripts already available?

I know there are a few others like _ **gongfig** _, but I am not too keen on json based declarations.

Can you please point to any others I might be missing or help with any of the above to make my migration to the newest versions of Kong easier.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [July 16, 2019, 4:33pm UTC](https://discuss.konghq.com/t/declarative-config/3993/2 "2019-07-16T16:33:22Z")

</div>

> [@Arun](#):
>
> I am not sure that credentials are not supported, have raised it as a question with @hbagdi hopefully he says they are supported

Unfortunately, it is not yet supported but something that is on the roadmap:

> <https://github.com/Kong/deck/issues/12>
>
> Following credential types can be created in Kong, that are associated with a co…nsumer in Kong:
> \- key-auth
> \- hmac-auth
> \- basic-auth
> \- jwt
> \- acl
> 
> Currently, decK cannot manage these plugin specific entities.
> 
> While key-auth, jwt and hmac-auth store credential in plain-text and return them, basic-auth plugin hashes the password. This results in a hash being returned on the Admin API. In such a situation, the credential cannot be compared for a diff and updated if it is out of sync. It is not clear the path that Kong will take in future and if other credentials and secrets will also be hashed or encrypted or both.
> 
> There are a couple of solutions possible:
> \- Add support for the 3 credentials that are in plain-text today and then later if Kong hashes them, drop support for them.
> \- Add support for all credentials, but then warn users that update operation is not supported, meaning deck will take care of creating a credential if one doesn't exist, but will not diff them to apply them again. There can be an annotation on a credential which can force a resync, meaning, the credential will be \`PUT\`. This will result in PUT request to credentials in every sync.
> 
> In either of the solution, hashed information can not be exported from Kong.

> [@Arun](#):
>
> Plus it’s missing this feature - [Feature reqeust: add in support for reading multiple YAML files and directories · Issue #22 · Kong/deck · GitHub](https://github.com/hbagdi/deck/issues/22) which is a must for a complete declarative configuration.

This is definitely coming but until it is available, you should be able to write a quick simple script which takes in all the files in a directory, merges them to render a single file and feed that to decK or `kong config`.

> [@Arun](#):
>
> _ **kong config** _ - It has a `kong config db_import` - but doesn’t have an export - how are we supposed to guess the syntaxes. I normally create sample entities (services, routes, consumers, including all the plugins I require) and export - so I know what to script. Seems to be early days and again it seems to be an all in one file, tool.

DB export is certainly something that Kong will natively support and is on the radar. The multi-file feature can be solved using a quick script until it is supported out of the box with these tools.

---

<div class="post-metadata">

**Author:** ![Arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/arun/32/1889_2.png) [@Arun](https://discuss.konghq.com/u/Arun)\
**Post date:** [July 16, 2019, 4:53pm UTC](https://discuss.konghq.com/t/declarative-config/3993/3 "2019-07-16T16:53:29Z")

</div>

> [@hbagdi](#):
>
> Unfortunately, it is not yet supported but something that is on the roadmap:

Would you be able to give an approximate timeline of when this might be available. It’s quite a blocker.

> [@hbagdi](#):
>
> This is definitely coming but until it is available, you should be able to write a quick simple script which takes in all the files in a directory, merges them to render a single file and feed that to decK or `kong config` .

Agreed, can easily be a script that merges them.

> [@hbagdi](#):
>
> DB export is certainly something that Kong will natively support and is on the radar.

Again an approximate timeline of when this will be available would be good to know.  
As you can understand not having complete documentation of yaml syntaxes supported and not having an export option, renders _kong config_ unusable.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [July 16, 2019, 6:46pm UTC](https://discuss.konghq.com/t/declarative-config/3993/4 "2019-07-16T18:46:25Z")

</div>

Please be patient and don’t cross post across external and internal channels as it creates communication overhead.

> [@Arun](#):
>
> Would you be able to give an approximate timeline of when this might be available. It’s quite a blocker.

Please see my comment in response to your question: [Feature request: add support for Consumer's credentials · Issue #12 · Kong/deck · GitHub](https://github.com/hbagdi/deck/issues/12)

---

<div class="post-metadata">

**Author:** ![Arun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/arun/32/1889_2.png) [@Arun](https://discuss.konghq.com/u/Arun)\
**Post date:** [July 16, 2019, 8:23pm UTC](https://discuss.konghq.com/t/declarative-config/3993/5 "2019-07-16T20:23:43Z")

</div>

Apologies, you are right I did get a bit impatient as I was working towards a target and wasn’t sure which channel you would respond first. But I completely understand that it was unnecessary.

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [July 31, 2019, 2:52pm UTC](https://discuss.konghq.com/t/declarative-config/3993/6 "2019-07-31T14:52:57Z")

</div>

Update:

[https://github.com/hbagdi/deck/issues/22](https://github.com/hbagdi/deck/issues/22) landed in the master branch and will be available in the next release.
