1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-02 07:24:20 +00:00

revert to skip network plugin port checks of udp port

This commit is contained in:
Guangbo Chen
2019-01-28 19:47:30 +08:00
committed by Alena Prokharchyk
parent 860058e878
commit ea4b16b116

View File

@@ -534,9 +534,10 @@ func checkPlanePortsFromHost(ctx context.Context, host *hosts.Host, portList []s
if tcp { if tcp {
cmd = append(cmd, "for host in $HOSTS; do for port in $PORTS ; do echo \"Checking host ${host} on port ${port}\" >&1 & nc -w5 -z $host $port > /dev/null || echo \"${host}:${port}\" >&2 & done; wait; done") cmd = append(cmd, "for host in $HOSTS; do for port in $PORTS ; do echo \"Checking host ${host} on port ${port}\" >&1 & nc -w5 -z $host $port > /dev/null || echo \"${host}:${port}\" >&2 & done; wait; done")
} else { } else {
// UDP port scans using the -uz combination of flags will always report success irrespective of the target machine's state, // TODO: add proper UDP port checks, and because UDP is not reliable so it has no acknowledgment, retransmission, or timeout.
// so instead we use -uzv to log verbose output if the checking port is not open or unreachable, and it will print nothing if it succeeds // Also the k8s layer 3 network like flannel will filtering the host port like 8472 once is installed, so commands like `nc -w5 -uzv $host $port` will always return the same message regardless of the udp port is opened or not.
cmd = append(cmd, "for host in $HOSTS; do for port in $PORTS ; do echo \"Checking host ${host} on port ${port}\" >&1 & nc -w5 -uzv $host $port > /dev/null & done; wait; done") // More details on: https://github.com/rancher/rke/issues/1102
return nil
} }
for _, host := range planeHosts { for _, host := range planeHosts {