mirror of https://github.com/k3s-io/k3s
Rootless mode also bind service nodePort to host for LoadBalancer type
Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>pull/9615/head
parent
3e948aa0d5
commit
8c83b5e0f3
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue