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

Add metrics for cloud controller manager initial node sync #119241

Merged

Conversation

cartermckinnon
Copy link
Contributor

@cartermckinnon cartermckinnon commented Jul 11, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

In 1.27, cloud controller manager's node controller has a new flag, --concurrent-node-syncs, that controls the parallelism of node controller's actions; such as the handlers that remove the node's initial cloud provider taint. This flag is useful for reducing the amount of time that a new node remains tainted before it can be scheduled work (for example).

The default value is 1 (serial). There is currently no guidance on tuning this value in different environments.

This PR adds metrics to better understand the performance of the node controller's, with a goal of tuning the value for --concurrent-node-syncs in a specific environment and potentially increasng the default value.

Which issue(s) this PR fixes:

Special notes for your reviewer:

I've mostly copied this from the node lifecycle controller's metric setup, let me know if there's a new pattern I should be following: https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/nodelifecycle/metrics.go

Does this PR introduce a user-facing change?

Yes.

Cloud controller manager's node controller now emits timing metrics for initial `Node` synchronization. These metrics measure the delay between the creation of a new `Node` and the node controller's initial management actions, such as removing the cloud provider taint. These metrics should be consulted when setting cloud controller manager's `--concurrent-node-syncs` flag.

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 11, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @cartermckinnon. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 11, 2023
@cartermckinnon cartermckinnon force-pushed the ccm-node-taint-delay-metric branch 2 times, most recently from bd86b1f to cd1ee2f Compare July 12, 2023 00:19
@mengjiao-liu
Copy link
Member

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Jul 12, 2023
@aojea
Copy link
Member

aojea commented Jul 12, 2023

/ok-to-test
/cc @wojtek-t @logicalhan
I like this, some comments to add more metrics 😄

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2023
@cartermckinnon cartermckinnon force-pushed the ccm-node-taint-delay-metric branch 3 times, most recently from ab1248d to 4ad2576 Compare July 12, 2023 16:11
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 13, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 13, 2023
@cartermckinnon
Copy link
Contributor Author

Updated release note with some more details. Thanks for reviewing @aojea!

@logicalhan
Copy link
Member

/triage accepted
/assign @dgrisonnet @logicalhan

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 13, 2023
@andrewsykim
Copy link
Member

cc @jprzychodzen

@cartermckinnon
Copy link
Contributor Author

I pulled out the metric for updateNodeAddress because there's no clear implementation at present, and I want to keep this PR focused on measuring taint removal delay.

@cartermckinnon cartermckinnon changed the title Add metrics for cloud controller manager node sync, update Add metrics for cloud controller manager initial node sync Jul 17, 2023
Copy link
Member

@dgrisonnet dgrisonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from SIG Instrumentation

/lgtm

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

LGTM label has been added.

Git tree hash: edfd700f250e10c56adeb6386248e3bd0bd1b8df

Copy link
Member

@logicalhan logicalhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

/assign @cheftako

@@ -489,6 +493,8 @@ func (cnc *CloudNodeController) syncNode(ctx context.Context, nodeName string) e
return err
}

removeCloudProviderTaintDelay.Observe(time.Since(newNode.ObjectMeta.CreationTimestamp.Time).Seconds())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like.

One small issue is we get nothing if there is a failure with the update or any of the precursor steps. Would be good to have a nodeInitializeFailure metric.

@cheftako
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cartermckinnon, cheftako, dgrisonnet, logicalhan

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 Jul 17, 2023
@k8s-ci-robot k8s-ci-robot merged commit 58b3ae9 into kubernetes:master Jul 17, 2023
12 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Jul 17, 2023
@cartermckinnon cartermckinnon deleted the ccm-node-taint-delay-metric branch July 17, 2023 23:08
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/cloudprovider 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants