Skip to content

Commit

Permalink
Merge pull request kubernetes#7453 from gvnc/oci-self-managed-nodes-fix
Browse files Browse the repository at this point in the history
exclude self-managed nodes from being processed
  • Loading branch information
k8s-ci-robot authored Nov 15, 2024
2 parents 97f4089 + a9d5b64 commit b01bff1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cluster-autoscaler/cloudprovider/oci/common/oci_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type OciRef struct {
PrivateIPAddress string
PublicIPAddress string
Shape string
IsNodeSelfManaged bool
}

// NodeToOciRef converts a node object into an oci reference
Expand All @@ -36,6 +37,7 @@ func NodeToOciRef(n *apiv1.Node) (OciRef, error) {
PrivateIPAddress: getNodeInternalAddress(n),
PublicIPAddress: getNodeExternalAddress(n),
Shape: getNodeShape(n),
IsNodeSelfManaged: n.Labels["oci.oraclecloud.com/node.info.byon"] == "true",
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (ocp *OciCloudProvider) NodeGroupForNode(n *apiv1.Node) (cloudprovider.Node
return nil, err
}

// self-managed-nodes aren't expected to be managed by cluster-autoscaler
if ociRef.IsNodeSelfManaged {
return nil, nil
}
ng, err := ocp.manager.GetNodePoolForInstance(ociRef)

// this instance may be part of a node pool that the autoscaler does not handle
Expand All @@ -75,6 +79,9 @@ func (ocp *OciCloudProvider) HasInstance(node *apiv1.Node) (bool, error) {
if err != nil {
return true, err
}
if instance.IsNodeSelfManaged {
return false, nil
}
np, err := ocp.manager.GetNodePoolForInstance(instance)
if err != nil {
return true, err
Expand Down

0 comments on commit b01bff1

Please sign in to comment.