mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #46678 from tacy/fix46039
Automatic merge from submit-queue fix#46039: iptables proxier need use '--bind-address' if set **What this PR does / why we need it**: iptables proxier need use '--bind-address' if set **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #46039 **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
commit
117b6248ef
@ -472,6 +472,12 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
|
||||
proxyMode := getProxyMode(string(config.Mode), iptInterface, iptables.LinuxKernelCompatTester{})
|
||||
if proxyMode == proxyModeIPTables {
|
||||
glog.V(0).Info("Using iptables Proxier.")
|
||||
var nodeIP net.IP
|
||||
if config.BindAddress != "0.0.0.0" {
|
||||
nodeIP = net.ParseIP(config.BindAddress)
|
||||
} else {
|
||||
nodeIP = getNodeIP(client, hostname)
|
||||
}
|
||||
if config.IPTables.MasqueradeBit == nil {
|
||||
// MasqueradeBit must be specified or defaulted.
|
||||
return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
|
||||
@ -488,7 +494,7 @@ func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndEx
|
||||
int(*config.IPTables.MasqueradeBit),
|
||||
config.ClusterCIDR,
|
||||
hostname,
|
||||
getNodeIP(client, hostname),
|
||||
nodeIP,
|
||||
recorder,
|
||||
healthzServer,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user