Skip to content

feat(k8s): track the cluster integration plan #4989

Open
10 of 20 issues completed
Open

Description

@dan-petty

Update 2026-11-26 (infra move): The cluster manifests of this plan are in dan-petty/homelab now.

Each environment child (limits, scrapes, alerts, policies, new services) is done there, and its issue moves there. Product parts stay here: k8s/devops/ and the code under src/. Read each cluster manifest path outside k8s/devops/ as a homelab path.


Problem or Motivation

On 2026-11-12 the owner asked for a check of the cluster for integrations, and said that the limits look unnecessarily low. A read-only study gives this plan. It used kubectl get, describe and top, 7 days of Prometheus data and the manifests in git. It changed nothing in the cluster.

The remark is correct for some containers and wrong for others:

Container Limit 7 d use Result
grafana 1024Mi peak 1014 MiB (99 %) too low
llm-gateway 2048Mi 1333 MiB (65 %), +170 MiB a day too low
alloy-logs / alloy-metrics 512Mi / 1024Mi 67 % / 72 % too low
coredns (k3s packaged) 170Mi 67 % watch
redis_exporter, node-exporter CPU 100m / 200m throttled in 57 to 73 % / 29 % of CFS periods too low
runner Job, small row 1 CPU throttled in 46 % of CFS periods too low
roadmap-service 1 CPU max 1.00 core at the limit
argocd-repo-server 4Gi about 178 MiB much too high
valkey (llm) 2Gi about 17 MiB much too high (check maxmemory)
24 containers no memory limit - no bound

SearXNG is already fixed (#4951, now 1 GiB). Each limit is fixed today after a kill (#4116, #4149, #2806, #1815, #2391, #4939). No alert tells which limit is too low before the kernel kills the container.

Goal

  1. Raise the measured near-limit values now, in one pull request.
  2. Give the runner CPU rows to feat(roadmap): the implement Job gates before its PR #4719.
  3. Size every other container from Prometheus history with KRR.
  4. Add generic OOM, crash-loop, waiting, throttle and near-limit alerts as the guard (AGENTS.md rule 11).
  5. Then add the integrations with the most value: CVE scans of the running images, an outside heartbeat for the alert path, a gateway embedding cache, and NetworkPolicies for the namespaces that have none.

Items 1, 5 and 6 (#4991, #4994, #4996) are configuration fixes that ship now and need no owner step.

Ranked plan

Rank Issue Item Kind Effort Value Depends on
1 #4991 limits-raise-measured config fix, ships now S high -
2 #4719 runner-cpu-rows scope comment S high -
3 #4992 krr-rightsizing integration S high #4991
4 dan-petty/homelab#344 workload-alerts config fix M high #4991
5 #4994 gateway-db-observability config fix, ships now S medium -
6 #4996 coredns-dead-config config fix, ships now S medium -
7 #4998 trivy-operator new service M high -
8 #4999 alert-path-heartbeat integration S medium owner step
9 dan-petty/homelab#345 gateway-embedding-cache integration M medium -
10 dan-petty/homelab#346 networkpolicy-gaps config fix M medium -
11 #5003 service-duplicate-server-spans bug S low -
12 #4566 cronworkflow-schedule-guard scope comment S low #4566
13 #4767 qdrant-snapshot-backup scope comment S low #4742
14 #4201 searxng-engine-metrics scope comment M low owner step
15 dan-petty/homelab#347 apiserver-scrape config fix S low -
16 dan-petty/homelab#348 argocd-notify-updater-metrics config fix S low -
17 #5007 portkey-removal config fix M low owner step after merge
18 dan-petty/homelab#349 traefik-otlp integration S low -
19 dan-petty/homelab#350 trace-metrics-exemplars config fix S low -
20 dan-petty/homelab#351 upstream-dashboards integration S low -
21 #5011 rule-series-lint integration M low -
22 #5012 llm-restricted-psa config fix L medium #3583
23 #5013 priority-classes config fix M low #4719, #3064

Merges: limits-raise-measured holds 5 candidates (Grafana memory, near-limit memory, exporter CPU, Valkey exporter limits, Service CPU). krr-rightsizing, workload-alerts and gateway-db-observability each hold 2.

Owner decisions, with the recommended answers

  1. Item 8, heartbeat (feat(monitoring): send a Watchdog alert to an outside heartbeat #4999). Choose hosted Healthchecks.io or a self-hosted Healthchecks outside the cluster. A check inside the cluster cannot tell that the cluster stopped. Recommended: the hosted free tier. The owner makes the account, the check and its notify channel, and puts the ping URL in the keyring. devops k8s push-secrets writes it into a Secret, and Alertmanager reads it with url_file. No secret goes into git. Agents write the rule, the route and the tests.
  2. Item 14, SearXNG metrics password (fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat #4201). open_metrics needs a password, and that is a new Secret. Recommended: approve the Secret. devops k8s push-secrets writes it from the keyring, and a start step renders it into settings.yml, so settings.yml stays in git with no secret.
  3. Item 6, CoreDNS option (a), optional (fix(k8s): delete the CoreDNS files that k3s never applies #4996). Option (a) runs CoreDNS from its Helm chart with 2 replicas and a larger limit. It is a host change (k3s --disable=coredns, or a .skip file for the packaged manifest). Recommended: not now. Option (b) needs no owner step. The 7 d peak is 67 % of the 170Mi limit, and the ContainerMemoryNearLimit rule of dan-petty/homelab#344 watches CoreDNS. Do option (a) only when that rule fires.
  4. Item 17, the workstation config step (chore(k8s): remove the unused Portkey gateway and provider #5007). After the merge, run devops config unset ai.portkey_url on each workstation config. The ai section refuses unknown keys, and agents never change config.yaml. Recommended: yes, run it after the merge. The load error names the command.

These decisions need no owner step when the recommended answer holds:

  • Item 9 (#5001): the cache Valkey runs with no password, behind a NetworkPolicy that admits only the gateway. It stores vectors and token counts under SHA-256 keys, and no prompt text. A password needs a new Secret, which is an owner step.
  • Item 18 (#5008): Traefik and the collector drop client addresses, headers and query strings. To keep client addresses needs owner approval under the telemetry privacy rules.
  • Dropped search-chain-dead-fallbacks: do not fund the Firecrawl key now (HTTP 402). The fallbacks get 0 requests.

Checklist

#4719, #4566 and #4767 keep their parents (#4667, #4517 and #4742). #4201 has no parent, so it is a sub-issue of this tracker.

Related open items

#4870 can take a model_call_slot wait histogram in its 24 h check (optional). #4709 can share the rule generation check of dan-petty/homelab#344. #4743 lints the dashboards of #4994 and dan-petty/homelab#351. #4406 (LiteLLM upgrade) must keep the per-item cache behaviour of dan-petty/homelab#345. #4569 owns the Valkey embedding key fix of the client cache.

Dropped candidates

Candidate Reason
gateway-search-tool (#4573) Since one 24 h window, SearXNG answered every search. The change makes the gateway a single point of failure for search and loses max_results. Raise it on #4573 only if 3 or more pod types need search.
search-chain-dead-fallbacks (#4141) The fallbacks get 0 requests now, so they cost nothing. #4141 owns the chain shape.
service-model-slot-measure (#4870) #4843 and #4870 own model_call_concurrency with a 24 h check and a revert rule. #4517 ends the role of the in-process semaphore.
ollama-gpu-requests Deliberate design: only tiers at or below per_gpu claim a GPU (k8s/README.md). A request adds a Pending failure mode while the device plugin restarts (6 times in 7 d). The missing ollama-48gib memory limit goes into #4992.
device-plugin-gitops (#4913) Already in git in the node-provisioning repository; #4913 onboards it to Renovate. The GFD NetworkPolicy gap goes to dan-petty/homelab#346.
oidc-login One person uses the consoles, and Cloudflare Access checks identity on every public host.
vpa-recommender The same sizing as KRR, but with a pod, 3 CRDs and about 40 objects in git.
longhorn-replicated-volumes Competes with SeaweedFS (#4742, #4750), the k8up backups (#4767, #2144, dan-petty/homelab#342, dan-petty/homelab#332) and ADR 0021. It needs owner host steps on 4 hosts and privileged Pod Security.

Target Subsystem

Kubernetes & Minikube Automation (k8s/, k8s/monitoring/, k8s/llm/).

Existing Tool Considered

Every item uses an open tool, and no item builds one: KRR (MIT), kubernetes-mixin (Apache-2.0), the CloudNativePG dashboards (Apache-2.0), Trivy Operator (Apache-2.0), Healthchecks (BSD-3-Clause), the LiteLLM proxy cache with Valkey, pint (Apache-2.0), the upstream Argo CD (Apache-2.0) and redis_exporter (MIT) dashboards, and the Tempo metrics-generator. The Vertical Pod Autoscaler recommender was rejected (see the dropped candidates).

Acceptance Criteria

  • Each child is merged, or closed with evidence.
  • 7 d after fix(k8s): raise the limits that 7 d of use shows are too low #4991 merges, a comment on its pull request records the same measures again: the 7 d peak against the limit, and the throttled share.
  • The rules of dan-petty/homelab#344 are live, and ContainerMemoryNearLimit names a limit that is too low before the kernel kills the container.

Dependencies

None for the tracker. The children carry their own.

Alternatives check of 2026-11-27: partly.
Tool: robusta-dev/krr (https://github.com/robusta-dev/krr), MIT, last activity 2026-11-11, maintained.
Reason: Search results and the KRR page show it reads existing Prometheus history and recommends CPU and memory requests and limits, covering only the rightsizing item of this 23-item cluster plan.

Covers:

  • Reads existing Prometheus history
  • Recommends CPU and memory requests and limits
  • Runs as a CLI without an in-cluster agent

Lacks:

  • OOM, crash-loop, throttle and near-limit alerts
  • Image CVE scanning and outside heartbeat
  • Embedding cache, NetworkPolicies and plan coordination

Proposed design

Problem statement

The cluster's CPU and memory limits are wrong in both directions: Grafana, the LLM gateway, the Alloy collectors and the exporters run near or at their limits and the kernel kills them, while argocd-repo-server and the LLM Valkey hold far more than they use, and 24 containers have no memory bound. No alert warns which limit is too low before a kill. On 2026-11-12 the owner asked for a check of the cluster for integrations and said the limits look unnecessarily low. This tracker records the resulting plan: raise the measured near-limit values now, hand the runner CPU rows to #4719, size every other container from Prometheus history with KRR, add generic OOM, crash-loop, waiting, throttle and near-limit alerts as the guard that AGENTS.md rule 11 asks for, and then add the integrations with the most value (image CVE scans, an outside heartbeat, a gateway embedding cache and the missing NetworkPolicies), in rank order.

Acceptance criteria

Requirement: Ranked child plan

The tracker SHALL list each child item in rank order with its kind, effort, value and dependencies.

Scenario: Read the ranked plan

  • WHEN A reader opens the tracker body.
  • THEN Each of the 23 child rows carries a rank, a kind, an effort, a value and a dependencies cell.

Requirement: Owner decisions recorded

The tracker SHALL record each of the four owner decisions with the answer that the owner gave on 2026-11-12.

Scenario: Compare the owner decisions with the reply

  • WHEN A reader compares the owner decisions section with the owner reply.
  • THEN The heartbeat, SearXNG metrics Secret, CoreDNS option b and Portkey unset decisions match the reply.

Requirement: Existing tool named

The tracker SHALL name KRR as the rightsizing tool and state the needs that KRR does not cover.

Scenario: Read the tool note

  • WHEN A reader opens the Existing Tool Considered section.
  • THEN The section names KRR and lists the alerting, image-scanning, heartbeat, embedding-cache and NetworkPolicy gaps.

Requirement: Child completion gate

The tracker MUST stay open until each child item is merged or closed with evidence.

Scenario: Close the tracker

  • WHEN A person moves the tracker to done.
  • THEN Every child item links to a merged pull request or to a closure comment that records its evidence.

Requirement: Re-measure raised limits

The #4991 pull request MUST receive a comment with the 7-day peak and the throttled share, measured again after the merge.

Scenario: Re-measure the raised limits

Requirement: Near-limit guard

The ContainerMemoryNearLimit rule MUST fire before the kernel kills a container that approaches its memory limit.

Scenario: Memory near the limit

  • WHEN A container's memory working set passes the near-limit threshold.
  • THEN The alert names the pod, the container and its limit, and no OOM kill of that container has happened yet.

Existing Tool Considered

KRR (robusta-dev/krr, MIT, last commit 2026-11-11, checked 2026-11-16) covers the rightsizing need of #4992: it reads Prometheus history and recommends CPU and memory requests and limits, and the project's Kubernetes guideline already takes a long-running container's first values from the KRR report, strategy simple (docs/guidelines/kubernetes.md:29, docs/guidelines/kubernetes.md:59). It lacks OOM, crash-loop, throttle and near-limit alerts (that is kubernetes-mixin), image CVE scanning of running images (Trivy Operator), an outside heartbeat (Healthchecks), a gateway embedding cache (the LiteLLM proxy cache on Valkey), the missing NetworkPolicies, and any coordination of the 23-item plan.

Key questions

  • Which tool sizes containers from Prometheus history for feat(k8s): size every container from Prometheus history with KRR #4992?: Use KRR (robusta-dev/krr, MIT), run with strategy simple. The project's Kubernetes guideline already names it as the tool that gives the 7-day peak of each container and as the first source of a long-running container's values, and its repository was last changed on 2026-11-11 (checked 2026-11-16). It does not add alerts, image scans, a heartbeat, an embedding cache or NetworkPolicies, so those items keep their own tools. (best practice) [sources: docs/guidelines/kubernetes.md:29, docs/guidelines/kubernetes.md:59, docs/guidelines/kubernetes.md:157, https://github.com/robusta-dev/krr]
    • Chosen: KRR (robusta-dev/krr). It is MIT, actively maintained, needs no agent in the cluster, and reads the Prometheus history that already exists; the project guideline already makes its report the measurement for memory room (T1) and the first value of a long-running container.
    • Rejected: Vertical Pod Autoscaler recommender. It gives the same sizing from observed use, but it needs a controller pod, three CRDs and about 40 objects in git, and it writes requests in the cluster while the homelab keeps every request in git.
    • Rejected: Build a recommender in this project. It adds code to build, keep and fix until it matches an open tool that already covers the need; the project guideline says to use an open tool before a script of the project (docs/guidelines/kubernetes.md:18).
  • Which heartbeat does item 8 (feat(monitoring): send a Watchdog alert to an outside heartbeat #4999) use?: The hosted Healthchecks.io free tier, as the owner answered "proceed as recommended" on 2026-11-12. A check inside the cluster cannot report that the cluster stopped, so the always-firing Watchdog alert goes to an outside service. The owner creates the account, the check and its notify channel and stores the ping URL in the keyring; devops k8s push-secrets writes it into a Secret that Alertmanager reads from a file, so no secret goes into git. Agents write the rule, the route and the tests. (a person decides) [sources: k8s/README.md:722, k8s/monitoring/prometheus-values.yaml:118]
  • Does item 14 (fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat #4201) add a SearXNG metrics password Secret?: Yes, as the owner approved on 2026-11-12. open_metrics needs a password, so it is a new Secret. The owner creates the keyring entry and runs devops k8s push-secrets --only devops/searxng; agents add the row in src/devops_cli/k8s/cluster_secrets.py and the scrape, and a start step renders the password into settings.yml, so the settings file stays in git with no secret. (a person decides) [sources: k8s/README.md:722, docs/CLUSTER.md:235, src/devops_cli/k8s/cluster_secrets.py:1]
  • Which CoreDNS option does item 6 (fix(k8s): delete the CoreDNS files that k3s never applies #4996) take?: Option b: delete the sizing files that k3s never applies. Option a (run CoreDNS from its Helm chart with 2 replicas and a larger limit) needs a host change and is not taken: the 7-day peak is 67 % of the 170Mi limit and the ContainerMemoryNearLimit rule of dan-petty/homelab#344 watches CoreDNS. The deletion is already in the tree at this commit (fix(k8s): delete the CoreDNS files that k3s never applies #5055, released 2026-11-12), so fix(k8s): delete the CoreDNS files that k3s never applies #4996 closes with that evidence and no owner step. (best practice) [sources: CHANGELOG.md:814]
    • Chosen: Option b: delete the CoreDNS files that k3s never applies. The packaged CoreDNS is the one that runs, so the dead sizing files mislead; the deletion is already merged (fix(k8s): delete the CoreDNS files that k3s never applies #5055, CHANGELOG.md:814) and needs no owner step.
    • Rejected: Option a: run CoreDNS from its Helm chart with 2 replicas. It needs a host change (k3s --disable=coredns or a .skip file) while the 7-day peak is 67 % of the 170Mi limit; the near-limit rule of dan-petty/homelab#344 is the cheaper guard, and option a is taken only when that rule fires.
  • Does item 17 (chore(k8s): remove the unused Portkey gateway and provider #5007) require a workstation config step after the merge?: Yes. After the merge the owner runs devops config unset ai.portkey_url on each workstation config. The ai section refuses a key that it does not declare, so a leftover ai.portkey_url stops every command that loads the settings, and the load error names that command. Agents never change config.yaml. (a person decides) [sources: docs/CONFIGURATION.md:18, docs/commands/config.md:69]

Open questions

Fit

Needs splitting into 23 items:

  1. rank 1: fix(k8s): raise the limits that 7 d of use shows are too low #4991 fix(k8s): raise the limits that 7 d of use shows are too low
  2. rank 2: feat(roadmap): the implement Job gates before its PR #4719 feat(roadmap): the implement Job gates before its PR
  3. rank 3: feat(k8s): size every container from Prometheus history with KRR #4992 feat(k8s): size every container from Prometheus history with KRR
  4. rank 4: dan-petty/homelab#344 feat(monitoring): alert on OOM kills, crash loops and memory near the limit
  5. rank 5: feat(monitoring): scrape the gateway database and alert on its size #4994 feat(monitoring): scrape the gateway database and alert on its size
  6. rank 6: fix(k8s): delete the CoreDNS files that k3s never applies #4996 fix(k8s): delete the CoreDNS files that k3s never applies (delivered by fix(k8s): delete the CoreDNS files that k3s never applies #5055, CHANGELOG.md:814; close with that evidence)
  7. rank 7: feat(k8s): scan running third-party images with Trivy Operator #4998 feat(k8s): scan running third-party images with Trivy Operator
  8. rank 8: feat(monitoring): send a Watchdog alert to an outside heartbeat #4999 feat(monitoring): send a Watchdog alert to an outside heartbeat
  9. rank 9: dan-petty/homelab#345 perf(k8s): the gateway caches embeddings in an LRU Valkey
  10. rank 10: dan-petty/homelab#346 fix(k8s): cover Traefik and the operators with NetworkPolicies
  11. rank 11: fix(service): the Service makes a second server span per request #5003 fix(service): the Service makes a second server span per request
  12. rank 12: feat(k8s): let Argo Workflows run roadmap pods in devops #4566 feat(k8s): let Argo Workflows run roadmap pods in devops
  13. rank 13: feat(k8s): back up the other app volumes off their node #4767 feat(k8s): back up the other app volumes off their node
  14. rank 14: fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat #4201 fix(k8s): Measure SearXNG throttle and stop CAPTCHA repeat
  15. rank 15: dan-petty/homelab#347 feat(monitoring): scrape the k3s API server and alert on errors
  16. rank 16: dan-petty/homelab#348 feat(monitoring): scrape Argo CD notifications and Image Updater
  17. rank 17: chore(k8s): remove the unused Portkey gateway and provider #5007 chore(k8s): remove the unused Portkey gateway and provider
  18. rank 18: dan-petty/homelab#349 feat(telemetry): trace Traefik over OTLP and log access as JSON
  19. rank 19: dan-petty/homelab#350 feat(telemetry): link metrics to traces with Tempo metrics and exemplars
  20. rank 20: dan-petty/homelab#351 feat(monitoring): add the upstream Argo CD and Valkey dashboards
  21. rank 21: test(monitoring): find alert rules that read missing series with pint #5011 test(monitoring): find alert rules that read missing series with pint
  22. rank 22: fix(k8s): enforce restricted Pod Security in the llm namespace #5012 fix(k8s): enforce restricted Pod Security in the llm namespace
  23. rank 23: feat(k8s): services preempt batch Jobs with priority classes #5013 feat(k8s): services preempt batch Jobs with priority classes

Suspected block

None.

Dependencies

None.

Sub-issues

Sub-issues

10 of 20 Issues completed
Loading 20 sub-issues

Activity

  1. added
    source/agent
    type/feature
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Owner decisions recorded (2026-11-12). The owner answered "proceed as recommended" to the recommended answers of this plan:

  5. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: KRR is an active, MIT-licensed Kubernetes resource recommender, and the issue itself proposes it to size containers from Prometheus history. That covers the rightsizing part of the plan, but not the alerting, image scanning, external heartbeat, embedding cache or NetworkPolicy work.

    Tool: robusta-dev/krr (https://github.com/robusta-dev/krr)

    • License: MIT
    • Last activity: 2026-11-11
    • Maintained: yes

    Covers:

    Lacks:

    • Does not add OOM, crash-loop, throttle or near-limit alerts
    • Does not scan running images for CVEs
    • Does not provide an external heartbeat or dead-man's-switch
    • Does not add a gateway embedding cache or missing NetworkPolicies
    • Does not coordinate or track the multi-item integration plan

    Tools considered:

    Searches run:

    • Healthchecks.io dead man's switch alert heartbeat, results: 5
    • Trivy Operator Kubernetes scan running images vulnerabilities, results: 5
    • KRR Kubernetes Resource Recommender Prometheus rightsizing containers, results: 5
    • aquasecurity trivy-operator github, results: 5
    • "krr" "resource recommender" kubernetes github, results: 5
    • healthchecks healthchecks.io github, results: 5
    • robusta-dev/krr, results: 5
    • Kubernetes Resource Recommender KRR documentation, results: 5
    • "Kubernetes Resource Recommender", results: 5

    Sources:

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Owner question: Which heartbeat does item 8 (#4999) use? (a person decides)

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions