Skip to content

Conversation

@moko-poi
Copy link
Contributor

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

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
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
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

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

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

3 participants