Skip to content

OCPBUGS-74211: fix: tolerate all node taints for insights-runtime-extractor DaemonSet - #1325

Open
akshitkumawat wants to merge 2 commits into
openshift:masterfrom
akshitkumawat:fix/OCPBUGS-74211-runtime-extractor-tolerations
Open

OCPBUGS-74211: fix: tolerate all node taints for insights-runtime-extractor DaemonSet#1325
akshitkumawat wants to merge 2 commits into
openshift:masterfrom
akshitkumawat:fix/OCPBUGS-74211-runtime-extractor-tolerations

Conversation

@akshitkumawat

@akshitkumawat akshitkumawat commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • The insights-runtime-extractor DaemonSet had no explicit tolerations, so it only
    ran on the fixed set of taints the DaemonSet controller tolerates by default
    (not-ready, unreachable, disk-pressure, memory-pressure, pid-pressure, unschedulable).
  • Any custom taint added by a cluster admin (e.g. node-role.kubernetes.io/gpu) prevented
    the DaemonSet's pods from scheduling on that node, leaving incomplete cluster coverage.
  • Added a wildcard toleration (operator: Exists) to the DaemonSet pod spec so it
    schedules on every node regardless of taints, per Kubernetes best practice for
    cluster-wide DaemonSets.

Changes

  • pkg/controller/runtimeextractor/resources/manifests/runtime-extractor-daemonset.yaml:
    add wildcard toleration.
  • pkg/controller/runtimeextractor/resources/daemonset_test.go: add
    Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints verifying the toleration.

References

https://issues.redhat.com/browse/OCPBUGS-74211

Test plan

  • go test ./pkg/controller/runtimeextractor/... passes, including new and existing tests.
  • go build ./pkg/controller/runtimeextractor/... succeeds.

Summary by CodeRabbit

  • New Features
    • Updated the runtime extractor DaemonSet to run across all node taints (including custom taints) using a catch-all toleration.
    • Refined scheduling to exclude control-plane-only nodes while still targeting worker-labeled nodes for runtime data collection.
  • Tests
    • Added unit tests to verify catch-all taints toleration behavior.
    • Added unit tests to confirm node affinity excludes master/control-plane roles while allowing workers.

The DaemonSet only tolerated a fixed set of well-known taints, so
custom taints (e.g. node-role.kubernetes.io/gpu) blocked scheduling
on those nodes. Add a wildcard toleration (operator: Exists) so it
runs on every node regardless of taints.
OCPBUGS-74211
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@akshitkumawat: This pull request references Jira Issue OCPBUGS-74211, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • The insights-runtime-extractor DaemonSet had no explicit tolerations, so it only
    ran on the fixed set of taints the DaemonSet controller tolerates by default
    (not-ready, unreachable, disk-pressure, memory-pressure, pid-pressure, unschedulable).
  • Any custom taint added by a cluster admin (e.g. node-role.kubernetes.io/gpu) prevented
    the DaemonSet's pods from scheduling on that node, leaving incomplete cluster coverage.
  • Added a wildcard toleration (operator: Exists) to the DaemonSet pod spec so it
    schedules on every node regardless of taints, per Kubernetes best practice for
    cluster-wide DaemonSets.

Changes

  • pkg/controller/runtimeextractor/resources/manifests/runtime-extractor-daemonset.yaml:
    add wildcard toleration.
  • pkg/controller/runtimeextractor/resources/daemonset_test.go: add
    Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints verifying the toleration.

References

https://issues.redhat.com/browse/OCPBUGS-74211

Test plan

  • go test ./pkg/controller/runtimeextractor/... passes, including new and existing tests.
  • go build ./pkg/controller/runtimeextractor/... succeeds.

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.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: e6bab2ac-c966-4bc5-bc02-30529a105523

📥 Commits

Reviewing files that changed from the base of the PR and between 37909db and 23fa556.

📒 Files selected for processing (2)
  • pkg/controller/runtimeextractor/resources/daemonset_test.go
  • pkg/controller/runtimeextractor/resources/manifests/runtime-extractor-daemonset.yaml

📝 Walkthrough

Walkthrough

The Runtime Extractor DaemonSet now tolerates all node taints and uses required node affinity to target worker nodes while excluding master and control-plane nodes. Unit tests verify both scheduling behaviors.

Changes

Runtime Extractor scheduling

Layer / File(s) Summary
Configure tolerations and node affinity
pkg/controller/runtimeextractor/resources/manifests/runtime-extractor-daemonset.yaml
The DaemonSet tolerates all taints with an Exists toleration and requires worker-node affinity that excludes master and control-plane nodes.
Validate generated scheduling configuration
pkg/controller/runtimeextractor/resources/daemonset_test.go
Loader tests verify the wildcard toleration and the required node affinity expressions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: jmesnil, ncaak


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
Container-Privileges ❌ Error The DaemonSet manifest still sets hostPID: true, privileged: true, and adds CAP_SYS_ADMIN on the extractor container. Remove or justify these privileges, or clarify that the check only applies to newly added lines; as written, the manifest violates the rule.
Description check ⚠️ Warning The description covers summary, changes, references, and tests, but it misses most required template sections like categories, privacy, changelog, and breaking changes. Reformat the PR description to match the template and add the missing sections, especially Categories, Sample Archive, Documentation, Privacy, Changelog, and Breaking Changes.
Topology-Aware Scheduling Compatibility ⚠️ Warning Wildcard toleration plus OR nodeAffinity still matches arbiter nodes; OpenShift docs say arbiter nodes do not run workloads. Add an explicit arbiter exclusion or topology check before tolerating all taints, so this DaemonSet cannot schedule on node-role.kubernetes.io/arbiter.
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: adding taint tolerance to the insights-runtime-extractor DaemonSet.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 added tests use fixed string names and no generated values; there are no Ginkgo titles or dynamic t.Run labels in the changed file.
Test Structure And Quality ✅ Passed The added tests are small unit tests: one behavior each, no cluster resources or waits, and they follow the file’s existing testify-based style.
Microshift Test Compatibility ✅ Passed The added tests are plain unit tests, not Ginkgo e2e tests, and they use only k8s DaemonSet fields plus node affinity/tolerations; no MicroShift-unsupported OpenShift APIs are referenced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; this PR only changes a unit test and the DaemonSet manifest, so SNO multi-node heuristics don’t apply.
Ote Binary Stdout Contract ✅ Passed Changed files only add tests and a DaemonSet manifest; no main/init/TestMain/BeforeSuite code or stdout logging was introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes unit tests and a DaemonSet manifest, with no IPv4 or external-connectivity assumptions.
No-Weak-Crypto ✅ Passed Touched files only adjust DaemonSet tolerations/affinity and tests; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons found.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The touched files only add DaemonSet scheduling config and unit tests; no new logging of secrets/tokens/PII/internal hostnames was introduced.
✨ 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 requested review from ncaak and opokornyy July 24, 2026 11:10
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akshitkumawat
Once this PR has been reviewed and has the lgtm label, please assign ncaak 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

Hi @akshitkumawat. Thanks for your PR.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/controller/runtimeextractor/resources/daemonset_test.go (2)

33-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the new Go test table-driven.

The added test hard-codes one case, while repository guidelines require table-driven tests in Go test files. Put the expected toleration fields in a test-case table and iterate with t.Run.

As per coding guidelines, Go test files must use table-driven tests.

🤖 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 `@pkg/controller/runtimeextractor/resources/daemonset_test.go` around lines 33
- 46, Convert Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints into a
table-driven test by defining cases containing the expected toleration operator,
key, and effect, then iterate over them with t.Run. Keep the existing DaemonSet
loading and assertions, but validate the toleration fields from each case
instead of hard-coding them.

Source: Coding guidelines


37-45: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use fatal assertions before indexing tolerations.

assert.NoError, assert.NotNil, and assert.Len record failures but continue execution. If loading fails or the count is unexpected, tolerations[0] can panic and mask the real assertion failure; use the require equivalents before the indexed assertions.

🤖 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 `@pkg/controller/runtimeextractor/resources/daemonset_test.go` around lines 37
- 45, Update the test around loadRuntimeExtractorDaemonSet to use
require.NoError, require.NotNil, and require.Len before indexing tolerations.
Keep the existing indexed toleration assertions unchanged, ensuring failures
stop execution before tolerations[0] is accessed.
🤖 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 `@pkg/controller/runtimeextractor/resources/daemonset_test.go`:
- Around line 33-46: Convert
Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints into a table-driven test by
defining cases containing the expected toleration operator, key, and effect,
then iterate over them with t.Run. Keep the existing DaemonSet loading and
assertions, but validate the toleration fields from each case instead of
hard-coding them.
- Around line 37-45: Update the test around loadRuntimeExtractorDaemonSet to use
require.NoError, require.NotNil, and require.Len before indexing tolerations.
Keep the existing indexed toleration assertions unchanged, ensuring failures
stop execution before tolerations[0] is accessed.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 87570755-c983-4bdb-aa36-4fe68eacedbd

📥 Commits

Reviewing files that changed from the base of the PR and between 46db2e2 and 37909db.

📒 Files selected for processing (2)
  • pkg/controller/runtimeextractor/resources/daemonset_test.go
  • pkg/controller/runtimeextractor/resources/manifests/runtime-extractor-daemonset.yaml

@opokornyy

Copy link
Copy Markdown
Contributor

/ok-to-test

@opokornyy

Copy link
Copy Markdown
Contributor

/cc @jmesnil

@openshift-ci openshift-ci Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 27, 2026
@openshift-ci
openshift-ci Bot requested a review from jmesnil July 27, 2026 12:16
@openshift-ci openshift-ci Bot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 27, 2026
Comment on lines +38 to +40
# Tolerate all taints so this DaemonSet schedules on every node, including
# nodes with custom taints (e.g. node-role.kubernetes.io/gpu), consistent
# with its purpose of running on every node in the cluster.

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.

I would remove the comment since the field is fairly self explanatory

Comment on lines +33 to +46
// Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints ensures the DaemonSet tolerates
// all node taints (including custom ones added by cluster admins), rather than relying
// on the fixed set of well-known taints the DaemonSet controller tolerates by default.
func Test_loadRuntimeExtractorDaemonSet_TolerateAllTaints(t *testing.T) {
ds, err := loadRuntimeExtractorDaemonSet()
assert.NoError(t, err)
assert.NotNil(t, ds)

tolerations := ds.Spec.Template.Spec.Tolerations
assert.Len(t, tolerations, 1, "expected a single wildcard toleration")
assert.Equal(t, corev1.TolerationOpExists, tolerations[0].Operator)
assert.Empty(t, tolerations[0].Key, "key must be empty to match all taints")
assert.Empty(t, tolerations[0].Effect, "effect must be empty to match all taint effects")
}

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.

I would also drop the test since it isn't testing any logic and therefore doesn't add much value.

@akshitkumawat akshitkumawat Jul 28, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@opokornyy thanks for your inputs. I have pushed the new changes to the branch.

@opokornyy

opokornyy commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@akshitkumawat Failures in the ci/prow/insights-runtime-extractor-tests seem to be related to this change

The wildcard toleration let the DaemonSet schedule onto control-plane
nodes too, breaking the e2e test that expects pods only on worker
nodes. Add a nodeAffinity that excludes control-plane-only nodes while
still allowing compact/SNO nodes that are both control-plane and
worker.
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown

@akshitkumawat: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e 23fa556 link true /test e2e
ci/prow/insights-runtime-extractor-tests 23fa556 link true /test insights-runtime-extractor-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants