Skip to content

Commit 015a294

Browse files
committed
Default the kubelet IPTablesMasqueradeBit to the same value as the kube-proxy IPTablesMasqueradeBit
1 parent eda48d2 commit 015a294

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/cmd/server/kubernetes/node/options/options.go

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ func ComputeKubeletFlags(startingArgs map[string][]string, options configapi.Nod
8484
setIfUnset(args, "authorization-webhook-cache-authorized-ttl", options.AuthConfig.AuthorizationCacheTTL)
8585
setIfUnset(args, "authorization-webhook-cache-unauthorized-ttl", options.AuthConfig.AuthorizationCacheTTL)
8686

87+
// Override kubelet iptables-masquerade-bit value to match overridden kube-proxy
88+
// iptables-masquerade-bit value, UNLESS the user has overridden kube-proxy to match the
89+
// previously-not-overridden kubelet value, in which case we don't want to re-break them.
90+
if len(options.ProxyArguments["iptables-masquerade-bit"]) != 1 || options.ProxyArguments["iptables-masquerade-bit"][0] != "14" {
91+
setIfUnset(args, "iptables-masquerade-bit", "0")
92+
}
93+
8794
if network.IsOpenShiftNetworkPlugin(options.NetworkConfig.NetworkPluginName) {
8895
// SDN plugin pod setup/teardown is implemented as a CNI plugin
8996
setIfUnset(args, "network-plugin", kubeletcni.CNIPluginName)

0 commit comments

Comments
 (0)