Repository navigation
Description
Problem or Motivation
Each limit in the cluster is fixed today after a kill (#4116, #4149, #2806, #1815, #2391, #4939). 24 containers have no memory limit, ollama-48gib included. Some requests are far above use: argocd-repo-server uses about 178 MiB of its 4Gi limit, and the llm Valkey uses about 17 MiB of 2Gi. The scheduler sees these requests as used room. This item is rank 3 of the cluster integration plan #4989.
Proposed Solution & Architectural Design
Phase 1 (S), this issue:
- Run KRR (
robusta-dev/krr, MIT, v1.31.3 or later) from a workstation against the Prometheus ingress and the kubeconfig, with the cluster label set and JSON output. KRR writes nothing to the cluster and needs no pod. - Leave out the runner and stage Jobs. feat(roadmap): size the runner Job resources from the plan #3193 sizes them from the plan.
- Policy:
- Memory limit at least 1.5 times the 7 d peak. KRR
simplegives the peak plus 15 %, which is thin for a slow leak. - CPU request from KRR.
- Keep a CPU limit on every container. KRR recommends none, but the project sets one.
- Memory limit at least 1.5 times the 7 d peak. KRR
- Give the 24 containers with no memory limit a limit, ollama-48gib included.
- Lower the requests that are far above use (argocd-repo-server, valkey), so the scheduler sees the free room. Read the Valkey rows together with
maxmemoryandValkeyMemoryNearBound. - Put the KRR table in a comment on this issue, and set the values in git in one pull request.
Phase 2 (M) is a later issue, after #4566: a CronWorkflow in argo-workflows with a read-only ClusterRole and a NetworkPolicy path to prometheus-server. The JSON report is the Workflow output. A pull-request step can follow.
Evidence
KRR reads only data that Prometheus already holds: cAdvisor CPU and memory, kube_pod_owner, kube_replicaset_owner, kube_job_owner, and the requests and limits. git grep finds no right-sizing tool or VPA in k8s/. Phase 1 needs no pod, so it does not wait for #4566.
Target Subsystem
Kubernetes & Minikube Automation.
Existing Tool Considered
KRR (MIT). The Vertical Pod Autoscaler recommender gives the same sizing, but needs a pod, 3 CRDs and about 40 objects in git, and keeps 8 d of history by default. It was rejected.
Acceptance Criteria
- A comment on this issue holds the KRR table and the policy values.
- One pull request sets the values. Each container, except the runner and stage Jobs, has a memory limit and a CPU limit.
- No memory limit is below 1.5 times its 7 d peak.
Dependencies
#4991: run KRR after it merges, so that the report covers the other containers.
Source: #4989
Alternatives check of 2026-11-21: covers.
Tool: robusta-dev/krr (https://github.com/robusta-dev/krr), MIT, last activity 2026-11-11, maintained.
Reason: The issue already names KRR as its considered tool, and the facts confirm an open CLI that reads Prometheus history and recommends CPU and memory for every container with no cluster write, which is the whole Phase 1 need.
Covers:
- Reads cAdvisor and kube-state history from Prometheus only
- Sizes memory and CPU request per container
- Memory buffer flag yields 1.5 times the 7 d peak
- JSON report feeds the issue table and change folder
Lacks:
- No CPU limit recommendation; it advises no limits
- Writes nothing to git; a person sets the values
- No scheduled in-cluster run for Phase 2
- Valkey maxmemory ratio and its alert stay outside the report
Proposed design
Problem statement
Each limit in the cluster is fixed after a kill. 24 containers have no memory limit, ollama-48gib included. Some requests sit far above use, so the scheduler counts room that no container uses. The sizing needs a KRR report from the cluster Prometheus and a change to the environment tree, which this repository refuses. This change adds the offline check that keeps each Valkey --maxmemory at most three quarters of its container memory limit. The sizing is deferred to a new issue.
Acceptance criteria
Requirement: A Valkey bound above three quarters of its limit
The k8s row of devops ci SHALL report each container that runs valkey-server with a --maxmemory value above three quarters of its memory limit.
Scenario: A bound above three quarters of the limit
- WHEN The test passes the check a rendered Deployment object whose
valkeycontainer sets--maxmemory 512mband a memory limit of512Mi. - THEN The check returns one finding that names the container
valkey, its bound and its memory limit.
Requirement: A Valkey bound at exactly three quarters
The check SHALL report no finding for a bound at exactly three quarters of the memory limit.
Scenario: A bound at exactly three quarters
- WHEN The test passes the check a rendered Deployment object whose
valkeycontainer sets--maxmemory 768mband a memory limit of1Gi. - THEN The check returns no finding.
Requirement: A Valkey with no bound is no ratio finding
The check SHALL ignore each container that runs valkey-server with no --maxmemory value.
Scenario: A Valkey with no bound
- WHEN The test passes the check a rendered Deployment object whose
valkeycontainer sets no--maxmemory. - THEN The check returns no finding.
Requirement: Each Valkey bound of the tree stays under three quarters of its limit
Each container of the environment tree that runs valkey-server with --maxmemory SHALL keep that bound at most three quarters of its memory limit.
Scenario: The Valkeys of the environment tree
- WHEN The check runs
uv run devops ci --check --only k8s. - THEN The row reports no finding of a Valkey bound above three quarters of its memory limit.
Existing Tool Considered
KRR (robusta-dev/krr, MIT, https://github.com/robusta-dev/krr), verdict covers, as the alternatives check in the issue body records; the Covers: and Lacks: lists of its block say what the tool covers and lacks. The Lacks: list says that the Valkey --maxmemory ratio stays outside the report, so this change adds the offline check of that ratio in the k8s row. The sizing itself is deferred, because no krr binary is present and this repository refuses a change to an environment path.
Key questions
- The alternatives check found that
https://github.com/robusta-dev/krrcovers this item. Adopt the tool, or keep the item and give the reason.: Adopt KRR. A reply to the check says to set the memory limit of an Ollama tier when the KRR report sizes it and to remove its annotation, so the item relies on the report. KRR is open, MIT and maintained, and it reads Prometheus history with no cluster write. (best practice) [sources: docs/guidelines/kubernetes.md:4, k8s/llm/profiles/ollama-profiles.yaml:221]- Chosen: Adopt KRR. The verdict is
covers, the tool is MIT and maintained, and a reply to the check relies on its report. - Rejected: Keep the item and write a script of the project. The block lists no gap that a script closes, and the guideline puts an open tool before a script of the project.
- Chosen: Adopt KRR. The verdict is
- Which part of the item can this repository build?: The offline check of the Valkey
--maxmemoryratio in thek8srow. Each manifest of the sizing is an environment path, anduv run devops ci --check --only k8srefuses a change to an environment path. (best practice) [sources: tests/gate/k8s_checks/environment_freeze.py, openspec/specs/llm-valkey/spec.md:9, k8s/llm/valkey-devops.yaml]- Chosen: Add the ratio check to the
k8srow. The check lives intests/gate/k8s_checks/, outside the environment tree, and it holds the three-quarters rule that no check holds today. - Rejected: Edit the target manifests here. The freeze check marks each target manifest as an environment path, and the
k8srow refuses the change. - Rejected: Add the Prometheus rule here.
k8s/monitoring/prometheus-values.yamlis an environment path too, and the rule needs a live cluster to prove.
- Chosen: Add the ratio check to the
- Where does the check read the bound and the memory limit?: From the rendered manifests of the
k8srow. The row renders each application of the environment tree once, and the rendered container holds its command and its memory limit. (best practice) [sources: tests/gate/k8s_checks/environment_freeze.py, k8s/llm/valkey-devops.yaml]- Chosen: The rendered manifests of the
k8srow. The row already builds each path source, and the build holds the command and the limit. - Rejected: A pytest test that reads the manifest files. A test asserts no value of a manifest, so the row is the proof.
- Chosen: The rendered manifests of the
- How does the check compare a bound in
mbwith a limit inMi?: It reads themb,gbandkbsuffix of--maxmemoryas 1024-based bytes, and theMi,GiandKisuffix of the limit as 1024-based bytes. The project already reads--maxmemory 256mbagainstmemory: 384Mias two thirds. (best practice) [sources: k8s/llm/valkey-devops.yaml, k8s/README.md:283, openspec/specs/llm-valkey/spec.md:9]- Chosen: 1024-based bytes for both suffixes.
k8s/README.md:283reads 1536 MiB as three quarters of 2048Mi, so the project treatsmbasMi. - Rejected: Decimal bytes for the Valkey suffix. The project's own reading of the cache Valkey uses 1024-based bytes.
- Chosen: 1024-based bytes for both suffixes.
- What does the check do with a valkey container that sets no
--maxmemory?: It reports no finding. The check covers only a bound that the container sets, and the item sets no rule for a Valkey with no bound. (best practice) [sources: k8s/README.md:283, k8s/llm/valkey-runs.yaml]- Chosen: Report no finding. The item sets no rule for a Valkey with no bound, and the run index has no exporter.
- Rejected: Report a missing bound as a finding. The row would fail on a manifest that the item does not size, and it adds a rule that the project did not decide.
- Why is the sizing deferred to a new issue?: The target manifests are environment paths, and
uv run devops ci --check --only k8srefuses a change to an environment path. A person must run KRR v1.31.3 from a workstation with the cluster kubeconfig and the Prometheus ingress, anddan-petty/homelab#109tracks the Ollama tier limits in the homelab repo. [sources: tests/gate/k8s_checks/environment_freeze.py, k8s/llm/profiles/ollama-profiles.yaml:221] - What does the change do with the six Ollama tier annotations?: The deferred issue removes each
ignore-check.kube-linter.io/unset-memory-requirementsannotation when the KRR report sizes the tier. kube-linter then guards the limit with no ignore marker. (best practice) [sources: k8s/llm/profiles/ollama-profiles.yaml:221, .kube-linter.yaml:14]- Chosen: Remove the annotation with the limit. The annotation hides the check, and the reply to the alternatives check asks for its removal.
- Rejected: Keep the annotation. The limit then has no guard.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Moved to new items
dan-petty/homelab#375
Activity
dan-petty commentedon Nov 12, 2026
Both address workload resource limits, but dan-petty/devops-cli#135 is a reactive fix for specific OOM kills while this candidate adds a proactive KRR-based sizing tool for all containers.devops-cli-service commentedon Nov 15, 2026
Alternatives check: covers
Reason: Searches and the repository facts point to KRR (robusta-dev/krr, MIT, maintained, v1.31.3), a read-only recommender that derives container CPU/memory requests and limits from Prometheus usage history and owner metrics, which is exactly the Phase 1 sizing this issue plans. It does not recommend CPU limits, and applying the values in git and the later CronWorkflow stay with the project.
Tool: robusta-dev/krr (https://github.com/robusta-dev/krr)
Covers:
Lacks:
simplememory recommendation (peak plus about 15 %) is below the issue's 1.5x-peak limit policy, so the buffer has to be raised or a custom strategy usedmaxmemoryandValkeyMemoryNearBound; that reading is manualTools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Owner question: Should the item adopt KRR (robusta-dev/krr), which the alternatives check of 2026-11-15 finds covers the item, or keep the item and give the reason? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 17, 2026
Pull request #6112 (for #6068) runs kube-linter
unset-memory-requirementsin CI. The Ollama tiersollama-24gib,ollama-32gib,ollama-48gib,ollama-72gib,ollama-96gibandollama-128gibset no memory limit on the containerollama. Each holds the annotationignore-check.kube-linter.io/unset-memory-requirementswith this item as the reason. When the KRR report sizes a tier, set its limit and remove its annotation.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at c58b592 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 17, 2026
Owner question: A person must run KRR v1.31.3 from a workstation with the cluster kubeconfig and the Prometheus ingress and commit the JSON report, because the runner pod mounts no Kubernetes token.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
5 remaining items
devops-cli-service commentedon Nov 22, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 25, 2026
Returning #4992 to
New: this leaf item cannot be built indevops-clias specified.Evidence from
origin/mainand this workspace:v1.31.3) from a workstation with cluster kubeconfig and Prometheus ingress to writeopenspec/changes/<issue>-<slug>/krr-report.jsonand live PromQL checks against cluster Prometheus. In this environmentcommand -v krris absent, noopenspec/changes/*4992*report exists, and the design notes runner pods setautomountServiceAccountToken: false.k8s/llm/profiles/ollama-profiles.yaml,k8s/llm/valkey-devops.yaml,k8s/llm/valkey-runs.yaml,k8s/monitoring/prometheus-values.yaml, etc.) is outsidek8s/devops/andk8s/overlays/homelab/devops/, sotests/gate/k8s_checks/environment_freeze.py:38-75(is_environment_path("k8s/llm/profiles/ollama-profiles.yaml") == True) rejects edits there indevops ci --check --only k8s.dan-petty/homelab#109already tracks setting the Ollama tier memory limits indan-petty/homelab.devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC