Skip to content

✨ Add nodereadinessrulereport CRD and controller#133

Open
Karthik-K-N wants to merge 1 commit intokubernetes-sigs:mainfrom
Karthik-K-N:nrr-report
Open

✨ Add nodereadinessrulereport CRD and controller#133
Karthik-K-N wants to merge 1 commit intokubernetes-sigs:mainfrom
Karthik-K-N:nrr-report

Conversation

@Karthik-K-N
Copy link
Contributor

Description

This PR creates nodereadinessrulereport CRD and controller


# kubectl get nrrp
NAME                                NODE                     MATCHED RULES   UNMATCHED RULES   APPLIED TAINTS   ERRORS   AGE
nrr-report-nrr-test-control-plane   nrr-test-control-plane   0               1                 0                0        82s
nrr-report-nrr-test-worker          nrr-test-worker          0               1                 1                0        82s
nrr-report-nrr-test-worker2         nrr-test-worker2         0               1                 1                0        82s


# kubectl apply -f examples/cni-readiness/network-readiness-rule.yaml
nodereadinessrule.readiness.node.x-k8s.io/network-readiness-rule unchanged


# kubectl get nrrp
NAME                                NODE                     MATCHED RULES   UNMATCHED RULES   APPLIED TAINTS   ERRORS   AGE
nrr-report-nrr-test-control-plane   nrr-test-control-plane   0               1                 0                0        3m33s
nrr-report-nrr-test-worker          nrr-test-worker          1               0                 0                0        3m33s
nrr-report-nrr-test-worker2         nrr-test-worker2         1               0                 0                0        3m33s


# kubectl get nrrp nrr-report-nrr-test-worker2 -o yaml
apiVersion: readiness.node.x-k8s.io/v1alpha1
kind: NodeReadinessRuleReport
metadata:
  creationTimestamp: "2026-02-20T13:05:33Z"
  generation: 1
  name: nrr-report-nrr-test-worker2
  ownerReferences:
  - apiVersion: v1
    blockOwnerDeletion: true
    controller: true
    kind: Node
    name: nrr-test-worker2
    uid: 8701cb81-06fa-4e92-9d82-5de9d6ef0c99
  resourceVersion: "1671"
  uid: db8a7abb-ecc0-4a6d-93f5-97ca3cbc6f53
spec:
  nodeName: nrr-test-worker2
status:
  readinessReports:
  - lastEvaluationTime: "2026-02-20T13:09:38Z"
    message: Node successfully matches all rule criteria.
    reason: CriteriaMet
    ruleName: network-readiness-rule
    ruleStatus: Matched
    taintStatus: Absent
  summary:
    appliedTaints: 0
    errors: 0
    matchedRules: 1
    unMatchedRules: 0

Related Issue

Fixes #89

Type of Change

Testing

Checklist

  • make test passes
  • make lint passes

Does this PR introduce a user-facing change?

Create nodereadinessrulereport CRD and controller

Doc #(issue)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Karthik-K-N
Once this PR has been reviewed and has the lgtm label, please assign ajaysundark 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

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit 598570f
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/69985df53fbb1a00089bf229

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 20, 2026
@Karthik-K-N Karthik-K-N changed the title Add nodereadinessrulereport CRD and controller ✨ Add nodereadinessrulereport CRD and controller Feb 20, 2026
@ajaysundark ajaysundark requested review from ajaysundark and removed request for haircommander and mrunalp February 24, 2026 08:11
}

// ReadinessReport defines the outcome of evaluating a single NodeReadinessRule against a specific Node.
type ReadinessReport struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not strongly opinionated, but does NodeReadinessEvaluation (since this is extracting out NodeEvaluation from rule.status) a better fit for name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, thats looks good too.

// +listType=map
// +listMapKey=ruleName
// +kubebuilder:validation:MaxItems=100
ReadinessReports []ReadinessReport `json:"readinessReports,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't this new array of objects in NodeReadinessRuleReport affect scalability as that could exceed 1.5MB? It seem to me that we are moving the problem around. IMO, the evaluation results should be independent CRs not listed below a uber struct.

but it feels like we should really find where the burden is before refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thought was given that we might have few rules and this report is per node. It should be good. But can explore more.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah okay, having this per node makes sense.

I'm still on it, I'll take a second look later this week.. have been juggling between few things

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure no issues, Thank you.

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split rule.status.NodeEvaluationResults into a separate CRD NodeReadinessEvaluation

3 participants