mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #47212 from MrHohn/kubelet-iptables-lock
Make kubelet touch iptables lock file during initialization
This commit is contained in:
commit
2a5ac62dd4
@ -507,6 +507,16 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
|
||||
}
|
||||
glog.Infof("Hairpin mode set to %q", hairpinMode)
|
||||
|
||||
// TODO(#36485) Remove this workaround once we fix the init-container issue.
|
||||
// Touch iptables lock file, which will be shared among all processes accessing
|
||||
// the iptables.
|
||||
f, err := os.OpenFile(utilipt.LockfilePath16x, os.O_CREATE, 0600)
|
||||
if err != nil {
|
||||
glog.Warningf("Failed to open iptables lock file: %v", err)
|
||||
} else if err = f.Close(); err != nil {
|
||||
glog.Warningf("Failed to close iptables lock file: %v", err)
|
||||
}
|
||||
|
||||
if plug, err := network.InitNetworkPlugin(kubeDeps.NetworkPlugins, crOptions.NetworkPluginName, &criNetworkHost{&networkHost{klet}, &network.NoopPortMappingGetter{}}, hairpinMode, kubeCfg.NonMasqueradeCIDR, int(crOptions.NetworkPluginMTU)); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user