Repository navigation
Description
Problem
The Deployment roadmap-service (k8s/devops/roadmap-service/deployment.yaml, resources) requests 256Mi of memory and limits it to 1Gi. The kernel killed the container with OOMKilled two times on 2026-11-08: at 03:06:50Z after 2 h 39 min, and at 10:01:52Z after 3 h 40 min. The metric container_memory_working_set_bytes (container service, namespace devops) grows about 100 to 150 MiB each hour, from 370-460 MiB to more than 860 MiB.
The fix of #4116 (PR #4140: bounded session answers, capped export queue, alert RoadmapServiceMemoryNearLimit) is merged. It is not enough to trust yet:
- Its own measure showed that the answer store stops near 80 MB. That does not explain the whole growth from 370 to 860 MiB.
- The image that carries it is not rolled out yet.
- Each OOM kill restarts the Service. A restart loses the memory state, and a restart is now the first sign of the leak. The alert
RoadmapServiceMemoryNearLimit(85 percent of the limit) has no time to warn, because the pod is killed in about 3 hours.
The owner said on 2026-11-08: "Raise the limits a reasonable amount for the task at hand."
Expected
- The memory request is the normal working set:
768Mi. - The memory limit is
3Gi. At 120 MiB each hour from 460 MiB, the pod reaches 3Gi after about 21 hours. So the pod runs for a day, andRoadmapServiceMemoryNearLimit(85 percent of the limit, about 2.5Gi) fires before any kill. - The CPU request (100m) and the CPU limit (1) stay.
- The raise is a stopgap with a reason. It is not the fix. fix(service): roadmap-service is OOMKilled after hours #4116 and its 6-hour flat check test(service): Verify Service working set stays flat for six hours #4125 stay open. The comment above
resourcesin the Deployment says this and links fix(service): roadmap-service is OOMKilled after hours #4116.
Facts checked for this item:
- Node room: the smallest node has 32 GB of memory and at most 44 percent is used. A request of 768Mi and a limit of 3Gi fit.
- Alert rule:
RoadmapServiceMemoryNearLimitink8s/monitoring/prometheus-values.yamldivides the working set bykube_pod_container_resource_limits{resource="memory"}. It holds no literal limit, so the rule needs no change. The test fixturetests/fixtures/prometheus_rules/roadmap_service_tests.yamlsets its own limit series, so it needs no change. - Admission policy:
k8s/devops/roadmap-service/admissionpolicy.yamlapplies tojobsmade by the usersystem:serviceaccount:devops:roadmap-service. It pins the size table of those Jobs only. It does not name the Service Deployment, so it needs no change. - Leave
k8s/devops/cronjob-runner.yaml(4Gi request, 8Gi limit) andk8s/devops/cronjob.yaml(256Mi request, 1Gi limit, no OOM seen). - Rule of rollout: this change sets the Deployment only. No ConfigMap key changes, so no ConfigMap must be applied before the rollout. Argo CD applies it from
main. This issue does not change the cluster by hand.
Documents to check with git grep -n -E '1Gi|256Mi':
k8s/README.md, Roadmap service: line 739 (alert row, "A rise of the limit only delays the kill") stays true. Add the new request and limit with the reason, and a pointer to fix(service): roadmap-service is OOMKilled after hours #4116, in the Roadmap service section where the Deployment is described. Lines 680-686 name the Jobs (4Gi/8Gi, size table) and stay.openspec/specs/roadmap-service-alerts/spec.mdline 343: the requirement reads the limit from the metric. No change.openspec/specs/gitea-forge/spec.mdline 69 (256Mi, 1Gi): Gitea, not the Service. No change.tests/server/routes/test_k8s_roadmap_service.pyline 127 (1Gi): the storage of the PVC, not the memory. No change.k8s/devops/roadmap-service/pvc.yaml: storage, not memory. No change.
Acceptance criteria
- The memory limit of the Service container is 3Gi. This command fails today (it prints
1Gi):
uv run python -c "import yaml,sys; c=yaml.safe_load(open('k8s/devops/roadmap-service/deployment.yaml'))['spec']['template']['spec']['containers'][0]['resources']; sys.exit(0 if c['limits']['memory']=='3Gi' else print(c['limits']['memory']) or 1)" - The memory request of the Service container is 768Mi, and the CPU values stay 100m and 1. This command fails today (the request is 256Mi):
uv run python -c "import yaml,sys; c=yaml.safe_load(open('k8s/devops/roadmap-service/deployment.yaml'))['spec']['template']['spec']['containers'][0]['resources']; sys.exit(0 if (c['requests']['memory'],c['requests']['cpu'],c['limits']['cpu'])==('768Mi','100m','1') else 1)" - A new test
test_deployment_memory_is_sized_for_the_observed_growthintests/server/routes/test_k8s_roadmap_service.pyreads the Deployment and holds the request, the limit and the CPU values above. It fails today because the limit is 1Gi:
uv run pytest tests/server/routes/test_k8s_roadmap_service.py -k observed_growth - The test also holds that the limit is at least 10 hours of growth at 150 MiB each hour above 460 MiB (one number in the test, with its source named in a comment), so a later cut of the limit fails the test and names fix(service): roadmap-service is OOMKilled after hours #4116.
- The Alertmanager rule reads the limit from the metric. This command still passes after the change, and the rule holds no literal limit:
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k RoadmapServiceMemoryNearLimit -
k8s/README.mdnames the request, the limit and the reason in the Roadmap service section, and says that fix(service): roadmap-service is OOMKilled after hours #4116 holds the fix:
grep -n '3Gi' k8s/README.md | grep -i 'roadmap service'(fails today) -
uv run devops ci --check --only k8s,docs,openspecpasses. - The Deployment manifests no other change.
git diff --stat origin/mainshowsdeployment.yaml,k8s/README.mdand the test file only (plus the OpenSpec change folder).
Existing tool considered
- The Vertical Pod Autoscaler (upstream Kubernetes autoscaler) can set requests from observed use. It does not stop a leak, it needs a new controller in the cluster, and the homelab keeps the request in git (Argo CD with prune and self-heal). It is not used for one Deployment.
- Kubernetes
LimitRangeandResourceQuotaset a default, not the size of one Deployment. Not used. - The alert
RoadmapServiceMemoryNearLimit(kubelet and kube-state-metrics series) is the tool that shows the leak. It stays. - A heap measure of the live pod (for example
memray, ortracemallocfrom the standard library) finds the cause. It is the work of fix(service): roadmap-service is OOMKilled after hours #4116, not of this issue.
Cost
- Build: one edit of 2 values and a comment in
deployment.yaml, one test of about 15 lines, and 2 sentences ink8s/README.md. About 25,000 tokens and 20 minutes including the CI run. - Keep: no new code path. One number to revisit when fix(service): roadmap-service is OOMKilled after hours #4116 is fixed (lower the limit again, or keep it if the working set is flat).
- Fix cost if it goes wrong: a Deployment edit and a rollout. The raise uses up to 2.25Gi more memory on one node, which has room.
- Cost of no change: the Service restarts about every 3 hours, the restart loses its memory state, and the alert has no time to warn.
Related
- fix(service): roadmap-service is OOMKilled after hours #4116 (leak in the Service memory, the fix; stays open)
- test(service): Verify Service working set stays flat for six hours #4125 (6-hour flat check of the working set; stays open)
- fix(service): bound Service session answers and export queue #4140 (merged: bounded session answers, capped export queue, alert
RoadmapServiceMemoryNearLimit) - fix(roadmap): read the pod status to find an out-of-memory kill #3727 (read the pod status to find an out-of-memory kill; this is for runner Jobs)
Proposed design
Problem statement
The kernel killed the container of Deployment roadmap-service with OOMKilled two times on 2026-11-08. The working set grows about 100 to 150 MiB each hour, and it passed 860 MiB. The fix #4116 is merged but not rolled out, and a restart is now the first sign of the leak. This change raises the memory request to 768Mi and the memory limit to 3Gi as a stopgap, so the pod runs about a day and the alert RoadmapServiceMemoryNearLimit warns before a kill.
Acceptance criteria
Requirement: Memory limit is 3Gi
The memory limit of container service of Deployment roadmap-service SHALL be 3Gi.
Scenario: The limit of the Deployment
- WHEN A test reads
spec.template.spec.containers[0].resources.limits.memoryofk8s/devops/roadmap-service/deployment.yaml. - THEN The value is
3Gi.
Requirement: Memory request and CPU values
The memory request SHALL be 768Mi, and the CPU request and the CPU limit SHALL stay 100m and 1.
Scenario: The request and the CPU values
- WHEN A test reads the requests and the limits of that container.
- THEN The tuple of memory request, CPU request and CPU limit is
('768Mi', '100m', '1').
Requirement: A test holds the sizes
The test test_deployment_memory_is_sized_for_the_observed_growth in tests/server/routes/test_k8s_roadmap_service.py SHALL hold the memory request, the memory limit and the CPU values.
Scenario: The new test on the base commit
- WHEN
uv run pytest tests/server/routes/test_k8s_roadmap_service.py -k observed_growthruns on the base commit. - THEN The test fails there, because the limit is
1Gi, and it passes with the new sizes.
Requirement: The limit holds 10 hours of growth
The test SHALL hold that the limit is at least 10 hours of growth at 150 MiB each hour above 460 MiB, as one number with its source in a comment that names #4116.
Scenario: A later cut of the limit
- WHEN A later change sets the limit below that bound.
- THEN The test fails and its message names fix(service): roadmap-service is OOMKilled after hours #4116.
Requirement: The comment names the stopgap and #4116
A comment above resources in the Deployment SHALL say that the raise is a stopgap with a reason and SHALL link #4116.
Scenario: The comment above resources
- WHEN A test reads the lines above
resourcesink8s/devops/roadmap-service/deployment.yaml. - THEN The comment holds the word
stopgapand the text#4116.
Requirement: The memory alert reads the limit from the metric
The rule RoadmapServiceMemoryNearLimit SHALL keep reading the memory limit from kube_pod_container_resource_limits and SHALL hold no literal limit.
Scenario: The alert rule test
- WHEN
uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py -k RoadmapServiceMemoryNearLimitruns. - THEN The test passes, and the rule of
k8s/monitoring/prometheus-values.yamlholds no literal memory limit.
Requirement: The README names the sizes and the reason
The Roadmap service section of k8s/README.md SHALL name the 768Mi request, the 3Gi limit, the reason for the raise and that #4116 holds the fix.
Scenario: The Roadmap service section
- WHEN A test reads the Roadmap service section of
k8s/README.md. - THEN The section names
768Mi,3Gi,#4116and the reason for the raise.
Requirement: The change touches only the named files
The change SHALL touch only k8s/devops/roadmap-service/deployment.yaml, k8s/README.md, tests/server/routes/test_k8s_roadmap_service.py and the OpenSpec change folder.
Scenario: The diff against the default branch
- WHEN
git diff --stat origin/mainruns on the branch of the change. - THEN It lists those files only.
Requirement: The scoped checks pass
The command uv run devops ci --check --only k8s,docs,openspec MUST pass.
Scenario: The scoped checks
- WHEN
uv run devops ci --check --only k8s,docs,openspecruns on the branch of the change. - THEN It exits 0.
Existing Tool Considered
No alternatives check has run. The Vertical Pod Autoscaler is the open, maintained tool that partly covers the need. It sets requests from observed use, but it does not stop a leak, it needs a new controller in the cluster, and the homelab keeps the request in git under Argo CD with prune and self-heal. Kubernetes LimitRange and ResourceQuota set a namespace default, not the size of one Deployment. The written cost of the hand edit is about 25,000 tokens and 20 minutes, with the CI run included, and one number to revisit when #4116 is fixed.
Key questions
- Which memory limit lets the pod run about a day and lets the alert fire before a kill?:
3Gi. At 150 MiB each hour from 460 MiB the working set reaches 3Gi after about 21 hours, and the rule fires at 85 percent of the limit, about 2.5Gi, well before that. (best practice) [sources: k8s/monitoring/prometheus-values.yaml, k8s/devops/roadmap-service/deployment.yaml]- Chosen:
3Gilimit with a768Mirequest. It holds about 21 hours at the worst observed rate, and 85 percent of it is a point the alert can warn at. - Rejected:
2Gilimit. At 150 MiB each hour it is reached in about 10 hours, which is short of the day the body expects. - Rejected:
4Gilimit or more. It spends node memory for no gain, and the growth stays a leak that fix(service): roadmap-service is OOMKilled after hours #4116 must fix.
- Chosen:
- Does the admission policy or a LimitRange need a change for the new sizes?: No. ValidatingAdmissionPolicy
roadmap-service-jobspins the size table of the runner Jobs that the Service makes, and it does not name the Service Deployment. No LimitRange of namespacedevopsapplies. [sources: k8s/devops/roadmap-service/admissionpolicy.yaml] - Does the alert rule or its promtool fixture need a change?: No. The rule divides the working set by
kube_pod_container_resource_limits{resource="memory"}, so it reads the new limit. The fixture sets its own limit series. [sources: k8s/monitoring/prometheus-values.yaml, tests/fixtures/prometheus_rules/roadmap_service_tests.yaml] - Where does
k8s/README.mdrecord the new sizes?: In the Roadmap service section, at the row ofRoadmapServiceMemoryNearLimitand the sentence that a rise of the limit only delays the kill. [sources: k8s/README.md:739] - Does the change need a ConfigMap key or a hand change to the cluster?: No. The change sets the Deployment only, and Argo CD applies it from
main. Argo CD self-heals the Deployment, so no person changes the cluster by hand. [sources: k8s/devops/roadmap-service/deployment.yaml, k8s/README.md] - Do the sizes of the CronJobs change?: No. CronJob
devops-cli-runnerkeeps its 4Gi request and 8Gi limit, and CronJobdevops-clikeeps its 256Mi request and 1Gi limit. [sources: k8s/devops/cronjob-runner.yaml, k8s/devops/cronjob.yaml]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 8, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.The service is OOMKilled every three hours and the owner requested the raise on 2026-11-08.Prevents repeated OOMKilled restarts of a running service until the leak fix is validated.Changes two values in one YAML file and adds a comment and a README line.Both address roadmap-service OOMKilled events; #4116 fixes the memory leak, this item raises the memory limit to buy time until the fix is validated.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at aa772d6 (see proposed design in issue body).
devops-cli-service commentedon Nov 8, 2026
Released in v0.89.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.89.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 13:44 UTC