title: Managing multiple kong instances - Creation of the kong resources on its respective database
body: <p>I have two <code>KONG</code> instances in a k8s cluster with their respective database</p>
  
  <ul>
  <li><strong>Kong sandbox instance</strong> is named <code>kong-ingress-controller</code> and it's configuration is such as follow:</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/P7M1H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P7M1H.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>And also I have  a <strong>Kong production instance</strong> which is named <code>kong-ingress-controller-production</code> and it's configuration is such as follow:</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/3vCdR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3vCdR.png" alt="enter image description here"></a></p>
  
  <p>Even, under this configuration schema, I can deploy both <strong>kongs</strong> (sandbox and production instances) in the same port, I mean <code>8001</code>, because each kong is located in a different pod machine.</p>
  
  <p>In kong sandbox instance I have created the following kong resources:</p>
  
  <ul>
  <li><p><code>basic-auth</code> and <code>acl</code> <strong>KongPlugins</strong></p></li>
  <li><p>2 <code>KongConsumer</code> resources with its respective <code>KongCredentials</code></p></li>
  <li><p>And also I have configured the <code>- --ingress-class=kong</code> parameter in kong sandbox and I have an <code>Ingress</code> resource pointing to it</p></li>
  </ul>
  
  <p>In the kong sandbox environment all resources previously mentioned are created and stored on its kong database. </p>
  
  <p>Not of this way in the kong production environment. Let's see ...</p>
  
  <p>I am creating also in kong production environment the following:</p>
  
  <ul>
  <li><p><code>basic-auth</code> and <code>acl</code> <strong>KongPlugins</strong></p></li>
  <li><p>1 <code>KongConsumer</code> resource with its respective <code>KongCredential</code></p></li>
  <li><p>And also I have configured the <code>- --ingress-class=kong-production</code> parameter in kong production and I have an <code>Ingress</code> resource pointing to it</p></li>
  </ul>
  
  <p><strong>What is happening?</strong></p>
  
  <p>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  <code>KongConsumers</code> and <code>KongCredentials</code>.</p>
  
  <p>These resources are not being stored to the kong production database, the credentials, consumers, basic-auth and ACL plugins are stored on sandbox database ...</p>
  
  <p>Only the <code>KongPlugins</code> are being stored on kong production database.</p>
  
  <p>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. </p>
  
  <p>A test or proof of that I am saying, is that even Kong production controller environment ignores the creation of the <code>Kongconsumer</code> and its <code>KongCredential</code>. THese are the logs in relation to this affirmation</p>
  
  <pre><code>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 
  
  </code></pre>
  
  <p>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:</p>
  
  <ul>
  <li>kong production environment  -->  <code>- --ingress-class=kong-production</code></li>
  <li>kong sandbox environment  -->  <code>- --ingress-class=kong</code></li>
  </ul>
  
  <p>And also in each <code>Ingress</code> resource which is pointing to each specific kong class using the <code>kubernetes.io/ingress.class</code> annotation of this way:</p>
  
  <ul>
  <li><p>Ingress pointing to kong sandbox ---> <code>kubernetes.io/ingress.class: "kong"</code></p></li>
  <li><p>Ingress pointing to kong production ---> <code>kubernetes.io/ingress.class: "kong-production"</code></p></li>
  </ul>
  
  <p>Someone know what happen here?</p>
  
  <p>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:</p>
  
  <p><a href="https://i.stack.imgur.com/Jxu80.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jxu80.png" alt="enter image description here"></a></p>