Skip to content

feat: Add bootstrap NRC duration metric#294

Open
rawadhossain wants to merge 1 commit into
kubernetes-sigs:mainfrom
rawadhossain:feat/bootstrap-nrc-duration-metric
Open

feat: Add bootstrap NRC duration metric#294
rawadhossain wants to merge 1 commit into
kubernetes-sigs:mainfrom
rawadhossain:feat/bootstrap-nrc-duration-metric

Conversation

@rawadhossain

@rawadhossain rawadhossain commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds node_readiness_bootstrap_nrc_duration_seconds metric, which measures how long NRC itself holds a node, from when it first applies a rule taint until bootstrap completes.

To record the start time, this extends the existing bootstrap annotation with taintAppliedAt and completed

Since writeTaintAppliedAt now creates the bootstrap annotation before completion, isBootstrapCompleted() now checks the completed field rather than just the annotation's existence. Existing annotations from #224 are still treated as completed, so this remains backward compatible. Calling this out since it changes how bootstrap completion is determined.

Related to Issue #182

Type of Change

/kind feature

Testing

  • Unit tests for isBootstrapCompleted, including backward compatibility and in progress states
  • Integration tests added

Checklist

  • make test passes
  • make lint passes

@kubernetes-prow kubernetes-prow Bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 8, 2026
@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit f85970c
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a4e63f5619aca0008965dec

@kubernetes-prow
kubernetes-prow Bot requested review from dchen1107 and mrunalp July 8, 2026 14:33
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rawadhossain
Once this PR has been reviewed and has the lgtm label, please assign tallclair for approval. For more information see the Code Review Process.

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

Details 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

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 8, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @rawadhossain. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

Details

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-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 8, 2026
Signed-off-by: Rawad Hossain <rawad.hossain00@gmail.com>
@rawadhossain
rawadhossain force-pushed the feat/bootstrap-nrc-duration-metric branch from 10d451f to f85970c Compare July 8, 2026 14:51
// bootstrapAnnotationPayload is the JSON value stored in a bootstrap-completion annotation.
type bootstrapAnnotationPayload struct {
RuleName string `json:"rule-name"`
TaintAppliedAt string `json:"taintAppliedAt,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if the taint was not applied by NRC, rather it adopted the taints added by kubelet (via --register-with-taints), which is the preferred mode of operation for bootstrap-only mode? How does this handle the case?

)

// bootstrapAnnotationPayload is the JSON value stored in a bootstrap-completion annotation.
type bootstrapAnnotationPayload struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO, TaintAppliedAt and Completed are better suited for the dedicated NodeEvaluation 'status' api we planned. Can we discuss this during our next sync on how we could shape it in the alpha2 api?

@kubernetes-prow

Copy link
Copy Markdown

PR needs rebase.

Details

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-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2026
@AvineshTripathi

Copy link
Copy Markdown
Contributor

@rawadhossain can you resolve the conflicts please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants