kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

No option for REUSEPORT in the template uneven loadbalancing happening across worker process

Open bnnk2 opened this issue 1 year ago • 6 comments

Describe the bug Incoming packets not loadbalanced across the worker process though there is a change in the source ip/port

To Reproduce Configure UDP server and create x worker_process and only 1 worker getting loaded

Expected behavior Since one worker loaded it hits the worker_connections. We expect it to be loadbalanced across workerprocess

Your environment

Any version of nginx has the same issue

Additional context Manually in udp specifying reuseport works fine. But in kubernetes-ingress template doesn't have option to specify and neither the transportserver has the option to add. We assumed this is implicit but looks like not. Since post specifying reuseport manually we could see that loadbalanced across worker process.

Since this is a critical issue. Appreciate any input on the same.

cat internal/configs/version2/nginx.transportserver.tmpl  | grep listen
    listen {{ $s.UnixSocket }} proxy_protocol;
    listen {{ $s.Port }}{{ if $ssl.Enabled }} ssl{{ end }}{{ if $s.UDP }} udp{{ end }};
    {{if not $s.DisableIPV6}}listen [::]:{{ $s.Port }}{{ if $ssl.Enabled }} ssl{{ end }}{{ if $s.UDP }} udp{{ end }};{{end}}

Above from the code and reuseport option not here / template is not supporting the same.. Is there any reason its been not provided or we are missing something and there is anotherway to specify reuseport ?

rgds Balaji

bnnk2 avatar Dec 03 '23 14:12 bnnk2

Hi @bnnk2 thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar Dec 03 '23 14:12 github-actions[bot]

@bnnk2 hello there. It is something we are discussing internally to our templates as we continue to do our research and validation. It is a ongoing discussion

In the meantime, users are able to add the reuseport option to the template and build their image to account for the new change.

HTH

jasonwilliams14 avatar Dec 03 '23 16:12 jasonwilliams14

Custom template would be the safe way to extend the template, rather than forking. While we work at adding this. https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/custom-templates/

Alternatively, anyone is welcome to contribute this enhancement.

brianehlert avatar Dec 04 '23 23:12 brianehlert

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Mar 28 '24 01:03 github-actions[bot]

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Jun 27 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jul 07 '24 01:07 github-actions[bot]