Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pleshakov opened this issue Nov 30, 2022 · 0 comments · Fixed by #320
Assignees
Labels
bug Something isn't working

Comments

@pleshakov
Copy link
Contributor

pleshakov commented Nov 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants