Error (listener 'http:0.0.0.0:80' failed to bind) in consul-ingress-gateway pod when I create ingress-gateway

The moment I create ingress-gateway using the yaml below, I start getting this error in consul-ingress-gateway pod logs repeatedly.

2022-12-14T11:06:27.430Z+00:00 [error] envoy.config(13) listener 'http:0.0.0.0:80' failed to bind or apply socket options: cannot bind '0.0.0.0:80': Permission denied

2022-12-14T11:06:27.431Z+00:00 [warning] envoy.config(13) delta config for type.googleapis.com/envoy.config.listener.v3.Listener rejected: Error adding/updating listener(s) http:0.0.0.0:80: cannot bind '0.0.0.0:80': Permission denied

YAML used to generate IngressGateway

---
apiVersion: consul.hashicorp.com/v1alpha1
kind: IngressGateway
metadata:
  name: ingress-gateway
  namespace: wm
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  listeners:
  - port: 80
    protocol: http
    services:
    - name: webproxy
      hosts: ["*"]
  tls:
    enabled: false

Sending request from outside on this gateway also returns 502 Bad Gateway Error.
What could be the reason?

Parag

Facing same issue. @parag Did you find any solution on this ?

@parag @rohit.j Did you get solution to this issue?

Hey,

I resolved this issue to change port 80 to 8080. Also changed port 8080 in kind ingress gateway.
ex.
apiVersion: consul.hashicorp.com/v1alpha1
kind: IngressGateway
metadata:
name: ingress-gateway
spec:
listeners:
- protocol: http
port: 8080
services:
- name: xxxxxxxxxx
hosts: [‘*’]

Also changed service port to 8080 and ingress host port is also changed to 8080

1 Like