# Managing multiple kong instances - Creation of the kong resources on its respective database

**URL:** <https://discuss.konghq.com/t/managing-multiple-kong-instances-creation-of-the-kong-resources-on-its-respective-database/3475>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [May 9, 2019, 3:33pm UTC](https://discuss.konghq.com/t/managing-multiple-kong-instances-creation-of-the-kong-resources-on-its-respective-database/3475 "2019-05-09T15:33:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgarcial](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/bgarcial/32/776_2.png) [@bgarcial](https://discuss.konghq.com/u/bgarcial)\
**Post date:** [May 9, 2019, 3:33pm UTC](https://discuss.konghq.com/t/managing-multiple-kong-instances-creation-of-the-kong-resources-on-its-respective-database/3475/1 "2019-05-09T15:33:21Z")

</div>

I have two `KONG` instances in a k8s cluster with their respective database

- **Kong sandbox instance** is named `kong-ingress-controller` and it’s configuration is such as follow:

[![enter image description here](https://yyz2.discourse-cdn.com/flex036/uploads/konghq/original/1X/a693560702e221fd2c02823816f1e669a06fc562.png)](https://discuss.konghq.com/uploads/konghq/original/1X/a693560702e221fd2c02823816f1e669a06fc562.png)

- And also I have a **Kong production instance** which is named `kong-ingress-controller-production` and it’s configuration is such as follow:

[![enter image description here](https://yyz2.discourse-cdn.com/flex036/uploads/konghq/original/1X/8fa780d13781b162e85ba50ba56e738e3fe0f1d5.png)](https://discuss.konghq.com/uploads/konghq/original/1X/8fa780d13781b162e85ba50ba56e738e3fe0f1d5.png)

Even, under this configuration schema, I can deploy both **kongs** (sandbox and production instances) in the same port, I mean `8001`, because each kong is located in a different pod machine.

In kong sandbox instance I have created the following kong resources:

- `basic-auth` and `acl` **KongPlugins**

- 2 `KongConsumer` resources with its respective `KongCredentials`

- And also I have configured the `- --ingress-class=kong` parameter in kong sandbox and I have an `Ingress` resource pointing to it

In the kong sandbox environment all resources previously mentioned are created and stored on its kong database.

Not of this way in the kong production environment. Let’s see …

I am creating also in kong production environment the following:

- `basic-auth` and `acl` **KongPlugins**

- 1 `KongConsumer` resource with its respective `KongCredential`

- And also I have configured the `- --ingress-class=kong-production` parameter in kong production and I have an `Ingress` resource pointing to it

**What is happening?**

My two kong sandbox and production instances are running and working, but  
kong sandbox environment database is taking over of the creation and storing of the `KongConsumers` and `KongCredentials`.

These resources are not being stored to the kong production database, the credentials, consumers, basic-auth and ACL plugins are stored on sandbox database …

Only the `KongPlugins` are being stored on kong production database.

The situation looks like the different kong connections were crossed at some point or at least kong sandbox environment is listening and taking the request to kong production environment.

A test or proof of that I am saying, is that even Kong production controller environment ignores the creation of the `Kongconsumer` and its `KongCredential`. THese are the logs in relation to this affirmation

```auto
I0509 14:23:21.759720 6 kong.go:113] syncing global plugins
I0509 14:29:57.353944 6 store.go:371] ingress rule without annotations
I0509 14:29:57.353963 6 store.go:373] ignoring add event for plugin swaggerapi-production-basic-auth based on annotation kubernetes.io/ingress.class with value 
I0509 14:29:57.395732 6 store.go:371] ingress rule without annotations
I0509 14:29:57.395756 6 store.go:373] ignoring add event for plugin swaggerapi-production-acl based on annotation kubernetes.io/ingress.class with value 
I0509 14:29:57.438604 6 store.go:439] ignoring add event for consumer zcrm365dev-consumer based on annotation kubernetes.io/ingress.class with value 
I0509 14:29:57.487996 6 store.go:505] ignoring add event for credential zcrm365dev-credential based on annotation kubernetes.io/ingress.class with value 
I0509 14:29:57.529698 6 store.go:505] ignoring add event for credential zcrm365-prod-acl-credential based on annotation kubernetes.io/ingress.class with value 

```

It’s weird because I am specifying in each Kong deployment the --ingress-class parameter and each one has a specific value of this way:

- kong production environment → `- --ingress-class=kong-production`
- kong sandbox environment → `- --ingress-class=kong`

And also in each `Ingress` resource which is pointing to each specific kong class using the `kubernetes.io/ingress.class` annotation of this way:

- Ingress pointing to kong sandbox —\> `kubernetes.io/ingress.class: "kong"`

- Ingress pointing to kong production —\> `kubernetes.io/ingress.class: "kong-production"`

Someone know what happen here?

How to can I redirect or at least perform debug of this behavior?  
I have been checking the logs, and port-forward operation in order to confirm the availability of both kong instances and also that any of them is not defeating the other, such as we can see in this picture:

[![enter image description here](https://yyz2.discourse-cdn.com/flex036/uploads/konghq/original/1X/95055772c0f73bd074776ccde9e0528f34ffbafb.png)](https://discuss.konghq.com/uploads/konghq/original/1X/95055772c0f73bd074776ccde9e0528f34ffbafb.png)

---

<div class="post-metadata">

**Author:** ![bgarcial](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/bgarcial/32/776_2.png) [@bgarcial](https://discuss.konghq.com/u/bgarcial)\
**Post date:** [May 15, 2019, 9:53am UTC](https://discuss.konghq.com/t/managing-multiple-kong-instances-creation-of-the-kong-resources-on-its-respective-database/3475/2 "2019-05-15T09:53:52Z")

</div>

It was solved! I added the `kubernetes.io/ingress.class: "kong-production"` annotation and now my production instance has taken the credentilas, plugins, acl, and consumers. 😄
