# Kong in dbless mode + Kong Ingress controller

**URL:** <https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401>\
**Category:** Questions\
**Created:** [May 30, 2020, 3:06am UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401 "2020-05-30T03:06:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [May 30, 2020, 3:06am UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/1 "2020-05-30T03:06:15Z")

</div>

Hi,  
We are planning to use Kong in DB-less mode along with the Kong ingress controller. In this case, do you still need to run “Kong migrations up” and “Kong migrations finished” command. I didn’t find any specific documentation on DB-less mode but since there is no data store associated, I am assuming we don’t need to run these commands. Please let me know if that’s not true!

Thanks,  
Srinivas

---

<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:** [June 1, 2020, 4:00pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/2 "2020-06-01T16:00:09Z")

</div>

You don’t need to run any migrations with DB-less.

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 1, 2020, 8:08pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/3 "2020-06-01T20:08:43Z")

</div>

@hbagdi, thank you so much for the quick confirmation!

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 10, 2020, 6:25pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/4 "2020-06-10T18:25:01Z")

</div>

@hbagdi, in dbless mode, can you let me know where the kong runtime objects like consumers, enabled plugins info is stored? I am following up with a new question so that anyone looking for kong dbless mode and ingress controller information can see all this information at one place. Hope it’s ok!

---

<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:** [June 11, 2020, 4:50pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/5 "2020-06-11T16:50:21Z")

</div>

> [@smuthunoori](#):
>
> can you let me know where the kong runtime objects like consumers, enabled plugins info is stored?

The configuration is all stored in k8s data-store i.e. etcd.  
In Kong, it is stored in-memory (not persisted to disk anywhere).

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 11, 2020, 4:59pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/6 "2020-06-11T16:59:54Z")

</div>

@hbagdi, Thank you so much for the quick response. If it is stored in memory, what is the best way to handle kong reload? Earlier, we had been using kong with Cassandra db (without ingress controller) and now we are moving to Kong ingress controller + db less mode. We also use **custom nginx templates**.

So our kong reload has been using the following command:

> kong reload --conf /etc/kong/kong.conf --nginx-conf /etc/kong/kong\_nginx.conf --vv

When I run reload on dbless, the routes are being lost as it complains with error

> {  
> “message”: “no Route matched with those values”  
> }

This issue is not seen when I restart kong though!

Also, we had been writing custom plugins and also extended admin api (implemented api.lua), will this still work with this dbless config + kong ingress controller deployment?

Any pointers to how this can be resolved will be very helpful.

Thanks,  
Srinivas

---

<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:** [June 11, 2020, 9:34pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/7 "2020-06-11T21:34:18Z")

</div>

You cannot do reloads with this deployment model. Update your deployment to roll your kong pods and gracefully restart kong in this case.

> [@smuthunoori](#):
>
> Also, we had been writing custom plugins and also extended admin api (implemented api.lua), will this still work with this dbless config + kong ingress controller deployment?

The controller can support some custom entities if you would like that.  
Please read: [https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/guides/configuring-custom-entities.md](https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/guides/configuring-custom-entities.md)

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 11, 2020, 9:50pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/8 "2020-06-11T21:50:35Z")

</div>

@hbagdi, Thank you once again for the quick response. I really appreciate your turn around time!

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 12, 2020, 6:29pm UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/9 "2020-06-12T18:29:48Z")

</div>

@hbagdi, When my custom plugins are invoked, I am getting an uninitialized exception unless I add the following lines to the kong’s code:

**File: /usr/local/share/lua/5.1/kong/init.lua**

> ```
> function Kong.access()
> 
> ```
> 
> local ctx = ngx.ctx  
> – Srini Added  
> if not ctx.KONG\_PROCESSING\_START then  
> ctx.KONG\_PROCESSING\_START = ngx.req.start\_time() \* 1000  
> end  
> – End here

> function Kong.balancer()  
> – This may be called multiple times, and no yielding here!  
> local now\_ms = get\_now\_ms()
> 
> local ctx = ngx.ctx  
> – Srini Added  
> if not ctx.KONG\_PROCESSING\_START then  
> ctx.KONG\_PROCESSING\_START = ngx.req.start\_time() \* 1000  
> end  
> – End here

Am I missing something here?

Please let me know.

Thanks,  
Srinivas

---

<div class="post-metadata">

**Author:** ![smuthunoori](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/smuthunoori/32/1831_2.png) [@smuthunoori](https://discuss.konghq.com/u/smuthunoori)\
**Post date:** [June 13, 2020, 1:41am UTC](https://discuss.konghq.com/t/kong-in-dbless-mode-kong-ingress-controller/6401/10 "2020-06-13T01:41:14Z")

</div>

@hbagdi, I went over the link provided for using custom entities. This seems to be specific to custom plugins but how can I handle the ssl certs reload that are configured in kong.conf and nginx.conf files?

Also, would you always need to create a consumer, if the access management to a route/service is being handled by our proprietary module? In other words, when would you use a kong consumer? The kong documentation just mentions the following about consumer object:

> Consumers are associated to individuals using your API, and can be used for tracking, access management, and more.

Please let me know.

Thanks,  
Srinivas
