Skip to content

COO-1063: fix: set default resource requests and limits on Alertmanager and Thanos sidecar#1094

Open
jan--f wants to merge 1 commit into
rhobs:mainfrom
jan--f:fix/coo-1063-default-resources
Open

COO-1063: fix: set default resource requests and limits on Alertmanager and Thanos sidecar#1094
jan--f wants to merge 1 commit into
rhobs:mainfrom
jan--f:fix/coo-1063-default-resources

Conversation

@jan--f
Copy link
Copy Markdown
Collaborator

@jan--f jan--f commented May 19, 2026

When a ResourceQuota is set on the namespace, Alertmanager and Prometheus pods fail to start because the Alertmanager container and Thanos sidecar container don't have resource requests/limits. Propagate the MonitoringStack's resource requirements to both components, matching what is already done for the Prometheus container.

…nos sidecar (COO-1063)

When a ResourceQuota is set on the namespace, Alertmanager and Prometheus
pods fail to start because the Alertmanager container and Thanos sidecar
container don't have resource requests/limits. Propagate the
MonitoringStack's resource requirements to both components, matching what
is already done for the Prometheus container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

openshift-ci-robot commented May 19, 2026

@jan--f: This pull request references COO-1063 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 bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

When a ResourceQuota is set on the namespace, Alertmanager and Prometheus pods fail to start because the Alertmanager container and Thanos sidecar container don't have resource requests/limits. Propagate the MonitoringStack's resource requirements to both components, matching what is already done for the Prometheus container.

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 requested review from marioferh and slashpai May 19, 2026 08:50
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jan--f

The full list of commands accepted by this bot can be found here.

The pull request process is described 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
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 57416592-9aad-4d87-bbba-d32e664f06c2

📥 Commits

Reviewing files that changed from the base of the PR and between d0bde27 and 3d173b4.

📒 Files selected for processing (3)
  • pkg/controllers/monitoring/monitoring-stack/alertmanager.go
  • pkg/controllers/monitoring/monitoring-stack/components.go
  • pkg/controllers/monitoring/monitoring-stack/components_test.go

📝 Walkthrough

Walkthrough

This PR adds resource propagation from MonitoringStack specifications to generated monitoring components. The newAlertmanager function now sets Spec.Resources from the stack configuration, and newPrometheus configures both Spec.Resources and the Thanos sidecar's Resources field from the same source. Two test cases verify that resources propagate correctly to Alertmanager and Prometheus/Thanos components.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: setting default resource requests and limits on Alertmanager and Thanos sidecar, matching the changeset content.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem (ResourceQuota issues) and the solution (propagating resource requirements to both components).
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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 and usage tips.

@simonpasquier
Copy link
Copy Markdown
Contributor

hmm wouldn't that be too inflexible/restrictive? In general Prometheus requires higher resources than Alertmanager and Thanos sidecar. Also it would double the requests for the Prometheus pods?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants