Skip to content

SPIRE-617, OCPBUGS-90556: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage - #149

Open
sayak-redhat wants to merge 1 commit into
openshift:mainfrom
sayak-redhat:SPIRE-617
Open

SPIRE-617, OCPBUGS-90556: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage#149
sayak-redhat wants to merge 1 commit into
openshift:mainfrom
sayak-redhat:SPIRE-617

Conversation

@sayak-redhat

@sayak-redhat sayak-redhat commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Unset gcInterval serializes as 0, causing continuous GC loop.

Summary by CodeRabbit

  • Bug Fixes
    • Configured the controller manager to perform garbage collection at regular 10-second intervals.
    • Updated configuration validation to ensure the garbage-collection interval is included correctly.

…Unset gcInterval serializes as 0, causing continuous GC loop.
@openshift-ci
openshift-ci Bot requested review from TrilokGeer and swghosh July 20, 2026 08:48
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Walkthrough

The generated spire-controller-manager configuration now sets GCInterval to 10 seconds. The configuration test verifies that the YAML contains gcInterval: 10000000000.

Changes

Controller Manager GC Configuration

Layer / File(s) Summary
Configure and validate GC interval
pkg/controller/spire-server/configmap.go, pkg/controller/spire-server/configmaps_test.go
The generated controller-manager configuration sets GCInterval to 10 * time.Second, and the YAML test asserts the serialized gcInterval value.

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

Suggested reviewers: anirudhagniredhat

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
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 No test titles changed; the only nearby names are static strings like "Valid config" and "Empty trust domain", with no dynamic data.
Test Structure And Quality ✅ Passed PASS: The modified test is a plain table-driven unit test, not Ginkgo; it’s focused on YAML generation, uses no cluster resources or waits, and includes clear failure messages.
Microshift Test Compatibility ✅ Passed Only a controller config change and a plain Go unit test were added; no Ginkgo e2e tests or unsupported MicroShift APIs/features are present.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only a unit test assertion changed; no new Ginkgo/e2e test or multi-node assumption was added.
Topology-Aware Scheduling Compatibility ✅ Passed PR only sets GCInterval in controller-manager config and updates tests; no replicas, affinity, nodeSelector, or topology-aware scheduling changes.
Ote Binary Stdout Contract ✅ Passed Diff only sets GCInterval in config generation and adds a matching test; no process-level stdout writes were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR only changes config generation and a unit test; no Ginkgo/e2e tests, IPv4-only assumptions, or external connectivity were added.
No-Weak-Crypto ✅ Passed Changes only set GCInterval and update a YAML test; no weak crypto, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed No privileged container/K8s settings were added; the diff only sets GCInterval in config YAML and updates its test.
No-Sensitive-Data-In-Logs ✅ Passed The PR only sets gcInterval and updates a test; no new logging or sensitive-data exposure was introduced.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: setting gcInterval to 10s to avoid high CPU usage in spire-controller-manager.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@sayak-redhat sayak-redhat changed the title fix: set gcInterval=10s to prevent spire-controller-manager 100% CPU,… fix: set gcInterval=10s to prevent spire-controller-manager High CPU,… Jul 20, 2026
@sayak-redhat sayak-redhat changed the title fix: set gcInterval=10s to prevent spire-controller-manager High CPU,… fix: set gcInterval=10s to prevent spire-controller-manager High CPU Jul 20, 2026
@sayak-redhat sayak-redhat changed the title fix: set gcInterval=10s to prevent spire-controller-manager High CPU SPIRE-617: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage Jul 20, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 20, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 20, 2026

Copy link
Copy Markdown

@sayak-redhat: This pull request references SPIRE-617 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 task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Unset gcInterval serializes as 0, causing continuous GC loop.

Summary by CodeRabbit

  • Bug Fixes
  • Configured the controller manager to perform garbage collection at regular 10-second intervals.
  • Updated configuration validation to ensure the garbage-collection interval is included correctly.

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.

@sayak-redhat sayak-redhat changed the title SPIRE-617: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage SPIRE-617: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage, OCPBUGS-90556 Jul 20, 2026
@sayak-redhat sayak-redhat changed the title SPIRE-617: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage, OCPBUGS-90556 SPIRE-617, OCPBUGS-90556: fix gcInterval to 10s to prevent spire-controller-manager High CPU usage Jul 20, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 20, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 20, 2026

Copy link
Copy Markdown

@sayak-redhat: This pull request references SPIRE-617 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 task to target the "5.0.0" version, but no target version was set.

This pull request references Jira Issue OCPBUGS-90556, 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:

Unset gcInterval serializes as 0, causing continuous GC loop.

Summary by CodeRabbit

  • Bug Fixes
  • Configured the controller manager to perform garbage collection at regular 10-second intervals.
  • Updated configuration validation to ensure the garbage-collection interval is included correctly.

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

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

@sayak-redhat: all tests passed!

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/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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