Skip to content

Commit 4feb561

Browse files
committed
feat(conf): enable reuseport on all listeners
Signed-off-by: Joshua Schmid <[email protected]>
1 parent ccfac55 commit 4feb561

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
message: add `reuseport` option to listeners
2+
type: feature
3+
scope: Configuration

kong.conf.default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
# HYBRID MODE CONTROL PLANE
428428
#------------------------------------------------------------------------------
429429

430-
#cluster_listen = 0.0.0.0:8005
430+
#cluster_listen = 0.0.0.0:8005 reuseport
431431
# Comma-separated list of addresses and ports on
432432
# which the cluster control plane server should listen
433433
# for data plane connections.
@@ -731,7 +731,7 @@
731731

732732
#mem_cache_size = 128m # Size of each of the two shared memory caches
733733
# for traditional mode database entities
734-
# and runtime data, `kong_core_cache` and
734+
# and runtime data, `kong_core_cache` and
735735
# `kong_cache`.
736736
#
737737
# The accepted units are `k` and `m`, with a minimum
@@ -1910,7 +1910,7 @@
19101910

19111911
# The Admin GUI for Kong Gateway.
19121912

1913-
#admin_gui_listen = 0.0.0.0:8002, 0.0.0.0:8445 ssl
1913+
#admin_gui_listen = 0.0.0.0:8002 reuseport, 0.0.0.0:8445 ssl reuseport
19141914
# Kong Manager Listeners
19151915
#
19161916
# Comma-separated list of addresses and ports on which

kong/templates/kong_defaults.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ node_id = NONE
2727
proxy_listen = 0.0.0.0:8000 reuseport backlog=16384, 0.0.0.0:8443 http2 ssl reuseport backlog=16384
2828
stream_listen = off
2929
admin_listen = 127.0.0.1:8001 reuseport backlog=16384, 127.0.0.1:8444 http2 ssl reuseport backlog=16384
30-
admin_gui_listen = 0.0.0.0:8002, 0.0.0.0:8445 ssl
30+
admin_gui_listen = 0.0.0.0:8002 reuseport, 0.0.0.0:8445 ssl reuseport
3131
status_listen = 127.0.0.1:8007 reuseport backlog=16384
32-
cluster_listen = 0.0.0.0:8005
32+
cluster_listen = 0.0.0.0:8005 reuseport
3333
cluster_control_plane = 127.0.0.1:8005
3434
cluster_cert = NONE
3535
cluster_cert_key = NONE

spec/01-unit/03-conf_loader_spec.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ describe("Configuration loader", function()
5858
assert.equal("eventual", conf.worker_consistency)
5959
assert.same({"127.0.0.1:8001 reuseport backlog=16384", "127.0.0.1:8444 http2 ssl reuseport backlog=16384"}, conf.admin_listen)
6060
assert.same({"0.0.0.0:8000 reuseport backlog=16384", "0.0.0.0:8443 http2 ssl reuseport backlog=16384"}, conf.proxy_listen)
61-
assert.same({"0.0.0.0:8002", "0.0.0.0:8445 ssl"}, conf.admin_gui_listen)
61+
assert.same({"0.0.0.0:8002 reuseport", "0.0.0.0:8445 ssl reuseport"}, conf.admin_gui_listen)
62+
assert.same({"0.0.0.0:8005 reuseport"}, conf.cluster_listen)
6263
assert.equal("/", conf.admin_gui_path)
6364
assert.equal("logs/admin_gui_access.log", conf.admin_gui_access_log)
6465
assert.equal("logs/admin_gui_error.log", conf.admin_gui_error_log)
@@ -175,13 +176,13 @@ describe("Configuration loader", function()
175176
assert.equal(8002, conf.admin_gui_listeners[1].port)
176177
assert.equal(false, conf.admin_gui_listeners[1].ssl)
177178
assert.equal(false, conf.admin_gui_listeners[1].http2)
178-
assert.equal("0.0.0.0:8002", conf.admin_gui_listeners[1].listener)
179+
assert.equal("0.0.0.0:8002 reuseport", conf.admin_gui_listeners[1].listener)
179180

180181
assert.equal("0.0.0.0", conf.admin_gui_listeners[2].ip)
181182
assert.equal(8445, conf.admin_gui_listeners[2].port)
182183
assert.equal(true, conf.admin_gui_listeners[2].ssl)
183184
assert.equal(false, conf.admin_gui_listeners[2].http2)
184-
assert.equal("0.0.0.0:8445 ssl", conf.admin_gui_listeners[2].listener)
185+
assert.equal("0.0.0.0:8445 ssl reuseport", conf.admin_gui_listeners[2].listener)
185186

186187
assert.equal("0.0.0.0", conf.proxy_listeners[1].ip)
187188
assert.equal(8000, conf.proxy_listeners[1].port)

0 commit comments

Comments
 (0)