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 TCP Ingresses do not bind on IPv6 #761

Closed
justjanne opened this issue May 24, 2017 · 1 comment · Fixed by #774
Closed

NGINX TCP Ingresses do not bind on IPv6 #761

justjanne opened this issue May 24, 2017 · 1 comment · Fixed by #774
Labels

Comments

@justjanne
Copy link

justjanne commented May 24, 2017

Steps to reproduce:

  1. Create an nginx ingress controller
  2. Use the TCP ConfigMap to add a TCP Ingress

Expected Behaviour:

Nginx binds this on IPv4 and IPv6

Actual Behaviour:

Nginx binds only on IPv4 for the configured port.

Background Information:

The origin of the issue is in the listen directive in the file controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl. This is configured to only listen to IPv4.

In December 2016, several patches were merged to change the listen directives for the ports :80 and :443 to handle IPv6. Neither did address TCP Ingresses.

Potential Fix:

The same technique currently used for :80 and :443 could also be applied here, replacing

listen {{ $tcpServer.Port }};

with

listen {{ if $IsIPV6Enabled }}[::]:{{ end }}{{ $tcpServer.Port }} {{ if $IsIPV6Enabled }}ipv6only=off{{ end }};

This evaluates, if IPv6 is enabled, to

listen [::]:{{ $tcpServer.Port }} ipv6only=off;

and otherwise to

listen {{ $tcpServer.Port }};

Related issues:

The same happens with UDP Ingresses, and the same fix would be appropriate.

@aledbf
Copy link
Member

aledbf commented May 26, 2017

@justjanne please check if the image quay.io/aledbf/nginx-ingress-controller:0.127 works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants