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

Resolve host collisions in VirtualServer and Ingresses #1178

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Previously, if a user deployed two Ingress resources with the same host, the Ingress controller would generate two NGINX servers with the same server_name. After the Ingress Controller reloaded NGINX, one virtual server would win that host, and the other one would be ignored by NGINX. No error was reported to the user in the events/status of the Ingress resources. In the IC logs, NGINX workers would report an error similar to this one 2020/07/31 22:23:57 [warn] 35#35: conflicting server name "cafe.example.com" on 0.0.0.0:80, ignored

The same problem occurred if a user deployed two VirtualServers with the same host or an Ingress and a VirtualServer with the same host.

This PR solves this problem:

  • The Ingress Controller allows only one resource (Ingress or VirtualServer) to own a host
  • If there are multiple resources with the same host, the oldest resource will win, and the rest will be ignored, the IC will report an error to their users by emitting an event and updating the statuses of the resources.

@pleshakov pleshakov added the enhancement Pull requests for new features/feature enhancements label Oct 6, 2020
@pleshakov pleshakov merged commit 8ae4410 into master Oct 7, 2020
@pleshakov pleshakov deleted the host-collisions branch October 7, 2020 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants