Repository navigation
Description
Problem
k8s/monitoring/networkpolicy.yaml defines monitoring-default-perimeter. It is the default-deny ingress and egress policy for every pod in namespace monitoring (podSelector: {}, lines 9-12). Its exceptions are:
- the namespace's own pods;
- Traefik in
kube-systemon the UI and API ports (lines 17-47); - the
otelnamespace on 9090 and 4040 (lines 48-57); - scrape, push and API egress to
kube-system,llm,otel,cloudflaredandlogging, and to the internet on 80 and 443 (lines 58-147).
devops k8s deploy-stack never applies it.
- deploy-stack applies the root kustomization with
kubectl apply -k k8s/(src/devops_cli/commands/k8s/stack_lifecycle.py:770-772), then the files in_MANIFESTS_BY_STACKfor the selected stacks (:734-738,:778). k8s/kustomization.yaml:4-11listsnamespaces.yaml,cloudflared,registry,monitoring/service-aliases.yaml(fix(k8s): deploy-stack applies the monitoring services alloy, grafana and port-forward use #912) andmonitoring/dashboards. It does not list the policy._MANIFESTS_BY_STACK(stack_lifecycle.py:148-164) lists thellmperimeter (:153) and theloggingperimeter (:162). Itsinfraentry lists onlyotel/jaeger.yaml(:149-151).- Only
k8s/monitoring/kustomization.yaml:4-8lists the policy, and deploy-stack does not use that file. The ArgoCD Application that would sync it points atpath: monitoring(k8s/argocd/apps/infra-apps.yaml:14), which does not exist at the repository root (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). 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) replaces those Applications; itsmonitoringApplication syncsk8s/monitoring/from the current release branch, so on homelab-k3s this policy gains an Argo CD deploy path before this item lands. - The tests miss the gap because they check that each per-namespace kustomization lists its
networkpolicy.yaml(tests/test_k8s_network_policies.py:24-35). They never check the path deploy-stack actually uses.
The same was true at the v0.2.23 and v0.2.24 tags. Neither root kustomization lists the policy, and neither _MANIFESTS_BY_STACK names it.
On a cluster built by deploy-stack alone, no policy selects the monitoring pods. Every pod in the cluster can reach them, including:
- Prometheus, which has no authentication and accepts remote writes (
k8s/monitoring/prometheus-values.yaml:8-9); - Grafana, which admits anonymous Viewers (
k8s/monitoring/grafana-values.yaml:32-34); - Alloy;
- Pyroscope.
The LLM gateway's policy has the same gap (#795).
When this item was filed, homelab-k3s ran a monitoring-default-perimeter. It did not come from deploy-stack, because no deploy-stack path names the file, so a person applied it by hand. The original body cited the missing app.kubernetes.io/managed-by label as proof. The label proves nothing either way: the file sets only app.kubernetes.io/part-of, and kubectl apply adds no managed-by. Because the policy was applied by hand, it can differ from the file.
What changed since this item was filed (2026-10-01)
- feat(k8s): integrate grafana pyroscope to the monitoring stack #943 (acf1cde) added Pyroscope to the
infrastack in namespacemonitoring(stack_lifecycle.py:109-114), a Grafana datasource for it (grafana-values.yaml:68-71) and port 4040 to ingress rules 2 and 3 of the policy (networkpolicy.yaml:46-47,:56-57). feat(k8s): expose pyroscope ui endpoints, port-forwarding and grafana dashboards #977 added its port-forward and dashboard. A hand-applied copy older than feat(k8s): integrate grafana pyroscope to the monitoring stack #943 lacks port 4040. - fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 (v0.2.25, open) removes the
ipBlock: 0.0.0.0/0peer from ingress rule 2 (networkpolicy.yaml:18-20). The cluster's policy controller is kube-router, which matches that peer against pod addresses. While the peer remains, the policy admits every pod on ports 80, 3000, 8080-8082, 9090, 9100, 9400, 12345 and 4040. Until fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 lands, applying the file therefore does not close Prometheus, Grafana or Alloy to other pods. fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 also records a caveat that becomes live once deploy-stack applies the file.devops k8s configure-urls --addressing proxyreaches Grafana and Prometheus from the control-plane node's host network, and it works only because of where those pods are scheduled. - fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548 (v0.2.26) pins two egress rules of this file in a test: 6443 through the
ipBlock, and 3100 tologging. It does not edit the file, and it lists this item's deploy path as out of its scope. - feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 (v0.2.26: the in-cluster runtime, and the roadmap service's Deployment split from it on 2026-10-03) affect this item in three ways:
- feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 adds an egress rule to namespace
devopson TCP 8000 to this file, next to thellmscrape rule (networkpolicy.yaml:102-116). - feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083's setup guide has a person apply this file with
devops k8s apply k8s/monitoring/networkpolicy.yaml; once that runs, the live copy matches the file as it stood then. - feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 adds
devops-default-perimeter(k8s/devops/networkpolicy.yaml) and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 addsroadmap-service-ingress(k8s/devops/roadmap-service/networkpolicy.yaml). Both are applied withdevops k8s apply k8s/devops/ --templateuntil 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'sdevopsApplication syncs them, and feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's test asserts that the root kustomization leavesdevopsout. The root kustomization is also applied to the devcontainer's minikube (k8s/README.md:3), so deploy-stack never applies these policies.
- feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 adds an egress rule to namespace
- The gap is wider than the monitoring and gateway policies. At the release/v0.2.25 tip, deploy-stack applies only three of the ten NetworkPolicies under
k8s/:- Applied:
k8s/cloudflared/networkpolicy.yaml, through the root kustomization;k8s/llm/networkpolicy.yaml;k8s/logging/networkpolicy.yaml.
k8s/argocd/networkpolicy.yamlis not applied, although ArgoCD is aninfraHelm release (stack_lifecycle.py:73-78). As written, it cannot be applied safely. Its API-server rule (:52-66) has only namespaceSelector peers on 6443, and those never match the node address that thekubernetesService resolves to. fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548 found the same defect in the logging policy, and fix(k8s): restore kubernetes cpu metrics and align monitoring dashboards to homelab-k3s #737 fixed it for monitoring with anipBlockpeer. ItsipBlockrule (:67-81) does not include 6443. Applied unchanged, it would cut ArgoCD off from the API server.k8s/otel/networkpolicy.yamlis not applied: theinfraentry applies onlyotel/jaeger.yaml. Its metrics rule admits onlymonitoringon 8888 (:46-55), butotel-metrics-ingressroutes Traefik to 8888 (k8s/ingress/ingress-routes.yaml:487-506). Applied unchanged, it would break that route.k8s/llm/gateway/networkpolicy.yamlis not applied (fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795). Thellmperimeter excludes the gateway's pods (k8s/llm/networkpolicy.yaml:9-17), so the gateway runs with no policy at all.k8s/llm/profiles/networkpolicy.yamlis not applied. It selects vLLM pods that no manifest creates, and chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 deletes it.k8s/llm/portkey/networkpolicy.yamlis not applied. deploy-stack does not deploy Portkey; onlyk8s/llm/kustomization.yamllists it.- The
valkey-runs-perimeterink8s/llm/valkey-runs.yamlis not applied by deploy-stack. A person applies the whole file for the run index (src/devops_cli/commands/ai_runs.py:124-130,src/devops_cli/k8s/node_port.py:55).
- Applied:
Acceptance criteria
- deploy-stack applies
k8s/monitoring/networkpolicy.yamlthrough the root kustomization (key question 1), on every--stackvalue. - teardown-stack removes it.
--stack alldeletes the root kustomization's resources (stack_lifecycle.py:845-850), and--stack infradeletes namespacemonitoring(:853-865). An offline test mocksruntime._run_cmdand asserts both commands. No new teardown code is expected. - A new offline test guards every NetworkPolicy. It reads files and Python constants only.
-
It collects every NetworkPolicy, as (namespace, name), from every YAML file under
k8s/. -
It collects the ones deploy-stack applies:
- those reachable from
k8s/kustomization.yaml, with directory entries expanded; - those in every file of
_MANIFESTS_BY_STACK.
It generalises
_kustomize_services(tests/test_k8s_monitoring_integration.py:165-181) instead of copying it. - those reachable from
-
It asserts that every policy is either applied or listed in an exemption map in the test. Each exemption gives the file and either the issue that owns it or its other deploy path.
-
It asserts that no exempted policy is applied and that every exempted policy exists. A stale exemption therefore fails, whether its policy has gained a deploy path or been deleted, and the list only shrinks.
-
On the tree this item is built on, which includes the
devopspolicies of feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083, the test fails before the fix formonitoring-default-perimeterand for no other policy. It passes after the fix. -
The exemptions match that tree. As of this body they are:
- argocd, naming the follow-up issue (key question 3), and otel only if 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 has not landed (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 otel's policy);
- the gateway policy, naming fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795, unless fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795 has landed;
- the vLLM profiles policy, naming chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820, unless chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820 has deleted it;
- Portkey, because deploy-stack does not deploy it;
- valkey-runs, which a person applies for
devops ai runs; - the
devopspolicies, keyed as (devops,devops-default-perimeter) and (devops,roadmap-service-ingress), with their other deploy pathdevops k8s apply k8s/devops/ --template(and 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'sdevopsApplication once it lands). Permanent, because the runtime stays out of the root kustomization.
-
- Tests use structural tuple assertions and touch no cluster, DNS or network. A
changelog.d/913.mdfragment goes under### Security. -
uv run devops cipasses. - Person-run, before merge. Run
kubectl --context homelab-k3s diff -f k8s/monitoring/networkpolicy.yamland settle each difference. Either carry it into the file with a comment saying why, or drop it (key question 5). Record the result in the PR. - Person-run, after
devops k8s deploy-stack --stack infraon homelab-k3s. The live stack works under the applied policy:- Helm
--waitcompletes for everymonitoringrelease. - Alloy writes to Prometheus and Loki:
alloy-metricsandalloy-logslog no write errors, and new samples and log lines arrive. - Grafana's Prometheus, Loki, Jaeger and Pyroscope datasources pass "Save & test".
- The
otelcollector's remote write to Alloy on 9090 reports no send failures. - Traefik's routes to Grafana, Prometheus and Alloy answer.
count by (job) (up == 1)in Prometheus matches the value recorded before the apply.devops k8s configure-urls --addressing proxystill reaches Grafana and Prometheus, which is fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953's caveat.
- Helm
Key questions
- Root kustomization or
_MANIFESTS_BY_STACK["infra"]? Proposed: the root kustomization. The original reason, that the root kustomization is "theinfrastack's base", is not accurate: deploy-stack applies it for every--stackvalue (stack_lifecycle.py:770-772). It is still the better place. It creates namespacemonitoring(k8s/namespaces.yaml) on every run, so the perimeter is created in the samekubectl applyas the namespace, before any chart installs into it. fix(k8s): deploy-stack applies the monitoring services alloy, grafana and port-forward use #912 also put itsmonitoringresources there. The trade-off is that thellmandloggingperimeters stay in_MANIFESTS_BY_STACK(:153,:162), so perimeters live in two places. The guard test accepts either place. Moving those two is out of scope. - Does this item also deploy fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795's gateway policy? No (proposed). fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795 must first change that policy, by dropping the
ollama-volta-1selector and deriving the egress test from the configmap, and it is in v0.2.29 too. The guard test exempts the gateway policy under fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795, and whichever of the two items lands second deletes that exemption. - What about the argocd and otel perimeters, which deploy-stack also never applies? Not in this item (proposed). Neither can be applied as written. ArgoCD would lose the API server, and the
otel-metricsroute would break. Each also needs its own live check, and a mistake in ArgoCD's policy stops GitOps sync. They go into one follow-up P1 issue, filed when this body is adopted, and the guard test exempts both under that issue. The owner chooses its milestone. - Order against fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953, feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 and fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548? This item lands after all three (proposed). fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 edit this file, and fix(k8s): pod logs reach loki once and labelled, with alloy as the only shipper (remove fluent-bit) #548 adds a test that reads it. fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 is in v0.2.25 and the other two are in v0.2.26, so the release order already gives this. Landing before fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 would make deploy-stack apply a policy that still admits every pod through the
0.0.0.0/0peer. The person-run diff has to run against the file after fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953's and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083's edits. If feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741 or feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083 slips past this item, it adds its own exemption to the guard test. - If the live policy and the file differ, which one wins? The file (proposed). The repository is the source. Which copy is live depends on whether a person has run feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083's setup step that applies this file by the time this item is built. If so, the live copy matches the file as of that apply, including port 4040, fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953's removal of the
0.0.0.0/0peer and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083'sdevopsrule. If not, it is the older hand-applied copy, which may lack port 4040 (feat(k8s): integrate grafana pyroscope to the monitoring stack #943) and still carry the0.0.0.0/0peer. The person-run diff settles it either way. A live-only rule is carried into the file only if the person-run checks show the stack needs it, with a comment saying why. - Should
test_kustomization_includes_networkpolicy(tests/test_k8s_network_policies.py:24-35) change? No (proposed). It guards the per-namespace kustomizations, and whether those stay a deploy path is 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's decision. The new guard test covers deploy-stack. - What changes when 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 lands first (v0.2.27)? (proposed)
- On homelab-k3s, Argo CD's
monitoringApplication applies this file. On 2026-10-03kubectl diffshowed the file drops the live0.0.0.0/0ingress peer and adds 4040. 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 applies that diff and runs this item's after-apply checks then; this item's own live check runs against that copy. otel-default-perimeterhas been live since 2026-10-02 (applied by hand) and differs from the file only by port 4040, 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'sotelApplication syncs it and the otel exemption goes.k8s/argocd/networkpolicy.yamlstays unapplied until the KQ 3 follow-up.- deploy-stack still needs the root-kustomization path for clusters without Argo CD. When this item moves the policy into the root kustomization, it drops it from
k8s/monitoring/kustomization.yamlin the same PR, sobaseis its one owner. - The guard test counts an Application's synced path as a deploy path.
- On homelab-k3s, Argo CD's
Depends on: #953 (v0.2.25) and #1083 (v0.2.26), which change this file first. #741 and #1083 add the devops policies that the guard test exempts. #755 (v0.2.27) lands before this item.
Related: #548 (v0.2.26, test that pins two of this file's egress rules), #795 (gateway policy, v0.2.29), #820 (vLLM profiles policy), #755 (v0.2.27: Argo CD syncs every stack from the current release branch), #912 (root-kustomization precedent and _kustomize_services), #943 and #977 (Pyroscope), the argocd and otel perimeter follow-up (to be filed).
Found while fixing #912 from Copilot's review of release PR #905.
Scope added 2026-10-02: the argocd and otel follow-up in key question 3 has not been filed, and it should own one more defect in each file. Ingress rule 2 of k8s/otel/networkpolicy.yaml admits ipBlock: 0.0.0.0/0 on TCP 16686 (:31-32). It sits next to a kube-system/Traefik peer (:25-30) that already serves the jaeger-ingress route (k8s/ingress/ingress-routes.yaml:436-458). Ingress rule 2 of k8s/argocd/networkpolicy.yaml admits only 0.0.0.0/0, on 8080 and 443 (:17-25). It has no Traefik peer, although argocd-ingress routes Traefik to argocd-server (ingress-routes.yaml:412-434), and the server is a NodePort (k8s/argocd/values.yaml:22-25). kube-router matches the CIDR against pod addresses (#953), so once applied, either rule admits every pod in the cluster. All four branch reviews of release/v0.2.25 (sessions 20261002-142541 to 20261002-200610) reported the otel rule. Neither file is applied today, so both defects are latent. ArgoCD's fix needs the follow-up's live check.
- (person-run) Before this item merges, the argocd and otel follow-up is filed and the guard test's argocd and otel exemptions cite its number. Its body puts both
0.0.0.0/0ingress peers in scope: otel keeps its Traefik peer, and ArgoCD gains a Traefik peer plus whatever its NodePort access needs, as its live check settles.
Monitoring cleanup amendment (2026-10-03): live drift
The live monitoring-default-perimeter (created 2026-09-30, from a kubectl last-applied annotation) still has an ingress rule from ipBlock 0.0.0.0/0 plus Traefik. It covers ports 80, 3000, 8080, 8081, 8082, 9090, 9100, 9400 and 12345. That is the state #953 removed from the repo, whose ingress comment says "No ipBlock". Because deploy-stack never applies this file, #953's fix never reached the cluster.
Acceptance criteria (added).
- Pending a person: after the deploy,
kubectl get networkpolicy -n monitoring monitoring-default-perimeter -o yamlhas no ingressipBlock. - The k8s-monitoring alloy-operator's pre-delete hook Job still reaches the API server under the deployed perimeter.
Grouping. Related to #1128 (step 1 of its order), not a child. Scope and v0.2.29 placement are otherwise unchanged.
Update 2026-10-08
Delivered on fix/913-deploy-stack-monitoring-perimeter, checked against release/v0.2.29 at 910b823. The delivered scope differs from the body as follows.
Deploy path (replaces AC1, KQ1 and KQ7's ownership bullet)
- A native
devops k8s deploy-stack --stack infra(orall) applies the policy through_KUSTOMIZATIONS_BY_STACK["infra"] = monitoring, previouslymonitoring/dashboards(fix(k8s): a native deploy-stack applies the grafana dashboards again #1297). - It runs right after the root kustomization creates the namespace, before Secrets and any chart. It applies exactly what Argo CD's
monitoringApplication syncs: the perimeter plus the dashboards. k8s/kustomization.yamlandk8s/monitoring/kustomization.yamlare unchanged:- Listing the policy in the root would bring back the base/monitoring SharedResourceWarning loop that fix(k8s): resolve argocd application out-of-sync and manifest generation failures #1279 removed.
- Dropping it from the monitoring kustomization (KQ7) would fail
test_kustomization_includes_networkpolicy[monitoring], which KQ6 keeps. It would also move live ownership between two pruning Applications.
--stack llm|logging|devopsdo not apply the policy, since they install nothing inmonitoring. AC1's "every--stackvalue" is dropped.
Corrected premises
- 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 has closed, and Argo CD's
monitoringApplication already applies the policy on the homelab cluster. The remaining gap was on clusters without Argo CD. - fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953 (no ingress
ipBlock), port 4040 and feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github #1083'sdevops8000 egress are already in the file. - The
devopspolicies are applied by_MANIFESTS_BY_STACK["devops"], so thedevopsexemptions in the AC are dropped.
Guard test (test_every_network_policy_has_a_deploy_stack_path_or_an_owned_exemption)
- The applied set is the root kustomization, every
_KUSTOMIZATIONS_BY_STACKentry and every_MANIFESTS_BY_STACKfile for--stack all. - Argo CD Application paths are not counted as deploy paths, otherwise the test would pass before the fix. They appear only as an exemption's other path.
- Exemptions:
- argocd: fix(k8s): the argocd and otel perimeters admit 0.0.0.0/0 ingress and deploy-stack applies neither #1371;
- otel: Argo CD's
otelApplication, with deploy-stack in fix(k8s): the argocd and otel perimeters admit 0.0.0.0/0 ingress and deploy-stack applies neither #1371; llm-gateway-perimeter: fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795;vllm-profiles-perimeter: chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820;portkey-perimeterandvalkey-runs-perimeter: Argo CD'sllmApplication.
- It failed before the fix for
monitoring-default-perimeteronly. - Kustomizations are rendered with
kubectl kustomizein a sharedtests/k8s_manifests.py, which replaces_kustomize_services. Per the library-over-hand-rolled rule, this replaces the generalised hand-written walker the body proposed._kustomized_filesintests/test_k8s_llm_gateway.pyis left to fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795.
Teardown
- No code change.
--stack all(kubectl delete -k k8s) and--stack infra(kubectl delete namespace monitoring) remove the policy, and a parametrized test now pins both.
Person-run checks
- deploy-stack applies no manifests while Argo CD manages a cluster. The functional checks therefore remain Pending a person against the Argo-synced perimeter on the homelab cluster. Nothing records that 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 ran them.
- A separate pending check covers the native path. It needs a cluster without Argo CD whose CNI enforces policy; the devcontainer's minikube enforces none (fix(k8s): devops k8s bootstrap says calico but starts minikube without a policy-enforcing cni #990).
- The pre-merge
kubectl diffstays and is expected to be empty.
KQ3
- The argocd/otel follow-up is fix(k8s): the argocd and otel perimeters admit 0.0.0.0/0 ingress and deploy-stack applies neither #1371. It also owns both
0.0.0.0/0ingress peers. Since 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 otel ones (16686 world peer, 8888 route gap) are live wherever Argo CD syncsk8s/otel.
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.
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
The
roadmapnamespace and policy are nowdevops(#741:devops-default-perimeter; #1083:roadmap-service-ingress). #755 (v0.2.27) gives this file an Argo CD deploy path first and syncs otel's policy (live since 2026-10-02, differing only by port 4040); argocd's stays exempt under the KQ 3 follow-up, which is still unfiled.dan-petty commentedon Oct 3, 2026
Consolidation note (2026-10-03): #818 is merged into #1104, which adds a repo-only test that no plain manifest declares a Service in a namespace a Helm release installs into. This item adds the repo-wide NetworkPolicy deploy-path guard. Whichever of the two lands second folds the other's check into one manifest-ownership test, with one exemption map. Scope and placement are unchanged.
fix(k8s): deploy-stack applies the monitoring namespace perimeter (#913…
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
#1380, merged into
release/v0.2.29as 3e2c489.10 file(s) changed.
How it was verified
Check runs at 16b59bd:
Acceptance Criteria of
docs/agent/tasks/task-913-deploy-stack-applies-the-monitoring-perimeter.md:A native
deploy-stack --stack infra(andall) appliesk8s/monitoring, the perimeter and the dashboards, right after the root kustomization.test_native_deploy_stack_infra_applies_the_monitoring_kustomizationpins thekubectl apply -ktargets[k8s, k8s/monitoring].test_deploy_stack_dry_run_lists_the_kustomizations_its_stacks_applylistsk8s/monitoringforinfraandall, and nothing forllm. Both are intests/test_k8s.py. The Argo CD path and the root kustomization are unchanged.teardown-stack removes the perimeter with its namespace without new code.
test_teardown_stack_removes_the_monitoring_perimeter_with_its_namespace[all|infra]assertskubectl delete -k k8s --ignore-not-foundandkubectl delete namespace monitoring --ignore-not-found.test_every_network_policy_has_a_deploy_stack_path_or_an_owned_exemption(tests/test_k8s_network_policies.py) reads every NetworkPolicy underk8s/and compares it with the set deploy-stack applies. One tuple assertion checks three lists, all empty:Each exemption names its file and the issue or path that owns it:
otelApplication, and fix(k8s): the argocd and otel perimeters admit 0.0.0.0/0 ingress and deploy-stack applies neither #1371 for deploy-stack;llm-gateway-perimeter: fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795;vllm-profiles-perimeter: chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820;portkey-perimeterandvalkey-runs-perimeter: Argo CD'sllmApplication, plus a person's apply fordevops ai runs.The tests use structural tuple assertions and reach no cluster, DNS or network. The only process they run is
kubectl kustomizeon repository files.The alloy-operator pre-delete hook's API-server egress is pinned offline by
test_monitoring_network_policy_alloy_egress_rules(6443 through theipBlock,tests/test_k8s_logging_stack.py). The file has no ingressipBlock(test_monitoring_ingress_admits_no_world_cidr).changelog.d/913.mdrecords the change under### Security;CHANGELOG.mdanddocs/ROADMAP.mdare not edited.uv run devops cipasses.Pending a person, before merge:
kubectl --context homelab-k3s diff -f k8s/monitoring/networkpolicy.yamlprints nothing, because Argo CD'smonitoringApplication syncs this file with self-heal. Settle any difference: carry it into the file with a comment saying why, or drop it. A live-only rule is carried only if the checks below show the stack needs it.Pending a person, on homelab-k3s under the Argo-synced perimeter:
kubectl --context homelab-k3s -n argocd get application monitoringshowsSyncedandHealthy.kubectl --context homelab-k3s -n monitoring get networkpolicy monitoring-default-perimeter -o jsonpath='{.spec.ingress[*].from[*].ipBlock}'prints nothing.kubectl --context homelab-k3s -n argocd get applicationsshowsHealthyfor every Application that installs intomonitoring.kubectl --context homelab-k3s -n monitoring logs -l app.kubernetes.io/name=alloy-metrics --since=1hand the same foralloy-logsshow no write errors.kubectl --context homelab-k3s -n otel logs -l app.kubernetes.io/name=opentelemetry-collector --since=1hshows no failed sends to Alloy on 9090.up == 0returns no series.devops k8s configure-urls --addressing proxy --context homelab-k3sstill reaches Grafana and Prometheus while they run on the control-plane node (fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953's caveat,k8s/README.md).k8s-monitoringrelease is removed, its alloy-operator pre-delete hook Job completes:kubectl --context homelab-k3s -n monitoring get jobs.Pending a person, on a cluster without Argo CD whose CNI enforces NetworkPolicy:
uv run devops k8s deploy-stack --stack infra --context <context>.kubectl --context <context> -n monitoring get networkpolicy monitoring-default-perimeterlists the policy.--waitcompleting for everymonitoringrelease.feat(release): v0.2.29 (#1455)
fix(k8s): start minikube with calico cni and align bootstrap help (#2122