Skip to content

NIC removes all listeners when rejecting a new one on a reserved port #4775

@brad0000

Description

@brad0000

Describe the bug
When we add a new listener on a reserved port (e.g. 9113), NIC correctly rejects the listener but also tears down all existing listeners

To Reproduce
Steps to reproduce the behavior:

  1. Deploy a TCP service in AKS / NIC with a listener in GlobalConfiguration and a TransportServer
  2. Edit GlobalConfiguration and add a second listener with a reserved port (e.g. 9113)

KubeEvent log entry: "GlobalConfiguration XXXXX is invalid and was rejected: spec.listeners[110].port: Forbidden: port 9113 is forbidden"
KubeEvent log entry: "Listener XXXX doesn't exist" - repeated for all working listeners

Expected behavior

I expected in this case that NGINX would reject the bad config and revert to last-good config, and the docs suggest this is what should happen:
https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/globalconfiguration-resource/#:~:text=the%20Ingress%20Controller%20will%20ignore%20the%20new%20version

Your environment

  • NIC 3.0.2
  • K8s 1.25
  • AKS
  • NGINX open source

Additional context

We're using NGINX Ingress Controller 3.0.2 (NGINX 1.23.3) in AKS on a couple AKSUbuntu-2204gen2containerd-202309.06.0 nodes. We do regular helm release installs of a single-tenanted TCP & HTTP service for our customers. We had a P1 issue when we added a listener for a new customer to GlobalConfiguration and set the port number to 9113. NGINX rejected the change because 9113 is reserved for prometheus - which is fair enough. But in response it immediately deleted all other existing listeners, which broke 100 TransportServers and blocked access to 100 customers. Surely this is not the intended behaviour.

### Tasks
- [x] Design
- [x] Update documentation

Metadata

Metadata

Assignees

Labels

backlogPull requests/issues that are backlog itemsproposalAn issue that proposes a feature request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions