Skip to content

Commit

Permalink
Rootless mode also bind service nodePort to host for LoadBalancer type
Browse files Browse the repository at this point in the history
Signed-off-by: Edgar Lee <[email protected]>
  • Loading branch information
hinshun authored and brandond committed Mar 1, 2024
1 parent 3e948aa commit 8c83b5e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/rootlessports/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@ func (h *handler) toBindPorts() (map[int]int, error) {
continue
}

if port.Port != 0 {
if port.Port <= 1024 {
toBindPorts[10000+int(port.Port)] = int(port.Port)
for _, toBindPort := range []int32{port.Port, port.NodePort} {
if toBindPort == 0 {
continue
}
if toBindPort <= 1024 {
toBindPorts[10000+int(toBindPort)] = int(toBindPort)
} else {
toBindPorts[int(port.Port)] = int(port.Port)
toBindPorts[int(toBindPort)] = int(toBindPort)
}
}
}
Expand Down

0 comments on commit 8c83b5e

Please sign in to comment.