Skip to content

NGINX Kubernetes Gateway doesn't generate an NGINX server for an HTTP listener with 0 routes #316

Closed
@pleshakov

Description

@pleshakov

Describe the bug
NGINX Kubernetes Gateway doesn't generate an NGINX server for an HTTP listener with 0 routes.

To Reproduce

For a Gateway like this:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: gateway
  labels:
    domain: k8s-gateway.nginx.org
spec:
  gatewayClassName: nginx
  listeners:
  - name: http
    port: 80
    protocol: HTTP
    hostname: "cafe.example.com"

NKG generates:

upstream invalid-backend-ref {
    random two least_conn;

    server unix:/var/lib/nginx/nginx-500-server.sock;

}



server {
    listen unix:/var/lib/nginx/nginx-502-server.sock;
    access_log off;

    return 502;
}

server {
    listen unix:/var/lib/nginx/nginx-500-server.sock;
    access_log off;

    return 500;
}

This means NGINX won't listen on port 80, even though the listener is configured.

Expected behavior
NGINX should listen on port 80 if an HTTP listener is configured.

Your environment

  • Version of the NGINX Kubernetes Gateway - release version or a specific commit. The first line of the nginx-gateway container logs includes the commit info. - latest (edge, 55b23d4dbfda3e2e6dac1f3a64201e30d2c8cd8a)

Aha! Link: https://nginx.aha.io/features/NKG-20

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions