Skip to content

KONFLUX-14972: kubearchive-api-server OOMs on stone-prd-rh01#13104

Open
olegbet wants to merge 1 commit into
redhat-appstudio:mainfrom
olegbet:KONFLUX-14972_api-server_OOM_stone-prd-rh01
Open

KONFLUX-14972: kubearchive-api-server OOMs on stone-prd-rh01#13104
olegbet wants to merge 1 commit into
redhat-appstudio:mainfrom
olegbet:KONFLUX-14972_api-server_OOM_stone-prd-rh01

Conversation

@olegbet

@olegbet olegbet commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Risk assessment

  • Low. No actual disruption to be expected by this change.

Validation

Staging validated with the configuration: #13102
Development validated with: #13105

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olegbet

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

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Kustomize Render Diff

Comparing 54f4bb3ee754077697

Component Environment Changes
components/kubearchive/production/stone-prd-rh01 production +3 -5

Total: 1 components, +3 -5 lines

📋 Full diff available in the workflow summary and as a downloadable artifact.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.11%. Comparing base (0d2cb70) to head (d07ab6b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #13104   +/-   ##
=======================================
  Coverage   57.11%   57.11%           
=======================================
  Files          23       23           
  Lines        1455     1455           
=======================================
  Hits          831      831           
  Misses        548      548           
  Partials       76       76           
Flag Coverage Δ
go 57.11% <ø> (ø)

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.

Signed-off-by: obetsun <obetsun@redhat.com>
@olegbet
olegbet force-pushed the KONFLUX-14972_api-server_OOM_stone-prd-rh01 branch from b0a2258 to d07ab6b Compare July 20, 2026 07:25
@qodo-for-redhat-appstudio

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Compliance rules (platform): 3 rules

Grey Divider


Action required

1. Invalid GOMEMLIMIT unit 🐞 Bug ≡ Correctness
Description
kubearchive-api-server now sets GOMEMLIMIT to "440Mi", which is inconsistent with the repo’s
existing GiB-formatted GOMEMLIMIT values and is likely to be ignored by the Go runtime. If
ignored, the heap cap won’t be applied and the API server can continue to OOM despite the resource
increases.
Code

components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[R1114-1116]

            - name: GOMEMLIMIT
-              valueFrom:
-                resourceFieldRef:
-                  resource: limits.memory
+              value: "440Mi"
            - name: GOMAXPROCS
Relevance

⭐⭐⭐ High

Repo uses Go-style units (10GiB/3277MiB); not Kubernetes "Mi" for GOMEMLIMIT.

PR-#10768
PR-#10080
PR-#11367

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes GOMEMLIMIT to "440Mi" for the api-server. Other parts of this repo that hard-code
GOMEMLIMIT use GiB-suffixed strings, and a past accepted review explicitly used MiB,
indicating that Mi is not the established/expected format here.

components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1110-1116]
components/mintmaker/production/base/manager-set-resources-patch.yaml[18-20]
components/kubearchive/production/stone-prd-rh01/kustomization.yaml[258-264]
PR-#11367

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`GOMEMLIMIT` is set to a Kubernetes quantity (`"440Mi"`) in the api-server Deployment. This format is inconsistent with how `GOMEMLIMIT` is expressed elsewhere in this repo (e.g., `"7GiB"`, `10GiB`) and may not be parsed/used by the Go runtime, meaning the intended heap cap would not be applied.

### Issue Context
This PR is intended to mitigate OOMs by increasing memory and setting `GOMEMLIMIT`. If `GOMEMLIMIT` is ignored due to unit formatting, the change won’t achieve its purpose.

### Fix Focus Areas
- components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1114-1116]

### What to change
- Update `GOMEMLIMIT` to a Go-runtime-compatible value format (e.g., `"440MiB"` or a bytes integer), and ensure it remains below the container memory limit to leave headroom for non-heap memory.
- (Optional for consistency) align any other hard-coded `Mi` `GOMEMLIMIT` values introduced in this file to the same unit convention used elsewhere in the repo (e.g., `GiB`/`MiB`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. GOMEMLIMIT decoupled resources 🐞 Bug ⚙ Maintainability
Description
Switching kubearchive-api-server GOMEMLIMIT from resourceFieldRef to a hard-coded value makes
it easy for future memory request/limit adjustments to drift out of sync with the Go heap cap. This
increases ongoing operational risk because other kubearchive environments/templates still derive
GOMEMLIMIT from container resources.
Code

components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[R1114-1116]

            - name: GOMEMLIMIT
-              valueFrom:
-                resourceFieldRef:
-                  resource: limits.memory
+              value: "440Mi"
            - name: GOMAXPROCS
Relevance

⭐⭐ Medium

Kubearchive accepted hard-coded GOMEMLIMIT before, but other areas prefer resourceFieldRef to avoid
drift.

PR-#10080
PR-#10768
PR-#11367

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
stone-prd-rh01’s api-server now hard-codes GOMEMLIMIT, while the sink in the same manifest and
other kubearchive envs/templates still derive it from resourceFieldRef, demonstrating an
inconsistency that can lead to drift during future tuning.

components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1114-1116]
components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1328-1332]
components/kubearchive/production/stone-prod-p01/kubearchive.yaml[1114-1117]
hack/new-cluster/templates/kubearchive/kubearchive.yaml[1106-1109]
components/monitoring/grafana/production/base/grafana-resources-patch.yaml[13-17]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`kubearchive-api-server` changes `GOMEMLIMIT` from a resource-derived value (`resourceFieldRef`) to a hard-coded string. This creates a configuration drift hazard: future changes to memory requests/limits may not be accompanied by updates to `GOMEMLIMIT`.

### Issue Context
Most kubearchive manifests and templates still use `valueFrom.resourceFieldRef` for `GOMEMLIMIT`, and other components in this repo sometimes derive `GOMEMLIMIT` from `requests.memory`.

### Fix Focus Areas
- components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1114-1116]

### What to change
Choose one:
1) Restore a resource-derived `GOMEMLIMIT` (e.g., `valueFrom.resourceFieldRef.resource: requests.memory`) and set `requests.memory` to the desired heap cap value, keeping `limits.memory` higher for headroom.
2) If hard-coding is required to maintain headroom below the limit, add an explicit comment near `GOMEMLIMIT` documenting the intended relationship to `limits.memory` (e.g., `GOMEMLIMIT = limits.memory - safety_margin`) and ensure any future resource changes update both together.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines 1114 to 1116
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
value: "440Mi"
- name: GOMAXPROCS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Invalid gomemlimit unit 🐞 Bug ≡ Correctness

kubearchive-api-server now sets GOMEMLIMIT to "440Mi", which is inconsistent with the repo’s
existing GiB-formatted GOMEMLIMIT values and is likely to be ignored by the Go runtime. If
ignored, the heap cap won’t be applied and the API server can continue to OOM despite the resource
increases.
Agent Prompt
### Issue description
`GOMEMLIMIT` is set to a Kubernetes quantity (`"440Mi"`) in the api-server Deployment. This format is inconsistent with how `GOMEMLIMIT` is expressed elsewhere in this repo (e.g., `"7GiB"`, `10GiB`) and may not be parsed/used by the Go runtime, meaning the intended heap cap would not be applied.

### Issue Context
This PR is intended to mitigate OOMs by increasing memory and setting `GOMEMLIMIT`. If `GOMEMLIMIT` is ignored due to unit formatting, the change won’t achieve its purpose.

### Fix Focus Areas
- components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1114-1116]

### What to change
- Update `GOMEMLIMIT` to a Go-runtime-compatible value format (e.g., `"440MiB"` or a bytes integer), and ensure it remains below the container memory limit to leave headroom for non-heap memory.
- (Optional for consistency) align any other hard-coded `Mi` `GOMEMLIMIT` values introduced in this file to the same unit convention used elsewhere in the repo (e.g., `GiB`/`MiB`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 1114 to 1116
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
value: "440Mi"
- name: GOMAXPROCS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Gomemlimit decoupled resources 🐞 Bug ⚙ Maintainability

Switching kubearchive-api-server GOMEMLIMIT from resourceFieldRef to a hard-coded value makes
it easy for future memory request/limit adjustments to drift out of sync with the Go heap cap. This
increases ongoing operational risk because other kubearchive environments/templates still derive
GOMEMLIMIT from container resources.
Agent Prompt
### Issue description
`kubearchive-api-server` changes `GOMEMLIMIT` from a resource-derived value (`resourceFieldRef`) to a hard-coded string. This creates a configuration drift hazard: future changes to memory requests/limits may not be accompanied by updates to `GOMEMLIMIT`.

### Issue Context
Most kubearchive manifests and templates still use `valueFrom.resourceFieldRef` for `GOMEMLIMIT`, and other components in this repo sometimes derive `GOMEMLIMIT` from `requests.memory`.

### Fix Focus Areas
- components/kubearchive/production/stone-prd-rh01/kubearchive.yaml[1114-1116]

### What to change
Choose one:
1) Restore a resource-derived `GOMEMLIMIT` (e.g., `valueFrom.resourceFieldRef.resource: requests.memory`) and set `requests.memory` to the desired heap cap value, keeping `limits.memory` higher for headroom.
2) If hard-coding is required to maintain headroom below the limit, add an explicit comment near `GOMEMLIMIT` documenting the intended relationship to `limits.memory` (e.g., `GOMEMLIMIT = limits.memory - safety_margin`) and ensure any future resource changes update both together.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant