Skip to content

feat: Add Drifted condition to NodePool status - #2696

Closed
moko-poi wants to merge 1 commit into
kubernetes-sigs:mainfrom
moko-poi:feat/add-drifted-condition-to-nodepool
Closed

feat: Add Drifted condition to NodePool status#2696
moko-poi wants to merge 1 commit into
kubernetes-sigs:mainfrom
moko-poi:feat/add-drifted-condition-to-nodepool

Conversation

@moko-poi

@moko-poi moko-poi commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

Fixes #1785

Description

This PR adds a Drifted status condition to NodePool resources that indicates when any NodeClaims managed by the NodePool have drifted from their desired configuration. This enables external tools like ArgoCD to monitor drift state at the NodePool level for GitOps workflows.

Implementation Details:

  • Added DriftedNodeClaim resource type to track drifted NodeClaim counts
  • Added ConditionTypeNodeClaimsDrifted constant to NodePool status conditions
  • Extended cluster state tracking to count drifted NodeClaims per NodePool
  • Updated the counter controller to set the Drifted condition based on drift counts
  • Added DRIFTEDNODECLAIMS printer column to kubectl get nodepool output
  • The condition is set to True when driftedNodeClaimCount > 0, False otherwise

Use Case:
ArgoCD and other GitOps tools can now check the NodePool's Drifted condition to determine if any managed NodeClaims have configuration drift, without needing to query individual NodeClaim resources.

How was this change tested?

  • Added comprehensive unit tests covering multiple scenarios:
    • NodePool with no NodeClaims (condition should be nil)
    • NodePool with NodeClaims that have nil drift condition (should be False)
    • NodePool with all non-drifted NodeClaims (should be False)
    • NodePool with some drifted NodeClaims (should be True)
  • All tests pass successfully (4 Passed | 0 Failed)
  • Verified CRD generation includes the new condition and printer column

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: moko-poi
Once this PR has been reviewed and has the lgtm label, please assign jonathan-innis 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 6, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 6, 2025
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @moko-poi. Thanks for your PR.

I'm waiting for a github.com 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.

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.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 6, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 14, 2025
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 20205840409

Details

  • 28 of 28 (100.0%) changed or added relevant lines in 2 files are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 80.308%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/static/provisioning/controller.go 2 58.54%
pkg/controllers/provisioning/scheduling/preferences.go 7 88.76%
Totals Coverage Status
Change from base Build 19948193551: -0.02%
Covered Lines: 11888
Relevant Lines: 14803

💛 - Coveralls

@moko-poi
moko-poi force-pushed the feat/add-drifted-condition-to-nodepool branch from 963996b to 91d51da Compare January 14, 2026 13:40
@moko-poi

Copy link
Copy Markdown
Contributor Author

@gjtempleton @tallaxes

Hi! I've rebased this PR onto the latest main branch and resolved the conflicts.
Could you please review this PR when you have a chance? Thank you!

@k8s-triage-robot

Copy link
Copy Markdown

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 14, 2026
@k8s-triage-robot

Copy link
Copy Markdown

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 14, 2026
@k8s-triage-robot

Copy link
Copy Markdown

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@k8s-triage-robot: Closed this PR.

Details

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2026
@moko-poi

Copy link
Copy Markdown
Contributor Author

/reopen
/remove-lifecycle rotten

This feature is still tracked by the open issue #1785 (triage/accepted, priority/important-soon). Reopening and rebasing onto the latest main. Could a maintainer please add /ok-to-test and take a look? Thank you!

@k8s-ci-robot k8s-ci-robot reopened this Jun 14, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@moko-poi: Reopened this PR.

Details

In response to this:

/reopen
/remove-lifecycle rotten

This feature is still tracked by the open issue #1785 (triage/accepted, priority/important-soon). Reopening and rebasing onto the latest main. Could a maintainer please add /ok-to-test and take a look? Thank you!

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.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 14, 2026
@moko-poi
moko-poi force-pushed the feat/add-drifted-condition-to-nodepool branch from 91d51da to 5775c66 Compare June 14, 2026 00:54
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2026
@jmdeal

jmdeal commented Aug 3, 2026

Copy link
Copy Markdown
Member

Hey @moko-poi, thanks for raising this. There's been some newer discussion in a different GitHub issue that I think raises more nuance for the solution we want here. Cross-posting my comment from there: #3071 (comment). To minimize churn here and for any other PRs implementing this, let's resolve those open questions there.

@DerekFrank

Copy link
Copy Markdown
Collaborator

Closing in favor of open RFC: #3216

@DerekFrank DerekFrank closed this Aug 25, 2026
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Drifted condition to NodePool that tells whether any nodeclaims are drifted from the desired state

6 participants