Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add metrics to show target size of every node group #6361

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

guopeng0
Copy link
Contributor

@guopeng0 guopeng0 commented Dec 8, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR aims to add a new metric that displays the target size of all node groups.This metric is essential for obtaining a clear understanding of the target size of each node group while using the cluster autoscaler.

for example, we can on comparing this metric with the number of Kubernetes nodes to determine if the environment behaves as expected.This is crucial in detecting issues promptly, especially in the production environment.

The periodic update of this value has already been implemented in the UpdateNodes function of ClusterStateRegistry.We just need to add the reporting metrics functionality.This method does not increase the number of calls to the cloud provider nor does it affect other logic.

We kindly request your review of this PR and your thoughts on the proposed implementation.

Thank you for your time and consideration.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/cluster-autoscaler labels Dec 8, 2023
@x13n
Copy link
Member

x13n commented Dec 11, 2023

/assign

@x13n
Copy link
Member

x13n commented Dec 11, 2023

Thanks for the change! It would be a bit more consistent with other metrics if it was exported with them:

// Update node groups min/max and maximum number of nodes being set for all node groups after cloud provider refresh
maxNodesCount := 0
for _, nodeGroup := range a.AutoscalingContext.CloudProvider.NodeGroups() {
metrics.UpdateNodeGroupMin(nodeGroup.Id(), nodeGroup.MinSize())
metrics.UpdateNodeGroupMax(nodeGroup.Id(), nodeGroup.MaxSize())
maxNodesCount += nodeGroup.MaxSize()
}

Though I guess it could have performance implications for cloud provideres that don't cache target size, so let's merge as is.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guopeng0, x13n

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2023
@k8s-ci-robot k8s-ci-robot merged commit 98a77a8 into kubernetes:master Dec 11, 2023
6 checks passed
@guopeng0
Copy link
Contributor Author

@x13n Thank you so much for merging my Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants