Ingress-nginx: ingress is not listening on port 80

Created on 1 Dec 2019  Â·  8Comments  Â·  Source: kubernetes/ingress-nginx

NGINX Ingress controller version: 0.26.1

Kubernetes version (use kubectl version): v1.16.3

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): deepin 15.11
  • Kernel (e.g. uname -a): Linux w-pc 5.4.0-xanmod0 #1.191125 SMP PREEMPT Mon Nov 25 16:18:17 -03 2019 x86_64 GNU/Linux

  • Install tools:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
  • Others:

What happened:
localhost: 31486 access normally, but port 80 is not accessible, why.

kubectl get service -n ingress-nginx
NAME            TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx   LoadBalancer   10.103.3.137   <pending>     80:31486/TCP,443:31929/TCP   74m

Use netstat to find no process listening on port 80.

netstat  -tunlp | grep 80
tcp        0      0 192.168.2.187:2380      0.0.0.0:*               LISTEN      6931/etcd           

What you expected to happen:
Accessible via localhost port 80

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:
This is a single node k8s test environment built locally

Most helpful comment

I tried to install in ubuntu18.04 and it was normal. Could this be related to the operating system?

If you used Ubuntu and it worked, then it is not related to the ingress-nginx itself.
Did you search is the operating system is supported in Kubernetes?

Keep in mind the ingress controller is just another pod and has nothing to do with the Kubernetes networking exposing ports or configuring iptables rules.

The problem has been solved, you can add the following code to the deployment.

spec: 
  template:
    spec:
      hostNetwork: true

All 8 comments

Cloud provider or hardware configuration:

If that's empty I assume you are trying to use the ingress controller in bare-metal (or docker in docker)
In that case you cannot use a service type=LoadBalancer. Please check https://kubernetes.github.io/ingress-nginx/deploy/baremetal/

Cloud provider or hardware configuration:

If that's empty I assume you are trying to use the ingress controller in bare-metal (or docker in docker)
In that case you cannot use a service type=LoadBalancer. Please check https://kubernetes.github.io/ingress-nginx/deploy/baremetal/

I do n’t understand what to do to solve this problem,
I tried to install in ubuntu18.04 and it was normal. Could this be related to the operating system?

I tried to install in ubuntu18.04 and it was normal. Could this be related to the operating system?

If you used Ubuntu and it worked, then it is not related to the ingress-nginx itself.
Did you search is the operating system is supported in Kubernetes?

Keep in mind the ingress controller is just another pod and has nothing to do with the Kubernetes networking exposing ports or configuring iptables rules.

I tried to install in ubuntu18.04 and it was normal. Could this be related to the operating system?

If you used Ubuntu and it worked, then it is not related to the ingress-nginx itself.
Did you search is the operating system is supported in Kubernetes?

Keep in mind the ingress controller is just another pod and has nothing to do with the Kubernetes networking exposing ports or configuring iptables rules.

The problem has been solved, you can add the following code to the deployment.

spec: 
  template:
    spec:
      hostNetwork: true

The problem has been solved, you can add the following code to the deployment.

What do you mean? In the provided yaml files to install the ingress controller?
If that's the request, no.

What you did (hostNetwork: true) means you can only have one pod of the ingress controller per node. Something not everyone expects.

The problem has been solved, you can add the following code to the deployment.

What do you mean? In the provided yaml files to install the ingress controller?
If that's the request, no.

What you did (hostNetwork: true) means you can only have one pod of the ingress controller per node. Something not everyone expects.

I don't use this approach in a production environment, I just use it locally for testing.

i am working on POC, added "hostNetwork: true" to ingress controller deployment manifest. worked fine for me. thank you @wxq851685279

added "hostNetwork: true" worked for me, also.
my strategy is one nginx-ingress-controller per node, very well fit for my cases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sophaskins picture sophaskins  Â·  3Comments

cxj110 picture cxj110  Â·  3Comments

c-mccutcheon picture c-mccutcheon  Â·  3Comments

lachlancooper picture lachlancooper  Â·  3Comments

silasbw picture silasbw  Â·  3Comments