From ebef78a679b18fc08af7b10b4f2f1dd64590c973 Mon Sep 17 00:00:00 2001 From: shubham82 Date: Thu, 29 Jun 2023 12:08:38 +0530 Subject: [PATCH 1/2] Backport #5776 [cluster-autoscaler] "Change magnum to use control-plane role" into CA1.27 --- .../cloudprovider/magnum/magnum_cloud_provider.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go b/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go index 7f254170da31..879e7a464a0e 100644 --- a/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go @@ -124,6 +124,10 @@ func (mcp *magnumCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovide if _, found := node.ObjectMeta.Labels["node-role.kubernetes.io/master"]; found { return nil, nil } + // Ignore control-plane nodes + if _, found := node.ObjectMeta.Labels["node-role.kubernetes.io/control-plane"]; found { + return nil, nil + } ngUUID, err := mcp.magnumManager.nodeGroupForNode(node) if err != nil { From 3e0f68a11b31948046cef148bad544686e58d9a4 Mon Sep 17 00:00:00 2001 From: shubham82 Date: Mon, 3 Jul 2023 14:03:36 +0530 Subject: [PATCH 2/2] Added blank line. --- cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go b/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go index 879e7a464a0e..e2f33fc3ba8a 100644 --- a/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/magnum/magnum_cloud_provider.go @@ -124,6 +124,7 @@ func (mcp *magnumCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovide if _, found := node.ObjectMeta.Labels["node-role.kubernetes.io/master"]; found { return nil, nil } + // Ignore control-plane nodes if _, found := node.ObjectMeta.Labels["node-role.kubernetes.io/control-plane"]; found { return nil, nil