Ingress taking wrong Ip?

9/14/2021

When pushing some updates, my ingress suddenly points to a wrong ip for my api. While the client is still correct.

ingress config:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: badvla-ingress
  namespace: badvla
  annotations:
    kubernetes.io/ingress.class: 'nginx'
    nginx.ingress.kubernetes.io/ssl-redirect: 'true'
    nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
    nginx.ingress.kubernetes.io/proxy-body-size: '0'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '600'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '600'
    cert-manager.io/cluster-issuer: 'letsencrypt-prod'
spec:
  tls:
    - hosts:
        - <domain>
      secretName: prod-certificate
  rules:
    - host: <domain>
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: server-server
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: client-client
                port:
                  number: 80

Describe ingress:

Backend

But as you can see in the pod details, the client has the same IP as the describe, but the server is a different one (one that isn't even assigned to any pod) Pods

When I port forward my server I can see it running on port 4000

Anybody has an idea what might be wrong?

-- Kiwi
kubernetes
kubernetes-ingress
nginx-ingress

1 Answer

9/15/2021

Alright,

I found the reason why this was happening. the endpoints were in error:

kubectl get endpoints and then describe the one giving issues va kubectl describe endpoints server-server

The answer showed an error (don't remember which)

I didn't have time to reslove it, so I deleted the helm chart and re-installed it. which fixed it

-- Kiwi
Source: StackOverflow