# IP Address issue with multiple kong instances in one cluster

**URL:** <https://discuss.konghq.com/t/ip-address-issue-with-multiple-kong-instances-in-one-cluster/11156>\
**Category:** General\
**Created:** [February 2, 2023, 5:40pm UTC](https://discuss.konghq.com/t/ip-address-issue-with-multiple-kong-instances-in-one-cluster/11156 "2023-02-02T17:40:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Betterton](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/david_betterton/32/3615_2.png) [@David\_Betterton](https://discuss.konghq.com/u/David_Betterton)\
**Post date:** [February 2, 2023, 5:40pm UTC](https://discuss.konghq.com/t/ip-address-issue-with-multiple-kong-instances-in-one-cluster/11156/1 "2023-02-02T17:40:02Z")

</div>

We have multiple namespaces running in a single cluster and have 2 issues:

- Re-use of IP addresses  
\*\* Azure seems to re-allocate IP addresses  
\*\* the targets table in the kong database has IP addresses  
\*\* if the IP is reused (eg after scale down, upgrade, scale up) these can point to other namespaces  
\*\* when this happens the routing fails horribly (requests routed to the wrong service)

- Other namespaces having ingress in each cluster - this seems to be the same as:  
[Deploy Multiple Kong Instances on different namespaces in a k8s cluster](https://discuss.konghq.com/t/deploy-multiple-kong-instances-on-different-namespaces-in-a-k8s-cluster/2843)

Is there any advice on the first one ?

Ingress:

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ams-web # Looks like this has to match the service
  namespace: my-namespace
  annotations:
...
    konghq.com/protocols: http # Upstream protocol
spec:
  ingressClassName: kong
  rules:
    - http:
        paths:
          - path: /ams-web/
            pathType: Prefix
            backend:
              service:
                name: ams-web
                port:
                  number: 8080
          - path: /ams-web
            pathType: Exact
            backend:
              service:
                name: ams-web
                port:
                  number: 8080
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: ams-web-kong-ingress                          
  namespace: my-namespace
upstream:
  algorithm: consistent-hashing
  hash_on: cookie
  hash_on_cookie: X-AMS-KONG-COOKIE
  hash_on_cookie_path: /
...
route:
  methods:
    - POST
    - PUT
    - GET
    - DELETE
  regex_priority: 0
  strip_path: false
  preserve_host: true       
  protocols:
    - http
    - https

```

Deployment

```auto
kind: Deployment
apiVersion: apps/v1
metadata:
  name: ams-web
  namespace: my-namespace
  labels:
    api_version: v2
    app: ams-web
  annotations:
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ams-web
  template:
    metadata:
      labels:
        app: ams-web
        version: v1
    spec:
      volumes:

...
      containers:
        - name: ams-web-blue
          image: kamelosoacr.azurecr.io/ams-web:7.7.6.15-SNAPSHOT
          ports:
            - containerPort: 8080
              protocol: TCP
          env:

...
          resources:
...

```
