Bare metal Nginx controller with Services as Node port not working

11/8/2019

Hi i have use Nginx controller both community and Nginx repo both works for in cloud with LoadBalancer service. Where as Nginx controller both community and Nginx repo both dose not work with service Nodeport "error 404".

404 Not Found

Service Type Nodeport

apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
    - name: https
      port: 443
      targetPort: 443
      protocol: TCP
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
-- MD Khadeer
kubernetes
kubernetes-ingress
kubernetes-networking
nginx-ingress

1 Answer

11/8/2019

The default behavior of a NGINX Ingress Controller is to reply with a default backed that replies with a 404 - default backend: basically, it's a running Deployment resource returning that default page.

You can try overriding it passing to Helm a variable override using the path defaultBackend.image.repository as described in the README

-- prometherion
Source: StackOverflow