From 491aa11e1068cc6605598822dc456ef1fc18f4f1 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 2 Jun 2022 15:21:46 -0700 Subject: [PATCH] Revert "Give kubelet the node-ip value (#5579)" This reverts commit aa9065749c9479e7ec4914f73e6c5c0e86cf01bf. Setting dual-stack node-ip does not work when --cloud-provider is set to anything, including 'external'. Just set node-ip to the first IP, and let the cloud provider add the other address. Signed-off-by: Brad Davidson --- pkg/daemons/agent/agent_linux.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/daemons/agent/agent_linux.go b/pkg/daemons/agent/agent_linux.go index 3ad8a83951..b1739c200f 100644 --- a/pkg/daemons/agent/agent_linux.go +++ b/pkg/daemons/agent/agent_linux.go @@ -121,11 +121,9 @@ func kubeletArgs(cfg *config.Agent) map[string]string { if cfg.NodeName != "" { argsMap["hostname-override"] = cfg.NodeName } - if nodeIPs := util.JoinIPs(cfg.NodeIPs); nodeIPs != "" { - defaultIP, err := net.ChooseHostInterface() - if err != nil || defaultIP.String() != nodeIPs { - argsMap["node-ip"] = nodeIPs - } + defaultIP, err := net.ChooseHostInterface() + if err != nil || defaultIP.String() != cfg.NodeIP { + argsMap["node-ip"] = cfg.NodeIP } kubeletRoot, runtimeRoot, controllers := cgroups.CheckCgroups() if !controllers["cpu"] {