Ingress nginx


#1

Hello, i’m having troubles setting up ingress nginx in a cluster.
I tried following a lot of different guides and i can’t seem to get past a “default backend - 404” error.
I’m running a private network cluster with just a master and a worker.

Here is my ingress:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
ingress.kubernetes.io/rewrite-target: /
name: nginx-ingress
namespace: default
spec:
rules:
- host: km1
http:
paths:
- backend:
serviceName: nginx
servicePort: 80
path: /

Here the ingress service:
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: nginx-ingress
chart: nginx-ingress-0.3.0
component: controller
heritage: Tiller
release: nginx-ingress-release
name: nginx-ingress-release-controller
selfLink: /api/v1/namespaces/default/services/nginx-ingress
spec:
externalTrafficPolicy: Local
ports:

  • name: http
    port: 80
    protocol: TCP
    targetPort: 80
  • name: https
    port: 443
    protocol: TCP
    targetPort: 443
    selector:
    app: nginx-ingress-release-controller
    component: controller
    release: nginx-ingress-release
    sessionAffinity: None
    type: NodePort
    status:
    loadBalancer: {}

The service i’m trying to call is just a regular nginx service, i tried with a different one and it had the same problems.

Is there anything i can check or anything i might be doing wrong?.


#2

Hello @lcittadini,

The first thing that is not evident from all blogs is that there are different versions of nginx ingress controllers. This document link provides some details about the differences differences between nginx ingress controllers.

Each of the nginx ingress controllers have different versions and defaults. It appears you may be using an old version of one of the controllers chart: nginx-ingress-0.3.0 I would recommend following the documentation of your chosen nginx ingress controller. You will find links to each of the controller’s documentation in the link I provided above.