Repository navigation
Description
Problem
devops k8s deploy-stack never applies the LLM gateway's NetworkPolicy. The Ollama tiers it deploys schedule only on nodes that carry a label nothing sets or documents. This was checked against release/v0.2.25 at 9c879ae.
The gateway runs with no policy.
_MANIFESTS_BY_STACK["llm"](src/devops_cli/commands/k8s/stack_lifecycle.py:152-160) applies the gateway's ConfigMap, Deployment and Service, but notk8s/llm/gateway/networkpolicy.yaml.teardown-stackdeletes the same list (:890), so it never removes the policy either.- The root kustomization that deploy-stack applies first (
stack_lifecycle.py:772,k8s/kustomization.yaml:4-11) does not includellm. k8s/llm/kustomization.yaml:14lists the policy, but nothing applies that kustomization. The ArgoCDllm-stackApplication points atpath: llm, which does not exist (k8s/argocd/apps/llm-apps.yaml:14), andkustomize build k8s/llmfails on the missingca-configmap.yaml(:7). feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 (v0.2.27, reworked 2026-10-03) fixes both with anllmApplication on the current release branch. The livellm-gateway-perimeterequals this file (kubectl diff, 2026-10-03), so feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 syncs it as it is; this item then treats that Application as the policy's deploy path. fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953's proposed deploy-path test counts a listing in that kustomization as a deploy path, so it passes for this policy even though nothing applies it.llm-default-perimeterexcludes the gateway on purpose (k8s/llm/networkpolicy.yaml:9-18). On a cluster built by deploy-stack, the gateway therefore has unrestricted ingress and egress. The gateway Deployment was written for a restricted egress: it uses the bundled cost map and turns telemetry off, with the comment "egress is limited to the inference backends" (k8s/llm/gateway/deployment.yaml:57-61).
The policy has dead and over-broad rules.
k8s/llm/gateway/networkpolicy.yaml:31-33admitsapp.kubernetes.io/name: ollama-volta-1. No manifest sets that label. Every tier isollama-<n>gib(k8s/llm/profiles/ollama-profiles.yaml:10, 25). fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 leaves this line to this item.:28-30admitsapp.kubernetes.io/name: ollama. No deployed pod carries that label either. It came from theollama/ollamachart (k8s/llm/values-ollama.yaml), which no Helm release installs (stack_lifecycle.py:116-129). fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 deletes those values. Thellm.devops.io/provider: ollamaselector (:34-36) is what matches the tiers.:60-72admits any address in 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 on ports 11434 and 8000. Every backend in the gateway ConfigMap is an in-cluster Service (k8s/llm/gateway/configmap.yaml: everyapi_baseisollama-<n>gib.llm.svc.cluster.local:11434). k3s's kube-router matches ipBlocks against pod IPs (fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953). This rule therefore admits every pod on those ports and makes the podSelector rules above it pointless.- The vLLM rule (
:40-52) belongs to chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820.
The egress test pins a fixed list. test_gateway_egress_admits_all_backends_in_configmap (tests/test_k8s_llm_gateway.py:476-506) never reads the ConfigMap. It asserts that the policy names ollama-volta-1, ollama, vllm and vllm-single. So it fails when those dead selectors are removed, and it passes when a ConfigMap backend is not admitted. #667 asked for a test covering every backend in the ConfigMap. _gateway_config() (:51-54, added by #962) already loads it. No test checks the other direction, that egress admits nothing beyond the backends. test_gateway_service_and_network_policy (:248-275) pins only the policy name, its podSelector and the ingress rule. The ipBlock rule, a podSelector: {} peer, or Egress dropped from policyTypes would each reopen egress with every test passing.
The Ollama tiers depend on an undocumented node label.
- Every tier's required node affinity is
nvidia.com/gpu.total-vram-gib In [...](ollama-profiles.yaml:44-46, 145-147, 246-248, 349-351, 452-454, 555-557, 658-670, 771-773). - The accepted values are multiples of 4 GiB from
16Gito128Gi. Each tier takes a range: 16gib takes 16-20, 24gib 24-28, 32gib 32-44, 48gib 48-60, 64gib 64-68, 72gib 72-92, 96gib 96-124 and 128gib 128. - GPU Feature Discovery labels per-GPU memory (
nvidia.com/gpu.memory) and the GPU count, not a total. In this repo, GitHub code search finds the label only in that manifest and in one task file. Indan-petty/homelab, which provisions the cluster's GPU nodes, it finds nothing. - So a fresh cluster, or a rebuilt node, schedules no Ollama pods, and every gateway route fails. deploy-stack does not notice.
- The docs still describe placement by
nvidia.com/gpu.familyornvidia.com/gpu.architecture(k8s/README.md:123-130). Every tier also keeps those selectors as six commented-out lines (ollama-profiles.yaml:38-43, and likewise in each tier). They are left over from the vLLM/Ollama architecture split, which feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734 removed.
The docs still describe a single Ollama StatefulSet.
k8s/README.md:130lists an "ollamaStatefulSet, one pod per node".:132says the gateway lists each pod asollama-<n>.ollama-nodes.- The knowledge base says the same (
src/devops_cli/ai/knowledge_base/devops_cli/tasks/k8s_stack_deployment.md:27).
Since #722, Ollama has run as one DaemonSet per VRAM tier behind ollama-<n>gib Services. #920 (v0.2.27) corrects the knowledge-base line, and #921 (v0.2.28) rewrites the README section. Neither says how the label gets onto a node.
Acceptance criteria
-
_MANIFESTS_BY_STACK["llm"]includesk8s/llm/gateway/networkpolicy.yaml, listed beforegateway/deployment.yaml, so a fresh deploy never starts the gateway without its policy.teardown-stackdeletes it. An offline test asserts both through the dry-runmanifestsandmanifest_deletesdetails. -
The gateway policy's egress admits only these, plus the vLLM rule (
k8s/llm/gateway/networkpolicy.yaml:40-52) that chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 removes:- Ollama tier pods (
llm.devops.io/provider: ollama) on TCP 11434; - Valkey (
app.kubernetes.io/name: valkey) on TCP 6379; - DNS to the
kube-systemnamespace on UDP and TCP 53.
The
ollama-volta-1selector, theapp.kubernetes.io/name: ollamaselector and the RFC 1918 ipBlock rule are removed. Ingress stays port 4000 from any source. - Ollama tier pods (
-
test_gateway_egress_admits_all_backends_in_configmapderives its backends from the files:- every
api_basein the gateway ConfigMap; LITELLM_REDIS_HOSTandLITELLM_REDIS_PORTfrom the gateway Deployment.
For each backend, the test finds the named Service in the
k8s/llmmanifests. It asserts that some egress rule has a podSelector whosematchLabelsare a subset of that Service's selector, with a port equal to the Service's numerictargetPort. The test fails on any backend that is not an in-cluster Service defined in the repo, or whose Service has no selector. It also fails when any selector or port the gateway needs is removed. - every
-
A second offline test asserts that egress admits nothing else. It uses the backend Services the test above resolves, and checks:
policyTypescontainsEgress, and the policy's podSelector matches the gateway Deployment's pod labels;- every egress rule has a non-empty
toand a non-emptyports; - no peer is an
ipBlock; - every
podSelectorpeer has nonamespaceSelectorbeside it, non-emptymatchLabelsand nomatchExpressions, and is one of two kinds:- its labels are a subset of some backend Service's selector, and every port in its rule is TCP and equals the
targetPortof each backend Service whose selector contains those labels; - it is one of the three vLLM selectors, held in one test constant that chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 deletes, in a rule whose only port is TCP 8000;
- its labels are a subset of some backend Service's selector, and every port in its rule is TCP and equals the
- the only
namespaceSelectorpeer iskubernetes.io/metadata.name: kube-system, without a podSelector, in a rule whose ports are exactly UDP 53 and TCP 53.
The checks live in one helper that returns the violations. The test asserts that the helper returns none for the real policy. A parametrized test asserts that it returns at least one for each of these edits to a copy of the policy: the RFC 1918 ipBlock rule re-added; a
podSelector: {}peer; theapp.kubernetes.io/name: ollamaselector, which stands for any selector that matches no backend Service (the cases spell noollama-voltastring, so thergcheck below stays empty); anamespaceSelector: {}peer; a rule withoutports; port 6379 added to the Ollama rule; andEgressremoved frompolicyTypes. -
When the
llmstack is selected,deploy-stackreads the nodes and warns about GPU nodes without a usable label. It uses thekubectl get nodes -o jsoncall it already makes, or one extra read.- A GPU node is one with
nvidia.com/gpucapacity above zero, or one labellednvidia.com/gpu.present=true. - It warns about every GPU node that lacks
nvidia.com/gpu.total-vram-gib, or whose value no tier accepts. Each warning names the node, the label, and the commandkubectl label node <node> nvidia.com/gpu.total-vram-gib=<N>Gi. - The accepted values are read from
ollama-profiles.yaml, not repeated in code. - If no node matches any tier, it also warns that no Ollama pod will schedule.
- If the node read fails, it says it could not check the label.
- In every case the deploy continues and exits 0. A dry run reads no nodes.
- Offline tests patch
_run_cmdand cover four cases: a correctly labelled GPU node (no warning), an unlabelled GPU node, a value outside every tier, and a node without GPUs (no warning).
- A GPU node is one with
-
The GPU placement section of
k8s/README.mdsays:- Ollama runs as one DaemonSet per total-VRAM tier, behind
ollama-<n>gibServices, and is scheduled bynvidia.com/gpu.total-vram-gib. - How to work out the value: the sum of
nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounitson the node, converted to GiB, rounded to the nearest multiple of 4 and suffixed withGi. - The
kubectl label nodecommand. - Which values each tier accepts.
- That deploy-stack warns about GPU nodes without the label.
- That deploy-stack applies
llm-gateway-perimeter, and what the policy admits.
- Ollama runs as one DaemonSet per total-VRAM tier, behind
-
The commented-out
nvidia.com/gpu.architectureandnvidia.com/gpu.familyselectors are removed from all eight tiers. -
Each of these prints nothing:
rg -n ollama-volta k8s src testsrg -n 'ollama-nodes|Ollama StatefulSet|`ollama` StatefulSet' k8s/README.md src/devops_cli/ai/knowledge_baserg -n 'gpu\.(family|architecture)' k8s/llm k8s/README.md
-
Tests touch no cluster and no network.
uv run devops cipasses. Achangelog.d/795.mdfragment records the change. -
Person-run, on homelab-k3s, after
devops k8s deploy-stack --stack llm:kubectl -n llm get networkpolicy llm-gateway-perimetershows the policy.- Through the gateway NodePort,
/v1/models, onedevops-chatcompletion and onebge-m3:latestembedding succeed. The gateway log shows no connection errors to Valkey or the tiers. kubectl get nodes -L nvidia.com/gpu.total-vram-gibshows a value on every GPU node. deploy-stack printed a label warning only for nodes without one.
Key questions
-
Should deploy-stack set the label or check for it? Check and warn (proposed). The value is the total GPU memory across a node's GPUs, and deploy-stack, running from a workstation, has no reliable source for it:
- node capacity counts GPUs but not their memory;
- the CLI deploys neither GPU Feature Discovery nor Node Feature Discovery (nothing applies
k8s/gpu-feature-discovery/).
A wrong automatic value would schedule a tier whose models do not fit. The label is set once per node, so a documented command plus a warning that names the node is enough.
-
Warn or fail? Warn (proposed). A cluster with no GPUs, or with some unlabelled nodes, still gets Open WebUI, Qdrant, Valkey and the gateway. The other selected stacks deploy in the same run.
-
Keep the label key under
nvidia.com/? Yes, in this item (proposed). NVIDIA does not define this label, sollm.devops.io/total-vram-gibwould be a cleaner key. Renaming it, though, means relabelling every live node at the same moment as the rollout. If wanted, the rename is a separate item. -
Drop the RFC 1918 ipBlock rule? Yes (proposed). Every backend in the ConfigMap is an in-cluster Service, and the new test fails if one is not. A backend outside the cluster would get a narrow
/32ipBlock in the change that adds it, and that change would allow that one address in the restriction test. -
Drop the
app.kubernetes.io/name: ollamaselector? Yes (proposed). No workload deploy-stack creates carries it, fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 deletes the Helm values it came from, and no other open item owns this line. -
What about the vLLM rule and port 8000? The vLLM podSelector rule (
k8s/llm/gateway/networkpolicy.yaml:40-52) and the "(Ollama, vLLM)" comment (:26) stay for chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 (proposed), which lists these lines in its scope. No manifest gives any pod those labels:rg -n 'provider: vllm|name: vllm' k8sfinds only NetworkPolicies andk8s/llm/profiles/README.md. So the rule admits no deployed pod. The restriction test allow-lists exactly its three selectors on TCP 8000, in one constant. chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 deletes the rule and that constant together; no other test names the gateway's vLLM selectors. The ipBlock rule's port 8000 goes with that rule here. chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 has no milestone, so the allow-list stays until chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 is scheduled. If a person would rather not wait, this item deletes the rule instead and drops the constant, and chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 drops these lines from its scope. -
Who adds the repo-wide test that every NetworkPolicy is applied? fix(k8s): deploy-stack applies the monitoring namespace perimeter #913 (proposed). This item asserts the gateway policy only and lands before fix(k8s): deploy-stack applies the monitoring namespace perimeter #913, so fix(k8s): deploy-stack applies the monitoring namespace perimeter #913's test passes for the gateway. fix(k8s): deploy-stack applies the monitoring namespace perimeter #913's test has to exempt policies whose workloads deploy-stack does not deploy:
k8s/llm/portkey/networkpolicy.yaml, andk8s/llm/profiles/networkpolicy.yamluntil chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 removes it. -
What if fix(ai): the knowledge base names only commands, options and components that exist #920 or docs: hand-written docs name only commands, options and components that exist #921 has not landed? Then this item makes their listed corrections to
k8s_stack_deployment.md:27and to the README's GPU placement section, so thergchecks above pass either way (proposed).
Depends on: none.
Order: after #953 (v0.2.25), #920 (v0.2.27) and #921 (v0.2.28), which edit nearby lines; before #913 (v0.2.29).
Related: #913 (the same gap for the monitoring perimeter), #820 (vLLM leftovers, including the gateway's vLLM rule), #755 (v0.2.27: Argo CD syncs k8s/llm/; this item rebases on it), #667 (added the policy).
Monitoring cleanup amendment (2026-10-03): the gateway's ServiceMonitor moves to the llm stack
The gateway's ServiceMonitor is rendered from k8s/monitoring/k8s-monitoring-values.yaml:233-249 (extraObjects), so the infra stack's k8s-monitoring release owns it. Live, it carries meta.helm.sh/release-name=k8s-monitoring. As a result:
teardown-stack --stack infradeletes the llm gateway's scrape while the gateway keeps running;- after
teardown-stack --stack llmdeletes namespacellm,deploy-stack --stack llmdoesn't recreate the scrape until the next infra deploy.
Acceptance criteria (added).
- The ServiceMonitor moves to
k8s/llm/gateway/servicemonitor.yamland is listed in_MANIFESTS_BY_STACK["llm"], which deploy and teardown both iterate. TheextraObjectsentry is deleted. -
tests/test_llm_pool_metrics.py:40andtests/test_stack_dashboards.py::_gateway_monitoredread the new file. -
prometheusOperatorObjects(collectoralloy-metrics) keeps discovering it. The CRD still comes from the infra stack'sprometheus-operator-crds, so an llm-only deploy on a cluster without infra tolerates the missing CRD, as the existingkubectl applywithcheck=Falsealready does. Under feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755, the file belongs to the llm Application. - Pending a person:
up{job="llm-gateway"} == 1afterdeploy-stack --stack llmalone on a cluster that already has the infra stack, andhelm get manifest k8s-monitoring -n monitoring | grep -c ServiceMonitorprints 0.
Grouping. This item is a child of #1128. It removes extraObjects from k8s-monitoring-values.yaml last, after the other children that edit that file. The open owner decision on #1042's selectors is unaffected. v0.2.29 and P1 are unchanged.
Update 2026-10-08: scope reduced to the gateway policy
Owner decision. This item now covers only the gateway policy:
devops k8s deploy-stackappliesllm-gateway-perimeterwith the llm stack;- the policy loses the selectors that match no pod and the RFC 1918 ipBlock rule;
- the egress test stops pinning the dead names.
#1042's live nvidia.com/gpu.architecture selectors on ollama-24gib, ollama-48gib and ollama-48gib-slow stay as they are. This takes option 1 from the 2026-10-03 comment, the status quo. The node-provisioning automation sets nvidia.com/gpu.architecture on every GPU node, which supports keeping them.
Suggested title: fix(k8s): deploy-stack applies the LLM gateway policy, and its egress admits only the gateway's backends.
Acceptance criteria (these replace every list above).
-
_MANIFESTS_BY_STACK["llm"]listsk8s/llm/gateway/networkpolicy.yamlbeforegateway/deployment.yaml, andteardown-stackdeletes it. An offline test asserts both through the dry-runmanifestsandmanifest_deletesdetails, and asserts that neither dry run makes a request. -
The gateway's egress admits only these, plus the vLLM rule that chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 removes:
- the Ollama tiers (
llm.devops.io/provider: ollama) on TCP 11434; - Valkey on TCP 6379;
- DNS to
kube-systemon UDP and TCP 53.
The
ollama-volta-1selector, theapp.kubernetes.io/name: ollamaselector and the RFC 1918 ipBlock rule are removed. Ingress stays TCP 4000 from any source. - the Ollama tiers (
-
test_gateway_egress_admits_all_backends_in_configmapderives its backends from every ConfigMapapi_baseand from the Deployment'sLITELLM_REDIS_HOSTandLITELLM_REDIS_PORT. It resolves each one to a Service underk8s/llmand asserts a podSelector-subset rule on that Service's numeric targetPort, as in the original criterion. -
A second offline test asserts that egress admits nothing else, through one violations helper and the seven parametrized widening edits of the original criterion. Any ipBlock is a violation, so the ipBlock case uses a documentation range.
-
rg -n ollama-volta k8s src testsprints nothing. -
Tests touch no cluster, DNS or network. A
changelog.d/795.mdfragment records the change, anduv run devops cipasses. -
Pending a person: after Argo CD syncs the merged revision, or after
devops k8s deploy-stack --stack llmon a cluster without Argo CD:- the policy shows no ipBlock;
/v1/models, adevops-chatcompletion and abge-m3:latestembedding succeed through the gateway;- the gateway's log shows no Valkey or tier connection errors.
If a route fails, the rollback is a revert.
Moved to #1367:
- the deploy-stack warning for GPU nodes no tier accepts;
- the
k8s/README.mdGPU placement section, including what the gateway policy admits; - removal of the commented-out selector blocks;
- the move of the gateway's ServiceMonitor out of
extraObjects.
That issue also takes this item's place as step 7 in #1128's order.
Corrected premises (checked at 910b823).
- feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 landed, so Argo CD's
llmApplication already syncs the policy throughk8s/llm/kustomization.yaml. The deploy-path gap remains only on clusters without Argo CD. The Applications trackmain, so the narrowed egress reaches an Argo CD cluster only after the release merges, and the person-run check runs then. - deploy-stack runs
kubectl applywithcheck=Falseand never reads the result (_apply_single_manifest). Listing the policy before the Deployment means it is applied first. It does not mean "a fresh deploy never starts the gateway without its policy", and that wording is dropped. - The ConfigMap's backends are the alias Services
ollama-16gib-fast,ollama-48gib-fast,ollama-48gib-slowandollama-64gib-standard, plusvalkey. Each is an in-cluster Service with a selector and a numeric targetPort, and no Ollama tier uses the host network. - These premises now belong to the follow-up:
- The profiles file has nine Ollama DaemonSets, not eight.
- Six of them carry a six-line commented-out block, 36 lines in all.
- "Every tier is scheduled only by total-vram-gib" is false since feat(llm): add speed-tier service aliases, align 48gib slow routing weights and bump max loaded models #1042.
- "Nothing sets the label" is stale: the node-provisioning automation, outside this repository, sets
total-vram-gibon multi-GPU nodes only, rounded to whole GiB. - The warning must run before deploy-stack's Argo CD early return, and
_get_unready_nodeshides read failures.
Coordination. #913's guard test exempts llm-gateway-perimeter under #795. Whichever of the two merges second deletes that exemption.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 2, 2026
Grooming (2026-10-02): Priority p2-medium → p1-high. deploy-stack on a fresh cluster or a rebuilt node schedules no Ollama pods, so the command is broken. The gateway also runs with no NetworkPolicy (unrestricted egress), which is a security exposure.
Checked against the code at the release/v0.2.25 tip.
dan-petty commentedon Oct 2, 2026
Placed in v0.2.29 on 2026-10-02. v0.2.29 holds P1 work that has to land before v0.3.0, which v0.2.25 to v0.2.28 had no room for. Backlog P1 items were ranked by Value, then Effort, with defects and security fixes first at a tie. This item ranked in the top ten, and two of the release's twelve slots stay open for P1 items that surface before then.
dan-petty commentedon Oct 2, 2026
Refined to Ready on 2026-10-02 for v0.2.29. The body was checked claim by claim against release/v0.2.25 at 9c879ae, and a second agent then tried to refute it; every major objection was resolved in a revision. Cited lines were updated for code that moved, and the scope was corrected where merged work changed it. Acceptance criteria were tightened so each fails on the current code, and every key question now has a proposed answer.
dan-petty commentedon Oct 3, 2026
Owner decision needed: #1042's selectors conflict with this issue's acceptance check. The S10 evaluation found this (
.data/review-evaluation-20261003-s10.md, section 4); no review finding raised it. I have changed no code or manifest.#1042 (f5fdf40) turned the commented-out selectors into live
nvidia.com/gpu.architectureselectors on 3 tiers ofk8s/llm/profiles/ollama-profiles.yaml(lines at the release/v0.2.25 tip):ollama-24gib(:143-145): In[pascal, maxwell, kepler];ollama-48gib(:346-348): In[ampere, ada-lovelace, blackwell, hopper];ollama-48gib-slow(:448-450): In[pascal, maxwell, kepler].The conflicts:
rg -n 'gpu\.(family|architecture)' k8s/llm k8s/README.mdmust print nothing. It now also prints these 3 live selectors, besides the commented-out lines andk8s/README.md:124that this issue already removes.k8s/README.md:124and task-668 (docs/agent/tasks/task-668-*.md:14) say placement accepts either GFD'snvidia.com/gpu.familyornvidia.com/gpu.architecture. The new selectors read onlygpu.architecture. On a node with only the GFD family label, the 24gib, 48gib and 48gib-slow tiers would never schedule [inference].Signs that it is intended:
src/devops_cli/k8s/gpu_matrix.pydescribes the homelab as Blackwell 16, Pascal 24 and 48, Ampere 48 and Volta 64 GiB.The options:
nvidia.com/gpu.architectureon GPU nodes.dan-petty commentedon Oct 3, 2026
#755 (v0.2.27, reworked) replaces the broken
llm-stackApplication and removes theca-configmap.yamlentry. The live gateway policy equals this file, so #755 syncs it as it is until this item changes it.[-]fix(k8s): deploy-stack never applies the gateway policy and ollama tiers need an undocumented label[/-][+]fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress[/+]fix(k8s): deploy-stack applies the LLM gateway policy and narrows its…
docs(release): the #795 and #913 task files record the gateway exempt…
chore(release): drop the llm-gateway-perimeter exemption now that #795 …
dan-petty-bot commentedon Oct 8, 2026
What changed
#1369, merged into
release/v0.2.29as 230e250.6 file(s) changed.
How it was verified
Check runs at 11b471d:
Acceptance Criteria of
docs/agent/tasks/task-795-deploy-stack-applies-gateway-policy.md:_MANIFESTS_BY_STACK["llm"]listsk8s/llm/gateway/networkpolicy.yamlbeforegateway/deployment.yaml, andteardown-stackdeletes it.tests/test_k8s.py::test_llm_stack_applies_the_gateway_policy_before_the_gateway_and_deletes_itruns both dry runs underforbid_requestsand asserts themanifestsorder, themanifest_deletesentry, and that no request is made. On the base revision it fails with(0, 0, False, False, []) != (0, 0, True, True, []).The gateway's egress admits only the Ollama tiers on TCP 11434, Valkey on TCP 6379, DNS to
kube-systemon UDP and TCP 53, and the vLLM rule chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 removes. Theollama-volta-1selector, theapp.kubernetes.io/name: ollamaselector and the ipBlock rule are gone. Ingress stays TCP 4000 from any source.tests/test_k8s_llm_gateway.py::TestK8sLLMGatewayManifests::test_gateway_egress_admits_all_backends_in_configmapreads its backends from the files: every ConfigMapapi_base(urllib.parse.urlsplit), plusLITELLM_REDIS_HOSTandLITELLM_REDIS_PORTfrom the gateway Deployment. It resolves each one against the<name>.<namespace>.svc.cluster.localname of every Service underk8s/llm. It fails when a backend is not such a Service, or when the Service has no selector or no numeric targetPort on the called port. It also fails when no egress rule has a podSelector whosematchLabelsare a subset of the Service's selector on that targetPort. Removing the Ollama rule, or moving Valkey to another port, makes it name the affected backends.test_gateway_egress_admits_nothing_elseasserts that_egress_violationsreturns nothing for the real policy. That helper checks five things:Egress;toandports;matchLabelsbut nomatchExpressions;_VLLM_SELECTORS, on TCP 8000; or the kube-system DNS peer, on exactly UDP and TCP 53.On the base revision the test fails, listing the two dead selectors and the three ipBlock peers.
test_each_widening_edit_is_a_violationapplies seven edits to a copy of the policy:podSelector: {}peer;app.kubernetes.io/name: ollamaselector;namespaceSelector: {}peer;ports;Egressremoved frompolicyTypes.Each edit yields at least one violation.
rg -n ollama-volta k8s src testsprints nothing.The tests read files, or run the CLI in dry-run mode with every subprocess, keyring and socket call refused. Each test's call phase stays under 1 s, and the egress inputs are read once per module.
Pending a person: once the release merges and Argo CD syncs the
llmApplication, or afteruv run devops k8s deploy-stack --stack llmon a cluster without Argo CD:kubectl -n llm get networkpolicy llm-gateway-perimeter -o jsonpath='{.spec.egress[*].to[*].ipBlock}'prints nothing.kubectl -n llm port-forward svc/llm-gateway 4000:4000running andKEYset to the gateway's master key:curl -sS -H "Authorization: Bearer $KEY" http://localhost:4000/v1/modelslists the models;curl -sS -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' http://localhost:4000/v1/chat/completions -d '{"model":"devops-chat","messages":[{"role":"user","content":"ping"}]}'returns a completion;curl -sS -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' http://localhost:4000/v1/embeddings -d '{"model":"bge-m3:latest","input":"ping"}'returns an embedding.kubectl -n llm logs deploy/llm-gateway --since=15m | grep -ciE '(error|exception|refused|timeout).*(redis|valkey|ollama)|connecterror'prints 0. It counts only error lines, so normal startup lines that mention Redis do not count.feat(release): v0.2.29 (#1455)
fix(k8s): a changed gateway ConfigMap rolls the gateway deployment, s…