From fa67b9cc7305e4796f322e7f71a39b84d48ba66b Mon Sep 17 00:00:00 2001 From: gujing <925973396@qq.com> Date: Tue, 2 Mar 2021 19:15:45 +0800 Subject: [PATCH 1/2] skip setting network condition for node which has exclude label --- cloud-controller-manager/controller/node/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud-controller-manager/controller/node/controller.go b/cloud-controller-manager/controller/node/controller.go index 32e9c348e..90da82dc9 100644 --- a/cloud-controller-manager/controller/node/controller.go +++ b/cloud-controller-manager/controller/node/controller.go @@ -390,7 +390,8 @@ func (cnc *CloudNodeController) doAddCloudNode(node *v1.Node) error { // This condition marks the node as unusable until routes are initialized in the cloud provider // Aoxn: Hack for alibaba cloud if route.Options.ConfigCloudRoutes && - cnc.cloud.ProviderName() == "alicloud" { + cnc.cloud.ProviderName() == "alicloud" && + !utils.IsExcludedNode(node) { if err := cnc.setNodeCondition(node); err != nil { klog.Errorf("set node %s condition error: %s", node.Name, err.Error()) return false, nil From 6f8114fd6dad8dad1de2c244195d75c3b4603a8f Mon Sep 17 00:00:00 2001 From: gujing <925973396@qq.com> Date: Wed, 3 Mar 2021 14:41:07 +0800 Subject: [PATCH 2/2] update user managed node func --- cloud-controller-manager/listeners.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cloud-controller-manager/listeners.go b/cloud-controller-manager/listeners.go index 1b810edc5..974fba1df 100644 --- a/cloud-controller-manager/listeners.go +++ b/cloud-controller-manager/listeners.go @@ -1513,10 +1513,9 @@ func (n *Listener) listenerHasUserManagedNode(ctx context.Context) (bool, error) } for _, backend := range remoteVg.BackendServers.BackendServer { - klog.V(5).Infof("remote: %s, local: %s ", backend.Description, n.NamedKey.Reference(int32(backend.Port))) - if isUserManagedNode(backend.Description, n.NamedKey.Reference(int32(backend.Port))) { - klog.Infof("%s vgroup %s has user managed node, node ip is %s, node id is %s", - n.NamedKey, n.VServerGroupId, backend.ServerIp, backend.ServerId) + if isUserManagedNode(backend.Description, remoteVg.VServerGroupName) { + klog.Infof("%s has user managed node %s, description %s, vGroupName: %s", + n.VServerGroupId, backend.ServerId, backend.Description, remoteVg.VServerGroupName) return true, nil } }