Skip to content

AUTOSCALE-166: feat(karpenter): deploy NodeOverlay CRD to guest cluster - #9262

Draft
fishereskew wants to merge 1 commit into
openshift:mainfrom
fishereskew:add-nodeoverlay-to-guest-cluster
Draft

AUTOSCALE-166: feat(karpenter): deploy NodeOverlay CRD to guest cluster#9262
fishereskew wants to merge 1 commit into
openshift:mainfrom
fishereskew:add-nodeoverlay-to-guest-cluster

Conversation

@fishereskew

@fishereskew fishereskew commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds the NodeOverlay CRD (karpenter.sh_nodeoverlays.yaml) to the hypershift karpenter controller so it gets deployed to guest clusters alongside EC2NodeClass, NodePool, and NodeClaim.

The upstream karpenter core regression e2e tests expect the NodeOverlay CRD to exist in the cluster. Without this, tests fail with no matches for kind "NodeOverlay".

Which issue(s) this PR fixes:

A part of AUTOSCALE-166

Special notes for your reviewer:

The standalone karpenter-operator repo already has NodeOverlay wired up via CoreCRDs in pkg/assets/assets.go.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • New Features

    • Added support for managing and reconciling NodeOverlay custom resources.
  • Tests

    • Expanded reconciliation coverage to verify NodeOverlay resources are handled correctly.

Signed-off-by: Fisher Eskew <feskew@redhat.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot

openshift-ci-robot commented Aug 7, 2026

Copy link
Copy Markdown

@fishereskew: This pull request references AUTOSCALE-166 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Adds the NodeOverlay CRD (karpenter.sh_nodeoverlays.yaml) to the hypershift karpenter controller so it gets deployed to guest clusters alongside EC2NodeClass, NodePool, and NodeClaim.

The upstream karpenter core regression e2e tests expect the NodeOverlay CRD to exist in the cluster. Without this, tests fail with no matches for kind "NodeOverlay".

Which issue(s) this PR fixes:

A part of AUTOSCALE-166

Special notes for your reviewer:

The standalone karpenter-operator repo already has NodeOverlay wired up via CoreCRDs in pkg/assets/assets.go.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 7, 2026
@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The Karpenter controller now manages the NodeOverlay CRD. It includes the CRD in its definitions, watches nodeoverlays.karpenter.sh, and reconciles create and update operations. The concurrent CRD reconciliation test now includes crdNodeOverlay in setup, snapshots, and integrity checks.

Suggested reviewers: enxebre, maxcao13

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the deployment of the NodeOverlay CRD to the guest cluster, which is the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR adds no Ginkgo or subtest titles. Its test changes only add crdNodeOverlay references; existing titles use static descriptive text.
Test Structure And Quality ✅ Passed The change extends one synchronous fake-client concurrency test; its assertions have diagnostic messages, and it adds no cluster waits or real resources requiring cleanup.
Topology-Aware Scheduling Compatibility ✅ Passed The patch only adds NodeOverlay CRD registration, watching, reconciliation, and test coverage. It adds no pod affinity, topology spread, replicas, selectors, tolerations, or PDB constraints.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR adds no new Ginkgo e2e tests; it only updates CRD controller code and an existing standard Go unit test, with no IPv4 or external-connectivity assumptions.
No-Weak-Crypto ✅ Passed The commit adds only NodeOverlay CRD registration, watch filtering, reconciliation, and test fixtures; no weak crypto, custom crypto, or secret comparison was added.
Container-Privileges ✅ Passed The commit changes only Go controller and test files; no added or changed content contains privileged, host namespace, SYS_ADMIN, root, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The diff adds only NodeOverlay CRD wiring and test coverage; it introduces no logging statements or sensitive values in log fields.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci openshift-ci Bot added area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator and removed do-not-merge/needs-area labels Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
karpenter-operator/controllers/karpenter/karpenter_controller.go (1)

100-101: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add deterministic coverage for the nodeoverlays.karpenter.sh CRD watch.

The *TestReconcileCRDsConcurrentAccess case validates global CRD spec concurrency, but no test checks that a nodeoverlays.karpenter.sh event enqueues the expected controller request. Add coverage for this new case, or use crdNodeOverlay.Name in the case so the watch filter cannot drift from the loaded manifest.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@karpenter-operator/controllers/karpenter/karpenter_controller.go` around
lines 100 - 101, Add deterministic coverage to TestReconcileCRDsConcurrentAccess
confirming that a nodeoverlays.karpenter.sh event enqueues the expected
controller request, or replace the literal watch case with crdNodeOverlay.Name
so it remains aligned with the loaded manifest. Keep existing CRD watch behavior
unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@karpenter-operator/controllers/karpenter/karpenter_controller.go`:
- Around line 100-101: Add deterministic coverage to
TestReconcileCRDsConcurrentAccess confirming that a nodeoverlays.karpenter.sh
event enqueues the expected controller request, or replace the literal watch
case with crdNodeOverlay.Name so it remains aligned with the loaded manifest.
Keep existing CRD watch behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c2c639ce-a8ce-4a47-81ed-7aeeced93b55

📥 Commits

Reviewing files that changed from the base of the PR and between d24cfb2 and e208788.

📒 Files selected for processing (2)
  • karpenter-operator/controllers/karpenter/karpenter_controller.go
  • karpenter-operator/controllers/karpenter/karpenter_controller_test.go

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 45.02%. Comparing base (9e00898) to head (e208788).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ator/controllers/karpenter/karpenter_controller.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9262   +/-   ##
=======================================
  Coverage   45.02%   45.02%           
=======================================
  Files         778      778           
  Lines       97539    97540    +1     
=======================================
+ Hits        43918    43919    +1     
  Misses      50592    50592           
  Partials     3029     3029           
Files with missing lines Coverage Δ
...ator/controllers/karpenter/karpenter_controller.go 30.02% <50.00%> (+0.17%) ⬆️
Flag Coverage Δ
cmd-support 38.77% <ø> (ø)
cpo-hostedcontrolplane 47.24% <ø> (ø)
cpo-other 45.79% <ø> (ø)
hypershift-operator 55.00% <ø> (ø)
other 34.33% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fishereskew

Copy link
Copy Markdown
Contributor Author

/area karpenter-operator

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

Labels

area/karpenter-operator Indicates the PR includes changes related to the Karpenter operator do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants