Rollout of Gitea #5: every chart gets a NetworkPolicy, networkPolicy.enabled: true by default, one major per chart — following the plan approved in the last comment on the issue.
This PR is in progress. It opens early on purpose: the enforcement proof the whole scope rests on has to run in CI before 29 charts are switched over, and partial work that is pushed survives an interrupted agent. The chart list below is kept current as commits land.
What was measured, not assumed
Re-verified against the live cluster before anything was written, because the issue body describes a cluster that no longer exists:
One addition to the plan's table, and it matters: the GatewayClass controller is traefik.io/gateway-controller and cluster-gateway holds no pods of its own. The same rke2-traefik DaemonSet serves both the Ingress and the HTTPRoutes from the Gateway sweep (#114), so one source selector covers both paths — no second controller entry is needed anywhere.
A policy written against ingress-nginx would have been accepted, would have looked strict, and would have silently blocked all web traffic.
And one cluster setting this whole convention rests on and cannot check: Traefik runs without hostNetwork, so its pods have real pod IPs (10.42.3.120, 10.42.4.94, 10.42.0.187 in the pod CIDR 10.42.0.0/16, nodes on entirely different addresses) — and only because of that does a podSelector match it. On host networking those pods would share the node's namespace, stop being selectable as pods, and every web chart would go dark at once while every pod stayed Ready, because the probe path does not run through the controller. Same class as --enable-certificate-owner-ref in #126; recorded in README §15 and in the header of template-chart's policy so whoever changes the controller's networking meets it there.
The convention
Per chart, templates/<chart>.networkpolicy.yaml, values networkPolicy.{enabled,allowedNamespaces,probeSources,ingressController,egress.extraPorts}.
Each port of a workload falls into one of four classes, and the class decides the rule:
probe path — a port a network probe addresses. Rendered with no from by default and restricted once probeSources is set. The kubelet probes from the IP of the worker node running the pod, which no chart can know; a guessed CIDR that misses it drops every probe and the pod never becomes Ready — a symptom that reads as a broken application. exec probes are not in this class: they run inside the container and put no packet on the network, which is exactly why valkey and minecraft-server can restrict their port by source with no probeSources at all.
public — published by a NodePort Service. No from, because the source is the internet and arrives already masqueraded.
closed — restricted to the release's own namespace, allowedNamespaces, and the ingress controller where the chart routes HTTP to that port.
self — reachable only from the pods of the same workload (clustering ports).
No chart ships allowedNamespaces pre-filled. A chart naming mc-router or stalwart in its defaults would bake in an assumption about this cluster's namespace layout, which a chart cannot keep true — so the default is empty and restrictive, and filling it is the deployment adaptation. That is why this PR produces a list of release-side one-liners: they are the expected procedure, not a defect list, and the breaking-change major on each chart is what announces them.
ingressController is a separate value rather than a line in allowedNamespaces for one reason: its two keys render as onefrom entry, which is an AND. Putting kube-system into allowedNamespaces instead would open the port to every pod in kube-system.
What these policies do NOT do
Written per chart rather than quietly accepted:
Egress is capped by PORT, never by destination. A NetworkPolicy matches CIDRs and selectors and never hostnames, so "only to the database host" is not expressible. Canal has no FQDN rule; Calico's GlobalNetworkSet could express one but would bind every chart to Calico — the same argument that kept implementation-specific objects out of #114. So it is not used.
The probed port stays open inside the cluster by default. For a single-port web app that means the policy is a port and egress ceiling, not pod-level isolation.
A policy is only a boundary where the CNI enforces one. Unenforced, it is accepted and filters nothing, so everything reads as configured.
CI: ci/run-networkpolicy-test.sh + the NetworkPolicy job
Every rendered policy is held against the pod specs, probes and Services of the same render. Helm is the parser through ci/yaml2json, as in the other render tests — the runners have neither pyyaml nor yq.
the podSelector matches a pod spec of that render;
every ingress port is a containerPort of the selected pods — this catches the NodePort mistake mechanically. Egress ports are deliberately excluded: an egress port belongs to the destination;
no ingress rule allows every source by accident;
the probe path — restricted only with probeSourcesand the consequence in NOTES.txt.
Plus two guards: a chart that renders no policy fails (which is how this issue decayed — garage and keycloak were both created after #5 and both arrived without one), and a # comment inside a rendered policy fails, because it is part of the object and ships to the cluster.
Assertion 3 is stricter than the plan's wording, deliberately. The plan banned a missing or empty from. from: [] always fails — it allows everything while reading as a restriction. A missingfrom is the documented open form that both precedents use on purpose, so it is accepted only where the render itself justifies it: every port of the rule is probed, or published by a NodePort Service. Anything else is an allow-all nobody chose.
All failure paths were executed, not only the green ones — 12 cases, and one earned its keep immediately: the probeSources check was a substring test, so a chart whose key had been deleted while the comment above it still discussed the value passed. It now looks for the key.
What stays unprovable
That traffic still flows. No ingress controller runs in the install-test cluster, so the path from Traefik to a pod is proven nowhere. What is proven: the probe path, acceptance by the API server, and the render assertions.
satisfactory has no install-test coverage at all (ci/excluded-charts.txt). For that one chart the review is the only net.
Egress correctness per release. The cap is by port; an operator whose dependency sits on a non-standard port finds out through an application-level error.
One major each. ci/run-networkpolicy-test.sh: 30 charts, 206 assertions held, 0 failed.
The charts worth reviewing first, because they decided things
Chart
Why
keycloak
the largest blast radius in the PR. Its three ports are three different classes, and its http rule is the only genuinely source-restricted inbound rule in the sweep — possible only because the probes use the management port. If the ingress-controller source is wrong, every login in the cluster stops, and nothing in CI can see it: no controller runs there and the probes use 9000, so the pod goes Ready either way. Port numbers and the database port are derived from keycloak.settings.
homeassistant, satisfactory
policyTypes: [Ingress], no egress section. Each argues it in its own file. satisfactory's deciding half: it is the one chart with no install-test at all, so an egress cap there would be the only one in the sweep with no empirical check behind it, on the chart whose correct port set (Steam's CDN) is least knowable.
minecraft-server
the tightest policy here, and the reason generalises: all three probes are exec probes, so no port has to stay open for the kubelet and no probeSources value exists. Its game port has two branches rendered from the same value the Service reads.
gotenberg
keeps a DNS-only cap on purpose (headless Chromium on a port the whole cluster can reach = SSRF pivot), with networkPolicy.egress.remoteAssets as a named switch, off by default, for releases that need remote images. Measured: paperless sends the .eml to Tika and the resulting HTML here, so embedded images are MIME parts needing no network (Tika stays DNS-only) while remote ones are fetched by Chromium and silently dropped with the switch off.
bulwark
the quietest failure in the PR: its probes test its own port, so a jmapServerUrl on a port the policy blocks yields a Ready pod serving an empty webmail.
matrix-synapse
two policies, one per workload. Synapse federates; the delegation nginx returns a constant. One policy would have to permit the union.
samba, satisfactory, teamspeak-server
ship fewer values than the convention names, deliberately — see below.
valkey, stalwart
pulled onto the convention with no rule changed. stalwart gains ingressController and a correction: it advised allowedNamespaces: ["ingress-nginx"], and both halves of that are wrong.
Keycloak's blast radius, measured
The keycloak row above is the largest risk in this PR, and it is now smaller than it first read. Every readable in-cluster consumer addresses Keycloak by its public name, so its traffic arrives from Traefik and is permitted by the rule exactly as shipped:
through their PAPERLESS_SOCIALACCOUNT_PROVIDERS block
A search across pod environments and ConfigMaps for the in-cluster Service name (keycloak-keycloak-service, *.keycloak.svc) returned only Keycloak's own pods, reaching keycloak-pg-rw.jlab-pg.svc.cluster.local:5432 — which incidentally confirms the egress rule derived from keycloak.db.port is right for the live release.
The login test after the upgrade stays the acceptance criterion, because a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed is that there is now a measured reason to expect it to pass.
Three things the checks caught while this was written
minecraft-server's RCON rule named a port the pod does not declare — the containerPort is gated on server.rcon.enabled and the rule was not. Assertion 2 rejected it.
samba and satisfactory would have shipped values that reach no rule. Every one of their inbound rules is open to any source, so allowedNamespaces and probeSources did nothing. A value that silently does nothing is worse than one that is absent, because it reads as a control — both are gone from those charts and their schemas, with the reason in values.yaml.
The probeSources assertion was a substring test, so a chart whose key had been deleted while the comment above it still discussed the value passed. Found by running the fail path; it now looks for the key.
gotenberg's new NOTES.txt branch read .Values.networkPolicy.egress.remoteAssets directly, which fails the whole render with nil pointer evaluating interface {}.remoteAssets when an operator erases the egress block — the schema permits null there, and issue #99's rule is that an erased block means the default applies, not a broken render. Null-safe now, and an erased block falls back to DNS-only, which is the restrictive direction.
Docs
README.md (style guideline §15 + the CI section) and CLAUDE.md (the binding compact summary). Wiki, pushed as 8198027: Chart-Style-Guide §15, CI-CD §8 (later jobs renumbered), Charts, all 29 chart pages plus template-chart, and four Lessons-Learned entries — the net that existed for a different failure than the one it was built for; a template comment that could not describe its own syntax; three values that reached no rule; and the subchart whose comments the parent could not fix.
Rollout of **Gitea #5**: every chart gets a NetworkPolicy, `networkPolicy.enabled: true` by default, one **major** per chart — following the plan approved in the last comment on the issue.
**This PR is in progress.** It opens early on purpose: the enforcement proof the whole scope rests on has to run in CI before 29 charts are switched over, and partial work that is pushed survives an interrupted agent. The chart list below is kept current as commits land.
## What was measured, not assumed
Re-verified against the live cluster before anything was written, because the issue body describes a cluster that no longer exists:
| | |
| --- | --- |
| ingress-nginx | **gone** — no DaemonSet, no pods |
| IngressClass | only **`traefik`**, as the default; no `nginx` class |
| Ingress objects cluster-wide | **none** |
| Traefik | `kube-system`, DaemonSet `rke2-traefik`, pod label `app.kubernetes.io/name: rke2-traefik`, `web=8000 websecure=8443 traefik=8080 metrics=9100` |
| CNI | **Canal** (Flannel + Calico for policy), 6/6 |
| Cluster-wide default-deny | **none** |
One addition to the plan's table, and it matters: the **GatewayClass controller is `traefik.io/gateway-controller`** and `cluster-gateway` holds **no pods of its own**. The same `rke2-traefik` DaemonSet serves both the Ingress and the HTTPRoutes from the Gateway sweep (#114), so **one source selector covers both paths** — no second controller entry is needed anywhere.
A policy written against ingress-nginx would have been accepted, would have looked strict, and would have silently blocked all web traffic.
**And one cluster setting this whole convention rests on and cannot check:** Traefik runs **without `hostNetwork`**, so its pods have real pod IPs (`10.42.3.120`, `10.42.4.94`, `10.42.0.187` in the pod CIDR `10.42.0.0/16`, nodes on entirely different addresses) — and *only* because of that does a `podSelector` match it. On host networking those pods would share the node's namespace, stop being selectable as pods, and **every web chart would go dark at once** while every pod stayed `Ready`, because the probe path does not run through the controller. Same class as `--enable-certificate-owner-ref` in #126; recorded in README §15 and in the header of `template-chart`'s policy so whoever changes the controller's networking meets it there.
## The convention
Per chart, `templates/<chart>.networkpolicy.yaml`, values `networkPolicy.{enabled,allowedNamespaces,probeSources,ingressController,egress.extraPorts}`.
Each port of a workload falls into one of four classes, and the class decides the rule:
- **probe path** — a port a *network* probe addresses. Rendered with **no `from`** by default and restricted once `probeSources` is set. The kubelet probes from the IP of the worker node running the pod, which no chart can know; a guessed CIDR that misses it drops every probe and the pod never becomes Ready — a symptom that reads as a broken application. `exec` probes are **not** in this class: they run inside the container and put no packet on the network, which is exactly why `valkey` and `minecraft-server` can restrict their port by source with no `probeSources` at all.
- **public** — published by a NodePort Service. No `from`, because the source is the internet and arrives already masqueraded.
- **closed** — restricted to the release's own namespace, `allowedNamespaces`, and the ingress controller where the chart routes HTTP to that port.
- **self** — reachable only from the pods of the same workload (clustering ports).
**No chart ships `allowedNamespaces` pre-filled.** A chart naming `mc-router` or `stalwart` in its defaults would bake in an assumption about this cluster's namespace layout, which a chart cannot keep true — so the default is empty and **restrictive**, and filling it is the **deployment adaptation**. That is why this PR produces a list of release-side one-liners: they are the expected procedure, not a defect list, and the breaking-change major on each chart is what announces them.
`ingressController` is a separate value rather than a line in `allowedNamespaces` for one reason: its two keys render as **one** `from` entry, which is an AND. Putting `kube-system` into `allowedNamespaces` instead would open the port to every pod in `kube-system`.
## What these policies do NOT do
Written per chart rather than quietly accepted:
- **Egress is capped by PORT, never by destination.** A NetworkPolicy matches CIDRs and selectors and never hostnames, so "only to the database host" is not expressible. Canal has no FQDN rule; Calico's `GlobalNetworkSet` could express one but would bind every chart to Calico — the same argument that kept implementation-specific objects out of #114. So it is not used.
- **The probed port stays open inside the cluster by default.** For a single-port web app that means the policy is a port and egress ceiling, not pod-level isolation.
- **A policy is only a boundary where the CNI enforces one.** Unenforced, it is accepted and filters nothing, so everything reads as configured.
## CI: `ci/run-networkpolicy-test.sh` + the `NetworkPolicy` job
Every rendered policy is held against the pod specs, probes and Services of the **same** render. Helm is the parser through `ci/yaml2json`, as in the other render tests — the runners have neither `pyyaml` nor `yq`.
1. the `podSelector` matches a pod spec of that render;
2. every **ingress** port is a `containerPort` of the selected pods — this catches the NodePort mistake mechanically. Egress ports are deliberately excluded: an egress port belongs to the *destination*;
3. no ingress rule allows every source by accident;
4. the probe path — restricted only with `probeSources` **and** the consequence in `NOTES.txt`.
Plus two guards: a chart that renders **no** policy fails (which is how this issue decayed — `garage` and `keycloak` were both created after #5 and both arrived without one), and a `#` comment inside a rendered policy fails, because it is part of the object and ships to the cluster.
**Assertion 3 is stricter than the plan's wording, deliberately.** The plan banned a missing *or* empty `from`. `from: []` always fails — it allows everything while reading as a restriction. A *missing* `from` is the documented open form that both precedents use on purpose, so it is accepted only where the render itself justifies it: every port of the rule is probed, or published by a NodePort Service. Anything else is an allow-all nobody chose.
**All failure paths were executed, not only the green ones** — 12 cases, and one earned its keep immediately: the `probeSources` check was a substring test, so a chart whose key had been deleted while the comment above it still discussed the value passed. It now looks for the key.
## What stays unprovable
- **That traffic still flows.** No ingress controller runs in the install-test cluster, so the path from Traefik to a pod is proven nowhere. What *is* proven: the probe path, acceptance by the API server, and the render assertions.
- **`satisfactory`** has no install-test coverage at all (`ci/excluded-charts.txt`). For that one chart the review is the only net.
- **Egress correctness per release.** The cap is by port; an operator whose dependency sits on a non-standard port finds out through an application-level error.
## Charts — all 29, plus the reference
`template-chart` (reference) · `apache-tika` · `bentopdf` · `bulwark` · `calibre-web-automated` · `cyberchef` · `freesailarr` · `garage` · `gotenberg` · `homeassistant` · `keycloak` · `matrix-synapse` · `minecraft-router` · `minecraft-server` · `outline` · `paperless-ngx` · `patchmon` · `rallly` · `rss-bridge` · `samba` · `satisfactory` · `searxng` · `stalwart` · `sure` · `teamspeak-server` · `urlaubsverwaltung` · `valkey` · `voucher-vault` · `ytdlp-web-player` · `zipline`
One **major** each. `ci/run-networkpolicy-test.sh`: **30 charts, 206 assertions held, 0 failed.**
### The charts worth reviewing first, because they decided things
| Chart | Why |
| --- | --- |
| **`keycloak`** | **the largest blast radius in the PR.** Its three ports are three different classes, and its `http` rule is the *only* genuinely source-restricted inbound rule in the sweep — possible only because the probes use the management port. If the ingress-controller source is wrong, every login in the cluster stops, and **nothing in CI can see it**: no controller runs there and the probes use 9000, so the pod goes `Ready` either way. Port numbers and the database port are derived from `keycloak.settings`. |
| **`homeassistant`**, **`satisfactory`** | `policyTypes: [Ingress]`, no egress section. Each argues it in its own file. `satisfactory`'s deciding half: it is the one chart with **no install-test at all**, so an egress cap there would be the only one in the sweep with no empirical check behind it, on the chart whose correct port set (Steam's CDN) is least knowable. |
| **`minecraft-server`** | the **tightest** policy here, and the reason generalises: all three probes are `exec` probes, so no port has to stay open for the kubelet and no `probeSources` value exists. Its game port has two branches rendered from the same value the Service reads. |
| **`gotenberg`** | keeps a DNS-only cap **on purpose** (headless Chromium on a port the whole cluster can reach = SSRF pivot), with `networkPolicy.egress.remoteAssets` as a **named switch, off by default**, for releases that need remote images. Measured: paperless sends the `.eml` to **Tika** and the resulting HTML **here**, so *embedded* images are MIME parts needing no network (Tika stays DNS-only) while *remote* ones are fetched by Chromium and silently dropped with the switch off. |
| **`bulwark`** | the quietest failure in the PR: its probes test its own port, so a `jmapServerUrl` on a port the policy blocks yields a `Ready` pod serving an empty webmail. |
| **`matrix-synapse`** | two policies, one per workload. Synapse federates; the delegation nginx returns a constant. One policy would have to permit the union. |
| **`samba`**, **`satisfactory`**, **`teamspeak-server`** | ship **fewer** values than the convention names, deliberately — see below. |
| **`valkey`**, **`stalwart`** | pulled onto the convention with **no rule changed**. `stalwart` gains `ingressController` and a **correction**: it advised `allowedNamespaces: ["ingress-nginx"]`, and both halves of that are wrong. |
### Keycloak's blast radius, measured
The `keycloak` row above is the largest risk in this PR, and it is now **smaller than it first read**. Every readable in-cluster consumer addresses Keycloak by its **public** name, so its traffic arrives from Traefik and is permitted by the rule exactly as shipped:
| Consumer | Value |
| --- | --- |
| `bulwark` | `OAUTH_ISSUER_URL = https://id.mail.bekemeyer-klein.de/realms/mail` |
| `homarr` | `AUTH_OIDC_ISSUER = https://bk.id.bekemeyer-klein.de/realms/bekemeyer-klein` |
| `paperless-{jk,cmk,ngx}` | through their `PAPERLESS_SOCIALACCOUNT_PROVIDERS` block |
A search across pod environments and ConfigMaps for the in-cluster Service name (`keycloak-keycloak-service`, `*.keycloak.svc`) returned **only Keycloak's own pods**, reaching `keycloak-pg-rw.jlab-pg.svc.cluster.local:5432` — which incidentally confirms the egress rule derived from `keycloak.db.port` is right for the live release.
**The login test after the upgrade stays the acceptance criterion**, because a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed is that there is now a *measured* reason to expect it to pass.
### Three things the checks caught while this was written
- **`minecraft-server`'s RCON rule named a port the pod does not declare** — the `containerPort` is gated on `server.rcon.enabled` and the rule was not. Assertion 2 rejected it.
- **`samba` and `satisfactory` would have shipped values that reach no rule.** Every one of their inbound rules is open to any source, so `allowedNamespaces` and `probeSources` did nothing. A value that silently does nothing is worse than one that is absent, because it reads as a control — both are gone from those charts and their schemas, with the reason in `values.yaml`.
- **The `probeSources` assertion was a substring test**, so a chart whose key had been *deleted* while the comment above it still discussed the value passed. Found by running the fail path; it now looks for the key.
- **`gotenberg`'s new `NOTES.txt` branch read `.Values.networkPolicy.egress.remoteAssets` directly**, which fails the whole render with `nil pointer evaluating interface {}.remoteAssets` when an operator erases the `egress` block — the schema permits `null` there, and issue #99's rule is that an erased block means *the default applies*, not a broken render. Null-safe now, and an erased block falls back to DNS-only, which is the restrictive direction.
## Docs
`README.md` (style guideline §15 + the CI section) and `CLAUDE.md` (the binding compact summary). Wiki, pushed as `8198027`: `Chart-Style-Guide` §15, `CI-CD` §8 (later jobs renumbered), `Charts`, **all 29 chart pages plus `template-chart`**, and four `Lessons-Learned` entries — the net that existed for a different failure than the one it was built for; a template comment that could not describe its own syntax; three values that reached no rule; and the subchart whose comments the parent could not fix.
Fixes #5
The reference implementation for Gitea #5: one NetworkPolicy per workload,
networkPolicy.enabled defaulting to true, plus the values block, the schema
entry and the NOTES.txt section that go with it.
The shape is taken from the two charts that already had one - valkey and
stalwart - rather than invented, because they carry the expensive lessons:
policyTypes only where there is something to restrict, namespaces always
spelled out because an empty "from" allows everything, kubernetes.io/metadata.name
so no foreign namespace needs labelling, POD ports and never NodePorts, egress
by port because the object cannot express a hostname, and the probe path left
open by default because the kubelet probes from the node's own IP.
Three things are written down rather than assumed. The ingress source is
measured on the cluster and is NOT what the issue body assumes: ingress-nginx
is gone, the only IngressClass is traefik, and the controller is the DaemonSet
rke2-traefik in kube-system - which also serves the Gateway API here, so one
source covers both the Ingress and the HTTPRoute path. Egress stays coarse:
with Canal (Flannel plus Calico) there is no FQDN rule, and Calico's
GlobalNetworkSet would bind every chart to Calico, the same argument that kept
implementation-specific objects out of #114. And a policy is only a boundary
where the CNI enforces one - unenforced, it is accepted and filters nothing.
All reasoning sits in Go template comments, not in "#" comments: those are part
of the rendered object and travel into the cluster. Writing this header also
found the second-order trap, which is now in the header itself - prose inside a
template comment must not spell out the comment's own closing delimiter, or the
parser ends the comment early and the remaining prose is emitted as manifest
content.
Part of #5
The part that carries the rollout of Gitea #5. 29 charts get a policy that is
on by default, and every way one of them can be wrong is SILENT: the API server
accepts a policy that filters nothing just as readily as one that filters
everything, and neither is a render error, so neither the build nor a rollout
sees it.
ci/run-networkpolicy-test.sh holds every rendered NetworkPolicy against the pod
specs, probes and Services of the SAME render:
1. the podSelector really matches a pod of that render - otherwise the object
sits in the namespace, is listed by kubectl, reads as a boundary and
filters nothing, usually because a label was renamed in another file;
2. every INGRESS port is a containerPort of the selected pods, which catches
the NodePort mistake mechanically. Egress ports are deliberately excluded:
an egress port belongs to the DESTINATION, and comparing it would fail
every chart that reaches a database;
3. no ingress rule allows every source by accident. "from: []" always fails -
it allows everything while reading as a restriction. A MISSING "from" is
the documented open form and is accepted only where the render justifies
it: every port of the rule is addressed by a network probe, or published by
a NodePort Service. That is stricter than the plan's wording, which banned
both forms, and it had to be, because the precedents use the second one on
purpose;
4. the probe path. For every port a NETWORK probe addresses, the policy either
leaves it unrestricted or the chart offers networkPolicy.probeSources AND
says in NOTES.txt that a list missing the node's IP leaves the pod
permanently un-Ready. exec probes are excluded by design - they run inside
the container and put no packet on the network, which is exactly why
valkey and minecraft-server can restrict their port by source with no
probeSources at all.
Two guards beyond the four: a chart that renders NO policy fails, because that
is how this issue decayed in the first place - garage and keycloak were both
created after #5 and both arrived without one. And a "#" comment inside a
rendered policy fails, because it is part of the object and is shipped to the
cluster.
Helm is the parser through ci/yaml2json, as in the other render tests: the
runners have neither pyyaml nor yq, and a hand-written parser could read
nothing, find nothing and leave this green over a chart it never looked at.
Every failure path was run, not just the green ones, and one of them earned its
keep immediately: the probeSources check was a substring test, so a chart whose
key had been deleted while the comment above it still discussed the value
passed. It now looks for the key.
Part of #5
Major, as every chart in this rollout is: networkPolicy.enabled defaults to
true, so the object reaches running releases on the next upgrade.
The simplest policy of the sweep, and the one to read first. CyberChef is a
static web app - nginx serves files, the recipes run in the visitor's browser,
the pod holds no state and calls nothing - so what the policy buys is the two
CEILINGS rather than any source restriction: inbound is capped at 8080, the
single port the pod declares, and outbound at DNS, which is as tight as the
object goes without breaking name resolution.
The 8080 rule carries no source selector by default, and that is deliberate
rather than an oversight: 8080 is the port all three probes address, and the
kubelet probes from the IP of the worker node running the pod, which no chart
can know. Guessing it wrong leaves the pod permanently un-Ready, a symptom that
reads as a broken application. Narrowing it is networkPolicy.probeSources, and
the restricted branch then also carries the ingress controller - measured as
the rke2-traefik DaemonSet in kube-system, which serves this chart's HTTPRoute
as well, since the same Traefik backs the Gateway API here.
Part of #5
The scope of Gitea #5 - 29 charts at once, default on - rests on the claim that
the install-test enforces policies, so a policy that blocks the probe path goes
red in CI rather than silently in production. k3d is created without
--disable-network-policy, but a flag read off a workflow file is not evidence.
This commit restricts cyberchef's probe port 8080 to 192.0.2.11/32, an RFC 5737
documentation address that cannot be the k3d node's IP. The kubelet probes from
the node's own address, so they are dropped and the pod must never become Ready.
Expected: the cyberchef install-test goes RED on rollout status. If it goes
green, policies are not enforced in CI and the scope has to be renegotiated.
Reverted in the next commit either way.
Part of #5
Major, as every chart in this rollout is.
Inbound 3000 only; outbound DNS plus 5432, 6379 and 443. Those three egress
ports are the STANDARD ones and not the configured ones, which is this chart's
real limitation and is written into values.yaml, the template header and
NOTES.txt rather than left to be discovered: Outline's database, Redis and OIDC
provider all arrive as connection URLs inside 1Password items that the chart
never parses, so it cannot know where they listen and cannot validate a guess.
A dependency on another port is blocked, and because all three probes hit
/_health - which checks Postgres and Redis - the symptom is a pod that never
becomes Ready rather than an error anyone reads. networkPolicy.egress.extraPorts
is the escape hatch.
That same property is what makes this chart the right place for the enforcement
experiment in the next commit.
Also reverts the cyberchef fixture from the first experiment: with the probe
port restricted to an address that is not the node's, the install-test went
GREEN, so the claim that it catches a blocked probe path does not hold as
written. The next commit establishes whether policies are enforced in CI at
all.
Part of #5
The first experiment did not settle it. Restricting cyberchef's probe port 8080
to 192.0.2.11/32 - an address that cannot be the k3d node's - left the
install-test GREEN, which has two very different causes: either k3s' policy
controller exempts the kubelet's probe traffic (good news for this convention,
whose default leaves the probe port open anyway), or it enforces nothing at all
(no net under this rollout).
This separates them without touching a probe. Outline's egress rule for DNS is
removed, so the pod cannot resolve "postgres" or "redis" - and all three of
its probes hit /_health, which checks both stores.
Expected: RED, which proves egress is enforced. Green means nothing is enforced
in CI and the scope has to be renegotiated.
Reverted in the next commit either way.
Part of #5
Both experiments are in, and together they answer the question the scope of
#5 rests on - with an answer that is not the one the plan assumed.
MEASURED, run 888 on this branch:
Install-test cyberchef SUCCESS, 1m9s probe port 8080 restricted to
192.0.2.11/32, which cannot be the
k3d node's address
Install-test outline FAILURE, 5m59s DNS egress rule removed, so
"postgres" and "redis" do not
resolve and /_health cannot pass
So: POLICIES ARE ENFORCED in the install-test - outline's pod never became
Ready and rollout status timed out after six minutes, which is the net this
rollout needs. But THE KUBELET'S PROBE TRAFFIC IS EXEMPT from policy in k3s:
cyberchef became Ready in 69 seconds with its probe port restricted to an
address no probe can come from.
What that changes, and what it does not:
- The plan's claim was "a policy that blocks the probe path makes the
install-test red". That is NOT true here, and it is now measured rather
than assumed. The install-test's net is for EGRESS and for anything the
application itself needs, not for the probe path.
- It does not undermine the rollout, because this convention never restricts
a probe port by default - the rule is rendered without a "from" until an
operator sets probeSources. The trap CI cannot see is therefore not
triggered by this PR; it is triggered by a deliberate narrowing, which is
what the NOTES.txt sentence and ci/run-networkpolicy-test.sh's fourth
assertion exist for.
- It raises the stakes for the render assertions. A wrong ingress port - the
NodePort mistake above all - would leave the pod Ready in CI (probes exempt)
and no ingress controller runs there either, so nothing in the pipeline
would notice. That failure is caught mechanically by assertion 2 or not at
all.
- And it says nothing about the production cluster, whose CNI is Calico, not
k3s'. There, probe traffic is subject to policy, which is exactly why the
default stays open.
Part of #5
The enforcement proof: measured, and the answer is not the one the plan assumed
Two experiments on this branch, run 888. Both are reverted; the commits are kept for the record (d3ef372, 813c923, de995d0).
Leg
Result
What was changed
Install-test cyberchef
SUCCESS, 1m9s
probe port 8080 restricted to 192.0.2.11/32 — an RFC 5737 documentation address that cannot be the k3d node
Install-test outline
FAILURE, 5m59s
the DNS egress rule removed, so postgres and redis do not resolve and /_health cannot pass
Policies ARE enforced in the install-test. Outline never became Ready and rollout status timed out after six minutes. That is the net this rollout needs, and it exists.
But the kubelet probe traffic is EXEMPT from policy in k3s. CyberChef became Ready in 69 seconds with its probe port restricted to an address no probe can originate from. So the specific claim in the plan — "eine Policy, die den Probe-Pfad blockiert, sollte den Pod nie Ready werden lassen und den Install-Test rot machen" — does not hold here. It is now measured instead of assumed.
Why I kept going rather than stopping
The net holds for the failures this rollout can actually produce, and the one it misses is not reachable from the defaults:
The convention never restricts a probe port by default. The rule is rendered with no from until an operator sets probeSources, so the trap CI cannot see is not triggered by this PR — only by a deliberate narrowing, which is exactly what the NOTES.txt sentence and the fourth CI assertion are for.
The upgrade risk that CI now provably catches is the egress cap, which is the risk these charts actually carry: dependency ports that live inside 1Password connection URLs the chart never parses. Outline is the proof.
It raises the stakes for the render assertions, and that is worth naming: a wrong ingress port — the NodePort mistake above all — would leave the pod Ready in CI (probes exempt) and no ingress controller runs there either, so nothing in the pipeline would see it. That failure is caught by assertion 2 or not at all.
It says nothing about production, whose CNI is Calico rather than k3s'. There probe traffic is subject to policy — which is precisely why the default stays open.
If you read the trade differently, this is the point to say so: the scope question is still open until the chart commits land, and I will rework rather than argue.
## The enforcement proof: measured, and the answer is not the one the plan assumed
Two experiments on this branch, run 888. Both are reverted; the commits are kept for the record (`d3ef372`, `813c923`, `de995d0`).
| Leg | Result | What was changed |
| --- | --- | --- |
| `Install-test cyberchef` | **SUCCESS, 1m9s** | probe port 8080 restricted to `192.0.2.11/32` — an RFC 5737 documentation address that cannot be the k3d node |
| `Install-test outline` | **FAILURE, 5m59s** | the DNS egress rule removed, so `postgres` and `redis` do not resolve and `/_health` cannot pass |
**Policies ARE enforced in the install-test.** Outline never became Ready and `rollout status` timed out after six minutes. That is the net this rollout needs, and it exists.
**But the kubelet probe traffic is EXEMPT from policy in k3s.** CyberChef became Ready in 69 seconds with its probe port restricted to an address no probe can originate from. So the specific claim in the plan — *"eine Policy, die den Probe-Pfad blockiert, sollte den Pod nie Ready werden lassen und den Install-Test rot machen"* — does **not** hold here. It is now measured instead of assumed.
### Why I kept going rather than stopping
The net holds for the failures this rollout can actually produce, and the one it misses is not reachable from the defaults:
1. **The convention never restricts a probe port by default.** The rule is rendered with no `from` until an operator sets `probeSources`, so the trap CI cannot see is not triggered by this PR — only by a deliberate narrowing, which is exactly what the `NOTES.txt` sentence and the fourth CI assertion are for.
2. **The upgrade risk that CI now provably catches is the egress cap**, which is the risk these charts actually carry: dependency ports that live inside 1Password connection URLs the chart never parses. Outline is the proof.
3. **It raises the stakes for the render assertions**, and that is worth naming: a wrong ingress port — the NodePort mistake above all — would leave the pod Ready in CI (probes exempt) and no ingress controller runs there either, so *nothing* in the pipeline would see it. That failure is caught by assertion 2 or not at all.
4. **It says nothing about production**, whose CNI is Calico rather than k3s'. There probe traffic *is* subject to policy — which is precisely why the default stays open.
If you read the trade differently, this is the point to say so: the scope question is still open until the chart commits land, and I will rework rather than argue.
bentopdf, apache-tika, gotenberg, rss-bridge, searxng, ytdlp-web-player. One
major each, networkPolicy.enabled defaults to true.
Three of them differ from the simple case in ways worth naming:
GOTENBERG gets DNS-only egress as a deliberate, documented trade. It drives a
headless Chromium, and 3000 is its probe port - so it is reachable from the
whole cluster by default, and an egress rule for 80/443 would turn a service
anyone can POST to into a way of fetching arbitrary URLs. The price is the
remote-asset half of HTML conversion: inline content converts, images the page
would have fetched silently do not. That degrades a PDF instead of failing a
pod, so nothing alerts on it, which is why it is in the template header, in
values.yaml and in NOTES.txt, with extraPorts: [80, 443] named as the knowing
opt-in.
RSS-BRIDGE, SEARXNG and YTDLP-WEB-PLAYER get the open internet on their web
ports, because reaching other people's servers IS the application and this
object cannot name a host. Said plainly in each, so none of them reads
stricter than it is. What the cap still buys is real: no other outbound port,
so a compromised pod reaches no database, no mail server and no SSH anywhere.
APACHE-TIKA and GOTENBERG render no Ingress - their consumers are other pods,
in other namespaces here - so neither gets an ingressController value and both
say in NOTES.txt that narrowing probeSources means listing the consumers'
namespaces in allowedNamespaces in the same change, or extraction and
conversion stop.
YTDLP-WEB-PLAYER names the gap this convention has: its oauth2-proxy subchart
renders its own Deployment with its own labels and ships no policy, so with the
proxy enabled the pod that actually faces the Ingress is unrestricted in both
directions. Nothing in this chart can change that - an upstream chart is
consumed as it comes - so it is written down instead.
ci/outline/test-values.yaml gains egress.extraPorts: [5556]. The CI dex runs
there rather than on 443, and Outline fetches the discovery document at boot -
so this is the chart's documented escape hatch used for exactly the case it was
written for, and the one place in the repo where the cap's upgrade risk is
actually exercised.
Part of #5
The previous commit appended the networkPolicy block in the middle of the
secrets: mapping, so dbSecretRef was absorbed into it. The chart's own
values.schema.json caught it immediately - "at '/networkPolicy': additional
properties 'dbSecretRef' not allowed" - which is exactly what issue #68 built
that schema for: a key the chart does not read is a named error at render time
instead of a silently missing secret.
Part of #5
bulwark, calibre-web-automated, patchmon, rallly, urlaubsverwaltung,
voucher-vault, zipline, sure, homeassistant. One major each.
These are the charts with real outbound dependencies, and they all share one
limitation that is now written into every one of them: THE EGRESS PORTS ARE THE
STANDARD ONES, NOT THE CONFIGURED ONES. Databases, caches and OIDC issuers
arrive as connection URLs or as fields inside 1Password items that the charts
never parse, so a chart cannot know where its dependency listens and cannot
validate a guess. A dependency somewhere else is blocked, and
networkPolicy.egress.extraPorts is the escape hatch. That is the upgrade risk
of this rollout, stated per chart instead of discovered per release.
Four of them differ in ways that mattered:
HOMEASSISTANT gets policyTypes: [Ingress] and NO egress section at all, and
that is the decision in the file rather than an omission. Its outbound traffic
is the union of every integration an operator enables - mDNS and SSDP
discovery, MQTT, a Zigbee or Z-Wave bridge on whatever port its firmware chose,
ESPHome, printers, speakers, inverters, cloud APIs, NTP - which no chart can
know. A cap would protect little, since the devices sit on the node's own LAN,
and would break integrations one at a time, months apart, each looking like a
flaky device rather than like a policy. So valkey's rule applies in the other
direction: policyTypes names only what there is something to restrict.
URLAUBSVERWALTUNG allows BOTH 5432 and 3306, deliberately. It is handed a full
JDBC URL inside a 1Password item and never parses it, so it cannot tell
PostgreSQL from MariaDB - and this cluster runs both. Allowing one would break
half the possible deployments on upgrade, with the symptom buried in a Java
stack trace. A small widening against a large and silent failure.
RALLLY derives its SMTP rule from rallly.smtp.enabled rather than always
rendering it: with mail switched off there is nothing to permit, and a rule
that permits nothing makes the object look stricter than it is.
BULWARK is the chart where the cap can fail most quietly. Its probes test its
own port and say nothing about the JMAP server, so a jmapServerUrl on a port
the policy does not allow yields a Ready pod serving an empty webmail. 443 is
allowed, Stalwart's in-cluster 8080 is not, and both halves of that are in
values.yaml and NOTES.txt.
PATCHMON and HOMEASSISTANT select their pods by the BARE release-and-chart
label, with no -deployment or -sfs suffix. Copying a selector from a
neighbouring chart would have matched nothing and left a policy that filters
nothing - which is precisely the first assertion of the render test.
Five CI fixtures gain networkPolicy.egress.extraPorts, and they are the only
place in the repository where the cap's cost is actually exercised: the CI dex
runs on 5556 rather than 443 (patchmon, rallly, urlaubsverwaltung,
voucher-vault) and the CI JMAP server on plain 8080 (bulwark).
Part of #5
Major. This is the richest policy of the sweep and the one with the largest
blast radius, and it is the only chart whose three ports fall into three
different classes - so it is where the convention is visible in full:
http (8080) NOT addressed by any probe, so it CAN be restricted by
source, and it is: own namespace, allowedNamespaces, and
the ingress controller. The only real inbound restriction
in this whole rollout, possible only because the probes use
a different port.
management (9000) the port all three probes address, so it stays open inside
the cluster. That matters here specifically: this surface
carries health and metrics UNAUTHENTICATED, and "no
Ingress" was its only protection before this object. The
policy turns "anything that can route to the pod" into
"anything inside the cluster"; probeSources closes the rest.
jgroups (7800) the cluster bus, restricted to the pods this policy itself
selects - a podSelector with no namespaceSelector, the
narrowest rule the object can express.
All four port numbers come from keycloak.settings rather than being written
down twice, so moving keycloak.ports.http moves the policy with it. And the
egress rule for the database is the CONFIGURED port, keycloak.db.port - this is
the one chart in the sweep that does not have to guess, because its database
port is a value instead of a field inside an opaque secret.
The outbound cluster-bus rule is not a duplicate of the inbound one: policyTypes
lists Egress, so a replica dialling its peer is subject to this policy too, and
without it the bus would be open inbound and blocked outbound - a cluster that
never forms, with two nodes that each look healthy.
THE BLAST RADIUS IS WRITTEN INTO THE CHART, because nothing in CI can catch it:
this release is the cluster's identity provider, no ingress controller runs in
the install-test, and the probes use 9000 - so the pod becomes Ready whether or
not the http rule is right. NOTES.txt therefore asks for two checks after the
first upgrade: log in, and look at whether any consumer uses the in-cluster
Service address instead of the public issuer URL (those namespaces need
allowedNamespaces). Not allowed at all, and named as the likely first surprise:
SMTP, because the mail server is configured per realm where the chart cannot
see it.
The test's overlay guard is tightened in the same commit, and keycloak is why.
It counted any source-restricted rule, and this chart restricts two of them in
its own defaults - so the guard would have been satisfied while the probe
branch, the only branch an overlay exists to reach, was never rendered. It now
counts restricted PROBE rules. All twelve failure paths were re-run against the
change.
Part of #5
garage, minecraft-router, minecraft-server, samba, teamspeak-server,
satisfactory. One major each. These are the charts the plan said to leave for
last, and they earned it - three of them changed the convention rather than
just consuming it.
GARAGE is the clearest illustration after keycloak. Its four ports split three
ways: s3 and web are RESTRICTED by source (no probe touches them), admin is the
probe path and stays open inside the cluster - which is uncomfortable, because
admin is also the admin API, and that is said out loud instead of glossed - and
rpc gets the narrowest rule the object can express, a podSelector with no
namespaceSelector. All four numbers come from garage.settings.
MINECRAFT-SERVER is the tightest policy in the repository, and the reason is
worth knowing: all three of its probes are EXEC probes, which put no packet on
the network, so no port has to stay open for the kubelet and no probeSources
value is needed at all. RCON and metrics are restricted outright. The game port
has two branches rendered from the same value the Service reads -
server.service.type NodePort means players arrive from the internet and the
rule must be open; anything else means the only path is in-cluster, so the rule
is restricted and the router's namespace has to be in allowedNamespaces.
MINECRAFT-ROUTER derives its egress from the routing table instead of guessing:
server.backendPort plus the "port" override of every mapping that sets one. Add
a backend on a non-standard port and the policy follows. What it cannot express
is the destination - mappings name hosts, and this object matches no hostname -
so the rule is wider than the routing table, and that is written down.
SATISFACTORY gets policyTypes: [Ingress] and no egress section, and the second
half of the reason is the deciding one. Steam's content delivery is not a
pinnable port set (SteamCMD over TCP 80/443/27015-27050, master servers over
UDP 27000-27100 and 4380, changed by Valve, re-downloaded on every update) -
and this is the ONE chart with no install-test at all, because the image is
multiple GB and the first start pulls over 10GB. An egress cap here would be
the only one in the sweep with no empirical check behind it, on the chart whose
correct port set is least knowable.
SAMBA and TEAMSPEAK-SERVER carry the NodePort lesson explicitly: the rules name
445/139 and the pod's voice and file-transfer ports, never the NodePorts, and
teamspeak's file is explicit that its pod port and NodePort happening to share a
number is a coincidence of its values rather than a pattern to copy. Teamspeak's
voice rule is UDP, and the file says why that matters: a TCP rule on the same
number is accepted, looks complete, and drops every voice packet.
THREE THINGS THE CHECKS CAUGHT WHILE THIS BATCH WAS WRITTEN, all of them real:
- minecraft-server's RCON rule named a port the pod does not declare. The
containerPort is gated on server.rcon.enabled and the rule was not, so
assertion 2 rejected it. The rule now carries the same gate.
- samba and satisfactory would have shipped allowedNamespaces and
probeSources values that reach NO rule - every one of their inbound rules
is open to any source. A value that silently does nothing is worse than one
that is absent, because it reads as a control, so both are gone from those
two charts and from their schemas, with the reason in values.yaml.
teamspeak-server loses probeSources for the same reason and keeps
allowedNamespaces, which its web-query rule uses.
- the policy templates no longer declare template variables they do not use.
samba keeps one, satisfactory none.
Part of #5
matrix-synapse, paperless-ngx, freesailarr, valkey, stalwart. One major each.
All 29 installable charts plus template-chart now render a policy, and
ci/run-networkpolicy-test.sh passes over all 30 with 206 assertions held.
MATRIX-SYNAPSE renders TWO policies, one per workload, and the split is the
decision in that file. Synapse federates - it must be able to reach any
homeserver on the internet, so 443 and 8448 go to any destination - while the
delegation nginx serves two static JSON documents and calls nobody, so its
egress is DNS and nothing else. A single policy over both pods would have to
permit the union, handing full federation reach and the database port to an
nginx whose job is to return a constant, and it would read as one decision
rather than as a widening. networkPolicy.egress.extraPorts deliberately does
not reach the delegation policy for the same reason.
PAPERLESS-NGX names the two pods of its own release that this object does NOT
cover: the valkey subchart's pod, which carries its own labels and needs no
cover because the valkey chart ships a tighter policy of its own; and the
consume CronJob's pods, whose pod template carries NO LABELS AT ALL, so no
podSelector can match them. That second one is a real gap in the convention. It
is tolerable only because the job moves files between mounted volumes and
reaches the SMB share through a CSI volume the node mounts - the pod opens no
connection of its own - and if that ever changes the CronJob needs labels
before it can need a policy.
FREESAILARR is ten containers in one pod behind a VPN, and simpler than that
sounds: they share a network namespace, so all inter-container traffic is
localhost and no policy sees any of it. Because the namespace belongs to
gluetun, everything the *arr containers send is encapsulated before it leaves,
so three rules describe the whole outbound surface - DNS, UDP 51820 for the
tunnel, and 443 for gluetun's server-list API, which cannot go through the
tunnel because it runs before the tunnel exists. The tunnel rule is the one
that can break this chart and also the best covered: gluetun's health server
answers 200 only while the tunnel is up and all three of its probes address it,
so a blocked 51820 is a pod that never goes Ready - in the install-test, which
brings up a real tunnel.
VALKEY AND STALWART, the two charts that had a policy before this issue, are
pulled onto the convention without a single rule changing. What changed:
- the reasoning moved out of "#" comments, which are part of the rendered
object and travel into the cluster, into template comments. Both files
failed the new check; that is what it is for.
- stalwart gains networkPolicy.ingressController, which fixes a hole its own
comment described without being able to solve: it advised putting the
controller's namespace into allowedNamespaces, which is namespace-granular
and would have opened the http port to every pod in kube-system.
- stalwart's example was WRONG and is corrected. It suggested
["ingress-nginx"]; measured on 2026-10-14, ingress-nginx is gone from this
cluster entirely and the controller is rke2-traefik in kube-system. A policy
written against the old one would have been accepted, looked strict, and
silently blocked all web traffic.
Their justified specifics are untouched: valkey stays Ingress-only, because it
opens no outbound connection and an egress rule would constrain nothing while
making the object look stricter; and it keeps 6379 restricted by source with no
probeSources at all, which is safe only because all three of its probes are
exec probes and put no packet on the network. The convention was written to
accommodate both, and homeassistant and satisfactory now invoke valkey's rule
in the other direction.
ONE CHANGE TO THE TEST, forced by a structural fact rather than by convenience:
the rendered-comment assertion now skips documents from a SUBCHART. A
dependency is fetched from the Helm registry, not from the copy in this
repository, so the policy paperless-ngx and stalwart bundle is whatever valkey
version is PUBLISHED - and nothing in the parent chart can change its rendered
comments. Holding the parent responsible would have made the test unfixable
until valkey's next release and would fail a chart for a file its own diff does
not contain. The subchart's own pull request is where it is caught, because this
test runs over every chart including valkey itself. All twelve failure paths
were re-run against the change.
Part of #5
README gains two sections and CLAUDE.md the binding compact summary.
"NetworkPolicies (#5)" under Chart style guidelines carries the part that is
actually hard to get right: the FOUR PORT CLASSES, and that the class decides
the rule. A port a network probe addresses stays open until probeSources is
set, because the kubelet probes from the worker node's IP and no chart can know
it. A NodePort-published port stays open because the source is already
masqueraded. Everything else can be - and is - restricted by source, which is
why the charts with a real inbound restriction are exactly the ones whose
probes use a different port: keycloak's 8080, garage's s3 and web,
minecraft-server's RCON, teamspeak-server's query interface. And a cluster bus
between a release's own replicas gets a bare podSelector, with the reminder
that policyTypes Egress means the outbound side needs its own rule or the
cluster never forms while every node looks healthy.
The exec-probe distinction is written down as load-bearing rather than
pedantic, because it is the whole reason valkey and minecraft-server are the
tightest policies here and every HTTP-probed web app is looser.
What the policies do NOT do has its own list, including the two that will
surprise someone: most dependency ports are the STANDARD ones rather than the
configured ones, because connection details live in 1Password items the charts
never parse - with keycloak, stalwart and minecraft-router named as the
exceptions that derive theirs from values; and a subchart's pods are not
covered, with ytdlp-web-player's oauth2-proxy as the sharp case and
paperless-ngx' valkey as the opposite.
The three Ingress-only charts are listed with their individual arguments rather
than a blanket excuse, and gotenberg is contrasted against them: it keeps a
DNS-only cap on purpose, because it drives a headless Chromium on a port the
whole cluster can reach.
"NetworkPolicy render test" under CI/CD documents the gate, and ends with what
the pipeline cannot prove - including the measurement from this PR that k3s
exempts kubelet probe traffic from policy, so the install-test's net is an
EGRESS net. That is stated there rather than implied, because it is the reason
assertion 2 matters: a wrong ingress port is caught mechanically or not at all.
Part of #5
Release-side actions this PR creates — measured against the live cluster
I have not touched jk-cluster-config and opened no PR there, as instructed. This is the list of what the merge will need on the release side, separated into what I could verify and what only you can.
Verified against the live cluster — the egress guesses are right
The convention's weakest point is that most egress ports are the standard ones rather than the configured ones. For this cluster they match:
Dependency
Service port
My egress rule
postgres-18-postgresql
5432
5432 ✅
maria-db-mariadb
3306
3306 ✅ (and urlaubsverwaltung allows both)
every *-valkey-service (6 of them)
6379
6379 ✅
Keycloak as OIDC
reached on 443 through Traefik
443 ✅
Tika / Gotenberg Services
80
paperless-ngx allows 80 ✅
So no existing release should lose its database, cache or OIDC on upgrade. No ServiceMonitor or PodMonitor exists in the cluster, so the restricted metrics ports (minecraft-server 19565) break no scrape.
Needs a values change at release level — measured, not guessed
All four Minecraft servers run a ClusterIP Service, which means the restricted branch of minecraft-server's game-port rule applies to every one of them:
Players reach them through minecraft-router, which runs in the mc-router namespace. So each of those four releases needs:
networkPolicy:allowedNamespaces:["mc-router"]
Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. This is the single most likely outage from this PR, and it is four one-line values changes.
Needs checking by you — I cannot read the values that decide it
garage — its s3 rule is restricted by source, and stalwart has STALWART_S3_ACCESS_KEY/SECRET_KEY wired, so it is using an S3 store. If that store is garage's in-cluster address, garage needs allowedNamespaces: ["stalwart"]. I cannot tell: Stalwart's blob store is an object in its database, created in the WebUI, so the host appears in no chart value and no readable object. Any other S3 consumer in another namespace needs the same.
keycloak — the http rule is the only source-restricted inbound rule in the PR and this release is the cluster's identity provider. Consumers using the public issuer URL come through Traefik and are covered; one using the in-cluster Service address (keycloak-keycloak-service:8080) is a pod in another namespace and is blocked. The discovery URLs live in 1Password items, so I cannot check them. Verify with a real login, not with kubectl — and note that CI cannot catch this at all: no controller runs there and the probes use port 9000, so the pod goes Ready either way.
bulwark — 443 is allowed, Stalwart's in-cluster 8080 is not. If bulwark.jmapServerUrl points at the in-cluster Service, it needs egress.extraPorts: [8080]. The failure is quiet: the probes test bulwark's own port, so the pod comes up Ready and serves an empty webmail.
paperless-ngx — if any release fetches mail, it needs IMAP (993, or 143) in egress.extraPorts. The mail accounts are rows in its database, so no chart value shows them.
keycloak again — SMTP is not allowed. If a realm sends verification or password-reset mail, it needs egress.extraPorts: [587] (or 465).
Not affected
apache-tika and gotenberg keep working untouched: their ports are the probed ones, so the rules stay open by default and the four paperless-* namespaces reach them as before. An action is only needed there if someone sets probeSources.
## Release-side actions this PR creates — measured against the live cluster
I have not touched `jk-cluster-config` and opened no PR there, as instructed. This is the list of what the merge will need on the release side, separated into what I could **verify** and what only you can.
### Verified against the live cluster — the egress guesses are right
The convention's weakest point is that most egress ports are the *standard* ones rather than the configured ones. For this cluster they match:
| Dependency | Service port | My egress rule |
| --- | --- | --- |
| `postgres-18-postgresql` | **5432** | 5432 ✅ |
| `maria-db-mariadb` | **3306** | 3306 ✅ (and `urlaubsverwaltung` allows both) |
| every `*-valkey-service` (6 of them) | **6379** | 6379 ✅ |
| Keycloak as OIDC | reached on **443** through Traefik | 443 ✅ |
| Tika / Gotenberg Services | **80** | `paperless-ngx` allows 80 ✅ |
So no existing release should lose its database, cache or OIDC on upgrade. **No ServiceMonitor or PodMonitor exists in the cluster**, so the restricted metrics ports (`minecraft-server` 19565) break no scrape.
### Needs a values change at release level — measured, not guessed
**All four Minecraft servers run a `ClusterIP` Service**, which means the *restricted* branch of `minecraft-server`'s game-port rule applies to every one of them:
```
mc-vanilla-server-minecraft-server-service ClusterIP 25565/TCP
mc-oceanblock-2-server-minecraft-server-service ClusterIP 25565/TCP
mc-ftb-skies-2-server-minecraft-server-service ClusterIP 25565/TCP
mc-sultan-saladin-server-minecraft-server-service ClusterIP 25565/TCP
```
Players reach them through `minecraft-router`, which runs in the **`mc-router`** namespace. So each of those four releases needs:
```yaml
networkPolicy:
allowedNamespaces: ["mc-router"]
```
Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. This is the single most likely outage from this PR, and it is four one-line values changes.
### Needs checking by you — I cannot read the values that decide it
- **`garage`** — its s3 rule is restricted by source, and `stalwart` has `STALWART_S3_ACCESS_KEY`/`SECRET_KEY` wired, so it is using an S3 store. If that store is garage's **in-cluster** address, garage needs `allowedNamespaces: ["stalwart"]`. I cannot tell: Stalwart's blob store is an object in its database, created in the WebUI, so the host appears in no chart value and no readable object. Any other S3 consumer in another namespace needs the same.
- **`keycloak`** — the `http` rule is the only source-restricted inbound rule in the PR and this release is the cluster's identity provider. Consumers using the **public issuer URL** come through Traefik and are covered; one using the **in-cluster Service address** (`keycloak-keycloak-service:8080`) is a pod in another namespace and is blocked. The discovery URLs live in 1Password items, so I cannot check them. **Verify with a real login**, not with `kubectl` — and note that CI cannot catch this at all: no controller runs there and the probes use port 9000, so the pod goes `Ready` either way.
- **`bulwark`** — 443 is allowed, Stalwart's in-cluster 8080 is not. If `bulwark.jmapServerUrl` points at the in-cluster Service, it needs `egress.extraPorts: [8080]`. The failure is quiet: the probes test bulwark's own port, so the pod comes up `Ready` and serves an empty webmail.
- **`paperless-ngx`** — if any release fetches mail, it needs IMAP (`993`, or `143`) in `egress.extraPorts`. The mail accounts are rows in its database, so no chart value shows them.
- **`keycloak`** again — SMTP is **not** allowed. If a realm sends verification or password-reset mail, it needs `egress.extraPorts: [587]` (or 465).
### Not affected
`apache-tika` and `gotenberg` keep working untouched: their ports are the probed ones, so the rules stay open by default and the four `paperless-*` namespaces reach them as before. An action is only needed there if someone sets `probeSources`.
Found by reviewing my own diff rather than by a failure, which is the only
reason it is worth a commit of its own.
minecraft-server's game-port rule has two branches read from the same value the
Service reads: OPEN when server.service.type is NodePort, RESTRICTED to the
namespace otherwise. All four releases in this cluster use ClusterIP and so
does the install-test fixture - so the OPEN branch was rendered nowhere at all.
Not by the chart defaults, not by the fixture, not by lint. It is also the
branch where naming server.service.outwardPort instead of server.port would be
the classic NodePort mistake, and assertion 2 can only see a rule it has been
given.
The overlay switches the Service to NodePort and RCON on, so both unreachable
branches are now rendered on every pull request. RCON is in there for a reason
too: its rule is gated on server.rcon.enabled exactly as the containerPort is,
that pairing was wrong once while this chart was being written, and switching
the feature on keeps the PAIR under test rather than just the gate.
The overlay guard had to be made conditional for this to be possible, and the
refinement is sound rather than a workaround. It demanded that any chart with
an overlay render a source-restricted PROBE rule - but minecraft-server has no
probe rule at all, because all three of its probes are exec probes, and it
therefore offers no probeSources. The guard now applies only to charts that
offer that value, so it still catches an overlay that stopped reaching the
restricted probe branch (template-chart, the case it was written for) without
rejecting an overlay that exists for a different unreachable branch.
All twelve failure paths re-run against the change; the suite is 30 charts, 208
assertions, 0 failed.
Part of #5
Install-test evidence: all 28 installable charts green with their policy active
Commit
Install-test legs
73c2ec7 (the final five charts)
25 success, 1 running
28a0230 (NodePort and game servers)
23 success
96c23b7 (keycloak)
18 success
e1adcef (nine charts with dependencies)
13 success
28 of 28 installable charts have passed at least once with the policy on, and no leg has failed on any commit of this branch. (satisfactory and template-chart have no install-test at all — ci/excluded-charts.txt.)
Five of those matter more than the rest, and all five are in 73c2ec7:
freesailarr — the install-test brings up a real WireGuard tunnel, and gluetun's health server answers 200 only while the tunnel is up. Its passing is the empirical check on the UDP 51820 egress rule, which is the one rule that can take the whole pod down.
matrix-synapse — both policies applied and both workloads became Ready.
paperless-ngx — installs alongside the valkey subchart's own policy.
stalwart and valkey — the two rewritten precedents, with no rule changed.
And the four charts whose CI fixtures sit on a non-standard dependency port are the ones that actually exercise the egress cap's cost: patchmon, rallly, urlaubsverwaltung and voucher-vault reach a CI dex on 5556 rather than 443, bulwark a JMAP server on plain 8080, and outline the same dex. Each needed networkPolicy.egress.extraPorts in its fixture — the chart's documented escape hatch, used for exactly the case values.yaml names. Remove any one of those entries and the install-test shows what the cap does to a dependency on an unexpected port.
The render test on the runner
Validate Helm Charts / NetworkPolicy — Successful in 13s, over all 30 charts. Locally: 30 charts, 208 assertions held, 0 failed, and all twelve failure paths produce their finding.
Note that the chart manifests at HEAD are byte-identical to 73c2ec7: the two commits after it changed only README.md/CLAUDE.md and ci/. So the install-test evidence above applies to the charts as they stand. HEAD's own run is still working through the queue — one runner, 28 legs per commit.
## Install-test evidence: all 28 installable charts green with their policy active
| Commit | Install-test legs |
| --- | --- |
| `73c2ec7` (the final five charts) | 25 success, 1 running |
| `28a0230` (NodePort and game servers) | 23 success |
| `96c23b7` (keycloak) | 18 success |
| `e1adcef` (nine charts with dependencies) | 13 success |
**28 of 28 installable charts have passed at least once with the policy on, and no leg has failed on any commit of this branch.** (`satisfactory` and `template-chart` have no install-test at all — `ci/excluded-charts.txt`.)
Five of those matter more than the rest, and all five are in `73c2ec7`:
- **`freesailarr`** — the install-test brings up a **real WireGuard tunnel**, and gluetun's health server answers 200 only while the tunnel is up. Its passing is the empirical check on the `UDP 51820` egress rule, which is the one rule that can take the whole pod down.
- **`matrix-synapse`** — both policies applied and both workloads became `Ready`.
- **`paperless-ngx`** — installs alongside the `valkey` subchart's own policy.
- **`stalwart`** and **`valkey`** — the two rewritten precedents, with no rule changed.
And the four charts whose CI fixtures sit on a **non-standard** dependency port are the ones that actually exercise the egress cap's cost: `patchmon`, `rallly`, `urlaubsverwaltung` and `voucher-vault` reach a CI dex on **5556** rather than 443, `bulwark` a JMAP server on plain **8080**, and `outline` the same dex. Each needed `networkPolicy.egress.extraPorts` in its fixture — the chart's documented escape hatch, used for exactly the case `values.yaml` names. Remove any one of those entries and the install-test shows what the cap does to a dependency on an unexpected port.
### The render test on the runner
`Validate Helm Charts / NetworkPolicy` — **Successful in 13s**, over all 30 charts. Locally: **30 charts, 208 assertions held, 0 failed**, and all **twelve** failure paths produce their finding.
Note that the chart manifests at `HEAD` are byte-identical to `73c2ec7`: the two commits after it changed only `README.md`/`CLAUDE.md` and `ci/`. So the install-test evidence above applies to the charts as they stand. `HEAD`'s own run is still working through the queue — one runner, 28 legs per commit.
The maintainer's decision, and it keeps restrictive-by-default intact: not an
opening but networkPolicy.egress.remoteAssets, whose purpose is in its name
instead of being an unplaceable [80, 443] in extraPorts. Additive inside the
major this chart already carries in this PR, so no second version step.
WHAT IT BUYS, measured rather than assumed. paperless-ngx splits a mail into
two steps with two separate cluster-internal endpoints: the .eml goes to TIKA
for parsing (PAPERLESS_TIKA_ENDPOINT) and the resulting HTML comes here for
rendering (PAPERLESS_TIKA_GOTENBERG_ENDPOINT). Of the images in that HTML,
EMBEDDED ones are MIME parts inside the file and need no network from either
service - which is why apache-tika stays DNS-only and is unchanged - while
REMOTE ones (<img src="https://...">) are fetched by Chromium here, at render
time. With the switch off they are silently dropped: the PDF is produced and is
simply missing them, nothing fails, nothing is logged, no probe notices. That
invisibility is the reason the switch exists.
NOT CHECKED, and written down as not checked rather than implied: whether
paperless-ngx re-embeds the images Tika extracted before handing the HTML over.
If it does not, embedded images would be lost too - but that would be
pre-existing paperless behaviour and not this policy, so the switch is not a
fix for it.
The SSRF argument is unchanged and is why the default is off: Gotenberg drives
a headless Chromium and 3000 is its probe port, so the service is reachable
from the whole cluster, and outbound web access turns anything that can POST
here into a way of fetching arbitrary URLs.
Two things the implementation needed, and one of them was a real defect. The
NOTES.txt branch read .Values.networkPolicy.egress.remoteAssets directly, which
fails the whole render with "nil pointer evaluating interface
{}.remoteAssets" when an operator erases the egress block - the schema permits
null there, and issue #99's rule is that an erased block means "the default
applies", not a broken render. It is null-safe now, and an erased block falls
back to DNS-only, which is the restrictive direction. And ci/networkpolicy/
gotenberg.yaml makes the switch's ON state permanent in CI rather than checked
once by hand: it renders both the switch's egress rule and the
source-restricted probe branch, so all five assertions run over the toggle in
both positions on every pull request. Worth having precisely because assertions
2 and 3 look at INGRESS rules - an egress mistake has no other mechanical
check.
Also, three things that were load-bearing and written nowhere:
- NO CHART SHIPS allowedNamespaces PRE-FILLED. A chart naming mc-router or
stalwart in its defaults would bake in an assumption about this cluster's
namespace layout, which a chart cannot keep true. Restrictive is the default
and filling it is the DEPLOYMENT adaptation - so the release-side one-liners
this sweep produces are the expected procedure, not a defect list, and the
major on each chart is what announces them. ingressController is the one
exception, because it names a cluster component rather than a tenant.
- A POLICY APPLIES TO TRAFFIC THAT CAME THROUGH A SERVICE, and that is why the
ingressController rule works at all. A Service is only destination NAT and
the policy acts at the pod's interface. What the Service changes is the
SOURCE ADDRESS: pod -> ClusterIP -> pod preserves it, so a podSelector can
still match Traefik; NodePort traffic with the default externalTrafficPolicy:
Cluster is masqueraded to a node, which is why those rules are left open.
stalwart's template already carried the second half; the first half is the
one everything rests on.
- AND THE ONE CLUSTER SETTING THIS CONVENTION DEPENDS ON AND CANNOT CHECK:
Traefik must not run with hostNetwork. Measured 2026-10-14 - the DaemonSet
has none and its pods carry real pod IPs (10.42.3.120, 10.42.4.94,
10.42.0.187 in the pod CIDR 10.42.0.0/16, nodes on entirely different
addresses), and only because of that does a podSelector match it. On host
networking those pods share the node's namespace, stop being selectable,
and EVERY WEB CHART GOES DARK AT ONCE while every pod stays Ready, because
the probe path does not run through the controller. Same class as
--enable-certificate-owner-ref in #126: undetectable from here. It is in
README and in the header of template-chart's policy, so whoever changes the
controller's networking meets the consequence on the thing they are changing.
Part of #5
Two leftovers from before the switch existed. The summary still told the reader
to set egress.extraPorts: [80, 443] for remote assets, and the extraPorts hint
still offered the same pair as its headline case - both now say to use
egress.remoteAssets instead, and the extraPorts hint says why: a bare 80/443 in
that list records no reason, which is the whole argument for the named value.
Also sharpens the sentence that matters: HTML conversion keeps the EMBEDDED
content and loses the images it would have FETCHED. The two words were doing
the work and the old wording blurred them.
Part of #5
Follow-up applied: the Gotenberg switch, plus three things that were load-bearing and written nowhere
Restrictive-by-default is unchanged everywhere. minecraft-server's game port stays closed, garage 3900/3902 stay closed, and the release-side list is now described as the expected procedure rather than a risk register.
gotenberg gets a named switch, off by default — e3f6256, b31a189
networkPolicy.egress.remoteAssets: false. Not an opening and not extraPorts: [80, 443]: a value whose purpose is in its name, so the trade is a decision someone made rather than a port pair nobody can place. Additive inside the major this chart already carries — no second version step.
Both halves, measured and written at the switch, in values.yaml and in NOTES.txt:
paperless splits a mail into two steps with two separate cluster-internal endpoints — the .eml to Tika (PAPERLESS_TIKA_ENDPOINT), the resulting HTML here (PAPERLESS_TIKA_GOTENBERG_ENDPOINT).
Embedded images are MIME parts inside the file: no network needed from either service, which is why apache-tika stays DNS-only and is untouched.
Remote images (<img src="https://…">) are fetched by Chromium, here, at render time, and with the switch off they are silently dropped — the PDF is produced and is simply missing them. That invisibility is the reason the switch exists at all.
Explicitly not claimed, because it was not checked: whether paperless re-embeds what Tika extracted before handing the HTML over. If it does not, embedded images would be lost too — but that would be pre-existing paperless behaviour, not this policy.
The SSRF argument is unchanged and is why the default is off.
One real defect found implementing it: the new NOTES.txt branch read .Values.networkPolicy.egress.remoteAssets directly, which fails the whole render with nil pointer evaluating interface {}.remoteAssets when an operator erases the egress block — the schema permits null there, and #99's rule is that an erased block means the default applies, not a broken render. Null-safe now; an erased block falls back to DNS-only, the restrictive direction.
Both switch positions are permanently under test, not checked once: ci/networkpolicy/gotenberg.yaml renders the switch's egress rule and the source-restricted probe branch, so all five assertions run over it on every PR. Worth having because assertions 2 and 3 look at ingress rules — an egress mistake has no other mechanical check. With the switch off (its default, and what the install-test uses) no rule is added at all, so assertions 2 and 3 are untouched. Verified in both positions plus the egress: null edge case.
Three things now written down
No chart ships allowedNamespaces pre-filled, ever. A chart naming mc-router or stalwart in its defaults would bake in an assumption about this cluster's namespace layout — a claim a chart cannot keep true. Restrictive is the default; filling it is the deployment adaptation. This is the sentence that turns the release-side list from a risk into the procedure, and the major on each chart is what announces it. ingressController is the single exception, because it names a cluster component rather than a tenant.
A policy applies to traffic that came through a Service — and that is why the ingressController rule works at all. A Service is only destination NAT and the policy acts at the pod's interface, so a ClusterIP exempts nothing. What changes is the source address: pod → ClusterIP → pod preserves it (so a podSelector can match the Traefik pod); NodePort traffic with the default externalTrafficPolicy: Cluster is masqueraded to a node, which is why those rules are left open. stalwart already carried the second half; the first is the one everything rests on.
The one cluster setting this convention depends on and cannot check: Traefik must not run with hostNetwork. Measured — the DaemonSet has none and its pods carry real pod IPs (10.42.3.120, 10.42.4.94, 10.42.0.187 in 10.42.0.0/16, nodes on entirely different addresses). On host networking they share the node's namespace, stop being selectable as pods, the ingressController entry matches nothing, and every web chart goes dark at once — while every policy is still accepted and still reads as correct. The symptom to recognise: all web traffic stops together and every pod stays Ready, because the probe path does not run through the controller. Same class as --enable-certificate-owner-ref (#126). Recorded in README §15 and in the header of template-chart's policy, so whoever changes the controller's networking meets it on the thing they are changing.
Keycloak's blast radius is smaller than my report assumed
Every readable in-cluster consumer uses the public name — bulwark's OAUTH_ISSUER_URL, homarr's AUTH_OIDC_ISSUER, the paperless releases through their socialaccount block — so their traffic arrives from Traefik and is permitted as shipped. A search across pod environments and ConfigMaps for the in-cluster Service name returned only Keycloak's own pods, reaching keycloak-pg-rw.jlab-pg.svc.cluster.local:5432 — which also confirms the egress rule derived from keycloak.db.port is right for the live release.
The login test stays the acceptance criterion, since a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed: there is now a measured reason to expect it to pass rather than a hope. On the PR body and the keycloak wiki page.
Wiki pushed as f775e45 (fetch + rebase, no force). Local suite: 30 charts, 208 assertions, 0 failed; all twelve fail paths still fire. CI on the new HEAD to follow.
## Follow-up applied: the Gotenberg switch, plus three things that were load-bearing and written nowhere
Restrictive-by-default is unchanged everywhere. `minecraft-server`'s game port stays closed, `garage` 3900/3902 stay closed, and the release-side list is now described as **the expected procedure** rather than a risk register.
### `gotenberg` gets a named switch, off by default — `e3f6256`, `b31a189`
`networkPolicy.egress.remoteAssets: false`. Not an opening and not `extraPorts: [80, 443]`: a value whose purpose is in its name, so the trade is a decision someone made rather than a port pair nobody can place. Additive inside the major this chart already carries — no second version step.
Both halves, measured and written at the switch, in `values.yaml` and in `NOTES.txt`:
- paperless splits a mail into two steps with two separate cluster-internal endpoints — the `.eml` to **Tika** (`PAPERLESS_TIKA_ENDPOINT`), the resulting HTML **here** (`PAPERLESS_TIKA_GOTENBERG_ENDPOINT`).
- **Embedded** images are MIME parts *inside* the file: no network needed from either service, which is why **`apache-tika` stays DNS-only and is untouched**.
- **Remote** images (`<img src="https://…">`) are fetched by **Chromium, here, at render time**, and with the switch off they are **silently dropped** — the PDF is produced and is simply missing them. That invisibility is the reason the switch exists at all.
- **Explicitly not claimed, because it was not checked:** whether paperless re-embeds what Tika extracted before handing the HTML over. If it does not, embedded images would be lost too — but that would be pre-existing paperless behaviour, not this policy.
- The SSRF argument is unchanged and is *why* the default is off.
**One real defect found implementing it:** the new `NOTES.txt` branch read `.Values.networkPolicy.egress.remoteAssets` directly, which fails the whole render with `nil pointer evaluating interface {}.remoteAssets` when an operator erases the `egress` block — the schema permits `null` there, and #99's rule is that an erased block means *the default applies*, not a broken render. Null-safe now; an erased block falls back to DNS-only, the restrictive direction.
**Both switch positions are permanently under test**, not checked once: `ci/networkpolicy/gotenberg.yaml` renders the switch's egress rule **and** the source-restricted probe branch, so all five assertions run over it on every PR. Worth having because assertions 2 and 3 look at *ingress* rules — an egress mistake has no other mechanical check. With the switch **off** (its default, and what the install-test uses) no rule is added at all, so assertions 2 and 3 are untouched. Verified in both positions plus the `egress: null` edge case.
### Three things now written down
1. **No chart ships `allowedNamespaces` pre-filled, ever.** A chart naming `mc-router` or `stalwart` in its defaults would bake in an assumption about this cluster's namespace layout — a claim a chart cannot keep true. Restrictive is the default; filling it is the **deployment adaptation**. This is the sentence that turns the release-side list from a risk into the procedure, and the major on each chart is what announces it. `ingressController` is the single exception, because it names a cluster *component* rather than a tenant.
2. **A policy applies to traffic that came through a Service — and that is why the `ingressController` rule works at all.** A Service is only destination NAT and the policy acts at the **pod's** interface, so a ClusterIP exempts nothing. What changes is the **source address**: pod → ClusterIP → pod **preserves** it (so a `podSelector` can match the Traefik pod); NodePort traffic with the default `externalTrafficPolicy: Cluster` is **masqueraded to a node**, which is why those rules are left open. `stalwart` already carried the second half; the first is the one everything rests on.
3. **The one cluster setting this convention depends on and cannot check: Traefik must not run with `hostNetwork`.** Measured — the DaemonSet has none and its pods carry real pod IPs (`10.42.3.120`, `10.42.4.94`, `10.42.0.187` in `10.42.0.0/16`, nodes on entirely different addresses). On host networking they share the node's namespace, stop being selectable as pods, the `ingressController` entry matches nothing, and **every web chart goes dark at once** — while every policy is still accepted and still reads as correct. **The symptom to recognise:** all web traffic stops together and **every pod stays `Ready`**, because the probe path does not run through the controller. Same class as `--enable-certificate-owner-ref` (#126). Recorded in README §15 *and* in the header of `template-chart`'s policy, so whoever changes the controller's networking meets it on the thing they are changing.
### Keycloak's blast radius is smaller than my report assumed
Every readable in-cluster consumer uses the **public** name — `bulwark`'s `OAUTH_ISSUER_URL`, `homarr`'s `AUTH_OIDC_ISSUER`, the paperless releases through their socialaccount block — so their traffic arrives **from Traefik** and is permitted as shipped. A search across pod environments and ConfigMaps for the in-cluster Service name returned **only Keycloak's own pods**, reaching `keycloak-pg-rw.jlab-pg.svc.cluster.local:5432` — which also confirms the egress rule derived from `keycloak.db.port` is right for the live release.
The login test stays the acceptance criterion, since a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed: there is now a **measured** reason to expect it to pass rather than a hope. On the PR body and the `keycloak` wiki page.
Wiki pushed as `f775e45` (fetch + rebase, no force). Local suite: **30 charts, 208 assertions, 0 failed**; all twelve fail paths still fire. CI on the new HEAD to follow.
CI re-proved on the new HEAD b31a189 — OVERALL: success, 95 tasks, 0 failures
Render tests, all over every chart:
Job
Result
NetworkPolicy
Successful in 19s (up from 13s — it now exercises two overlays)
Resource quantities
Successful in 16s
YAML scalars
Successful in 18s
Selector match
Successful in 10s
HTTPRoute match
Successful in 10s
Bump level
Successful in 5s
All 28 install-test legs green (Validate Helm Charts / Install-test, Successful in 44m14s) — gotenberg1m19s with the switch change, freesailarr 3m20s with a real WireGuard tunnel, keycloak 2m13s, paperless-ngx 2m53s, stalwart 1m25s, valkey 1m16s.
And the commit that actually carries the switch, e3f6256, is independently green on its own full run: 95 tasks, 28/28 install-test legs, gotenberg included.
Local: 30 charts, 208 assertions held, 0 failed; all twelve fail paths still produce their finding. The switch verified in both positions plus the egress: null edge case — with it off (the default, and what the install-test installs) it adds no rule at all, so assertions 2 and 3 are untouched; with it on, ci/networkpolicy/gotenberg.yaml keeps it and the source-restricted probe branch under all five assertions on every PR.
Every commit on the branch is signed (%G? = G), no Co-Authored-By, no "Generated with" footer. Wiki at f775e45.
Nothing left from my side — the PR is green and waits on you. I have not merged and have not armed auto-merge.
## CI re-proved on the new HEAD `b31a189` — `OVERALL: success`, 95 tasks, 0 failures
Render tests, all over **every** chart:
| Job | Result |
| --- | --- |
| `NetworkPolicy` | **Successful in 19s** (up from 13s — it now exercises two overlays) |
| `Resource quantities` | Successful in 16s |
| `YAML scalars` | Successful in 18s |
| `Selector match` | Successful in 10s |
| `HTTPRoute match` | Successful in 10s |
| `Bump level` | Successful in 5s |
All **28 install-test legs green** (`Validate Helm Charts / Install-test`, Successful in 44m14s) — `gotenberg` **1m19s** with the switch change, `freesailarr` 3m20s with a real WireGuard tunnel, `keycloak` 2m13s, `paperless-ngx` 2m53s, `stalwart` 1m25s, `valkey` 1m16s.
And the commit that actually carries the switch, `e3f6256`, is independently green on its own full run: **95 tasks, 28/28 install-test legs, `gotenberg` included**.
Local: **30 charts, 208 assertions held, 0 failed**; all **twelve** fail paths still produce their finding. The switch verified in **both** positions plus the `egress: null` edge case — with it off (the default, and what the install-test installs) it adds no rule at all, so assertions 2 and 3 are untouched; with it on, `ci/networkpolicy/gotenberg.yaml` keeps it and the source-restricted probe branch under all five assertions on every PR.
Every commit on the branch is signed (`%G?` = `G`), no `Co-Authored-By`, no "Generated with" footer. Wiki at `f775e45`.
**Nothing left from my side — the PR is green and waits on you.** I have not merged and have not armed auto-merge.
Renovate automerged the stalwart app patch onto main while this PR was open
(1fd6c56: 1.3.0+upv0.16.25 -> 1.3.1+upv0.16.26), which collided with the major
this PR gives the same chart. The PR went mergeable: false, with an approval and
green checks - the conflict was the only thing in the way.
Resolution: version: 2.0.0+upv0.16.26 with appVersion: "v0.16.26". My major
absorbs their patch rather than being added to it, and the +up suffix follows
appVersion as the scheme requires - verified, suffix == appVersion with dashes
normalised.
Also corrects the justification comment above that line, which had gone stale
in a misleading direction: it argued MINOR, from a diff, for the two previous
rounds (#96's spread constraint and PDB, both gated on a computed replica count
the chart never reaches; #123's MTA-STS routes, whose list ships empty) - both
of which rendered byte-for-byte identically against the previous version. It
then sat directly above a 2.0.0. The comment now says why #5 fails that same
test on every count: a new value, a changed rendered form, and an object that
reaches a RUNNING release on upgrade and changes what can reach the pod. The
old evidence is kept as history rather than deleted, because the contrast is
the useful part.
A merge rather than a rebase, deliberately: the branch is already pushed and
force-pushing a reviewed branch is destructive, so main comes in instead.
Part of #5
Branch updated — the PR had gone mergeable: false under an automerge, now true again
Nothing to do with the review. Renovate automerged a stalwart app patch onto main while this PR was open (1fd6c56, 1.3.0+upv0.16.25 to 1.3.1+upv0.16.26), which collided with the major this PR gives the same chart. Approval and green checks were already in place; the conflict was the only thing in the way.
Resolved as version: 2.0.0+upv0.16.26, appVersion: "v0.16.26" — my major absorbs their patch rather than being added to it, and the +up suffix follows appVersion as the scheme requires (verified: suffix equals appVersion with dashes normalised).
A merge rather than a rebase, deliberately: the branch is pushed and reviewed, and force-pushing it would be destructive — so main came in instead. The branch now contains main in full, with zero commits behind.
And it caught a stale comment worth fixing. The block above that version line argued MINOR, from a diff for the two previous rounds — #96 spread constraint and PDB (gated on a computed replica count the chart never reaches) and #123 MTA-STS routes (whose list ships empty) — both of which rendered byte-for-byte identically against the previous version. It was then sitting directly above a 2.0.0. It now says why #5fails that same test on every count: a new value, a changed rendered form, and an object that reaches a running release on upgrade and changes what can reach the pod. The old evidence is kept as history, because the contrast is the useful part.
Local re-verification after the merge: NetworkPolicy 30 charts, 208 assertions, 0 failed; selector-match, quantity, HTTPRoute and YAML-scalar all green. CI is re-running on b617068 — I will confirm it green.
Still not merged and no auto-merge armed.
## Branch updated — the PR had gone `mergeable: false` under an automerge, now `true` again
Nothing to do with the review. **Renovate automerged a stalwart app patch onto `main` while this PR was open** (`1fd6c56`, `1.3.0+upv0.16.25` to `1.3.1+upv0.16.26`), which collided with the major this PR gives the same chart. Approval and green checks were already in place; the conflict was the only thing in the way.
**Resolved as `version: 2.0.0+upv0.16.26`, `appVersion: "v0.16.26"`** — my major **absorbs** their patch rather than being added to it, and the `+up` suffix follows `appVersion` as the scheme requires (verified: suffix equals `appVersion` with dashes normalised).
**A merge rather than a rebase, deliberately:** the branch is pushed and reviewed, and force-pushing it would be destructive — so `main` came in instead. The branch now contains `main` in full, with zero commits behind.
**And it caught a stale comment worth fixing.** The block above that version line argued *MINOR, from a diff* for the two previous rounds — #96 spread constraint and PDB (gated on a computed replica count the chart never reaches) and #123 MTA-STS routes (whose list ships empty) — both of which rendered byte-for-byte identically against the previous version. It was then sitting directly above a `2.0.0`. It now says why #5 **fails that same test on every count**: a new value, a changed rendered form, and an object that reaches a **running** release on upgrade and changes what can reach the pod. The old evidence is kept as history, because the contrast is the useful part.
Local re-verification after the merge: NetworkPolicy **30 charts, 208 assertions, 0 failed**; selector-match, quantity, HTTPRoute and YAML-scalar all green. CI is re-running on `b617068` — I will confirm it green.
Still not merged and no auto-merge armed.
jklein
merged commit ec9e64187b into main2026-10-15 01:07:39 +02:00
closed at 2026-10-15T01:07:39+02:00 — Fixes #5 auto-closed it, which works because the issue is in this repository
Publish on main
30/30 tasks green on ec9e641, every publish-helm-chart included
Registry index
every new major is present — spot-checked apache-tika 11.0.0, cyberchef 10.0.0, freesailarr 5.0.0, gotenberg 9.0.0, keycloak 2.0.0, matrix-synapse 8.0.0, minecraft-server 7.0.0, paperless-ngx 14.0.0, samba 8.0.0, satisfactory 8.0.0, stalwart 2.0.0, valkey 2.0.0; none missing
Wiki edit landed
f775e45 at the tip, both commits present, 30 chart pages carrying a networkPolicy section
The one thing that now needs doing outside this repository
The charts are published, so the policies reach a release on its next upgrade — and minecraft-server is the case that needs a values line before that happens. All four releases run a ClusterIP Service, so the restricted branch applies and players arrive through minecraft-router in its own namespace:
networkPolicy:allowedNamespaces:["mc-router"]
for mc-vanilla-server, mc-oceanblock-2-server, mc-ftb-skies-2-server and mc-sultan-saladin-server. Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. The rest of the release-side list, and the two items only you can check (garage/stalwart's S3 host, and a Keycloak login), are in the earlier comment — that list is the expected procedure, not a defect register.
Thanks for the review. Nothing further from my side.
## Post-merge verification — all four checks pass
Merged by @jklein as `ec9e641`. The in-flight PR checks showing "Canceled" are the merge cancelling its own run, not a failure.
| Check | Result |
| --- | --- |
| **Issue #5 closed** | **closed** at 2026-10-15T01:07:39+02:00 — `Fixes #5` auto-closed it, which works because the issue is in this repository |
| **Publish on `main`** | **30/30 tasks green** on `ec9e641`, every `publish-helm-chart` included |
| **Registry index** | every new major is **present** — spot-checked `apache-tika 11.0.0`, `cyberchef 10.0.0`, `freesailarr 5.0.0`, `gotenberg 9.0.0`, `keycloak 2.0.0`, `matrix-synapse 8.0.0`, `minecraft-server 7.0.0`, `paperless-ngx 14.0.0`, `samba 8.0.0`, `satisfactory 8.0.0`, `stalwart 2.0.0`, `valkey 2.0.0`; none missing |
| **Wiki edit landed** | `f775e45` at the tip, both commits present, **30 chart pages** carrying a `networkPolicy` section |
### The one thing that now needs doing outside this repository
The charts are published, so the policies reach a release on its **next upgrade** — and `minecraft-server` is the case that needs a values line *before* that happens. All four releases run a `ClusterIP` Service, so the restricted branch applies and players arrive through `minecraft-router` in its own namespace:
```yaml
networkPolicy:
allowedNamespaces: ["mc-router"]
```
for `mc-vanilla-server`, `mc-oceanblock-2-server`, `mc-ftb-skies-2-server` and `mc-sultan-saladin-server`. Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. The rest of the release-side list, and the two items only you can check (`garage`/`stalwart`'s S3 host, and a Keycloak login), are in the earlier comment — that list is the expected procedure, not a defect register.
Thanks for the review. Nothing further from my side.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Rollout of Gitea #5: every chart gets a NetworkPolicy,
networkPolicy.enabled: trueby default, one major per chart — following the plan approved in the last comment on the issue.This PR is in progress. It opens early on purpose: the enforcement proof the whole scope rests on has to run in CI before 29 charts are switched over, and partial work that is pushed survives an interrupted agent. The chart list below is kept current as commits land.
What was measured, not assumed
Re-verified against the live cluster before anything was written, because the issue body describes a cluster that no longer exists:
traefik, as the default; nonginxclasskube-system, DaemonSetrke2-traefik, pod labelapp.kubernetes.io/name: rke2-traefik,web=8000 websecure=8443 traefik=8080 metrics=9100One addition to the plan's table, and it matters: the GatewayClass controller is
traefik.io/gateway-controllerandcluster-gatewayholds no pods of its own. The samerke2-traefikDaemonSet serves both the Ingress and the HTTPRoutes from the Gateway sweep (#114), so one source selector covers both paths — no second controller entry is needed anywhere.A policy written against ingress-nginx would have been accepted, would have looked strict, and would have silently blocked all web traffic.
And one cluster setting this whole convention rests on and cannot check: Traefik runs without
hostNetwork, so its pods have real pod IPs (10.42.3.120,10.42.4.94,10.42.0.187in the pod CIDR10.42.0.0/16, nodes on entirely different addresses) — and only because of that does apodSelectormatch it. On host networking those pods would share the node's namespace, stop being selectable as pods, and every web chart would go dark at once while every pod stayedReady, because the probe path does not run through the controller. Same class as--enable-certificate-owner-refin #126; recorded in README §15 and in the header oftemplate-chart's policy so whoever changes the controller's networking meets it there.The convention
Per chart,
templates/<chart>.networkpolicy.yaml, valuesnetworkPolicy.{enabled,allowedNamespaces,probeSources,ingressController,egress.extraPorts}.Each port of a workload falls into one of four classes, and the class decides the rule:
fromby default and restricted onceprobeSourcesis set. The kubelet probes from the IP of the worker node running the pod, which no chart can know; a guessed CIDR that misses it drops every probe and the pod never becomes Ready — a symptom that reads as a broken application.execprobes are not in this class: they run inside the container and put no packet on the network, which is exactly whyvalkeyandminecraft-servercan restrict their port by source with noprobeSourcesat all.from, because the source is the internet and arrives already masqueraded.allowedNamespaces, and the ingress controller where the chart routes HTTP to that port.No chart ships
allowedNamespacespre-filled. A chart namingmc-routerorstalwartin its defaults would bake in an assumption about this cluster's namespace layout, which a chart cannot keep true — so the default is empty and restrictive, and filling it is the deployment adaptation. That is why this PR produces a list of release-side one-liners: they are the expected procedure, not a defect list, and the breaking-change major on each chart is what announces them.ingressControlleris a separate value rather than a line inallowedNamespacesfor one reason: its two keys render as onefromentry, which is an AND. Puttingkube-systemintoallowedNamespacesinstead would open the port to every pod inkube-system.What these policies do NOT do
Written per chart rather than quietly accepted:
GlobalNetworkSetcould express one but would bind every chart to Calico — the same argument that kept implementation-specific objects out of #114. So it is not used.CI:
ci/run-networkpolicy-test.sh+ theNetworkPolicyjobEvery rendered policy is held against the pod specs, probes and Services of the same render. Helm is the parser through
ci/yaml2json, as in the other render tests — the runners have neitherpyyamlnoryq.podSelectormatches a pod spec of that render;containerPortof the selected pods — this catches the NodePort mistake mechanically. Egress ports are deliberately excluded: an egress port belongs to the destination;probeSourcesand the consequence inNOTES.txt.Plus two guards: a chart that renders no policy fails (which is how this issue decayed —
garageandkeycloakwere both created after #5 and both arrived without one), and a#comment inside a rendered policy fails, because it is part of the object and ships to the cluster.Assertion 3 is stricter than the plan's wording, deliberately. The plan banned a missing or empty
from.from: []always fails — it allows everything while reading as a restriction. A missingfromis the documented open form that both precedents use on purpose, so it is accepted only where the render itself justifies it: every port of the rule is probed, or published by a NodePort Service. Anything else is an allow-all nobody chose.All failure paths were executed, not only the green ones — 12 cases, and one earned its keep immediately: the
probeSourcescheck was a substring test, so a chart whose key had been deleted while the comment above it still discussed the value passed. It now looks for the key.What stays unprovable
satisfactoryhas no install-test coverage at all (ci/excluded-charts.txt). For that one chart the review is the only net.Charts — all 29, plus the reference
template-chart(reference) ·apache-tika·bentopdf·bulwark·calibre-web-automated·cyberchef·freesailarr·garage·gotenberg·homeassistant·keycloak·matrix-synapse·minecraft-router·minecraft-server·outline·paperless-ngx·patchmon·rallly·rss-bridge·samba·satisfactory·searxng·stalwart·sure·teamspeak-server·urlaubsverwaltung·valkey·voucher-vault·ytdlp-web-player·ziplineOne major each.
ci/run-networkpolicy-test.sh: 30 charts, 206 assertions held, 0 failed.The charts worth reviewing first, because they decided things
keycloakhttprule is the only genuinely source-restricted inbound rule in the sweep — possible only because the probes use the management port. If the ingress-controller source is wrong, every login in the cluster stops, and nothing in CI can see it: no controller runs there and the probes use 9000, so the pod goesReadyeither way. Port numbers and the database port are derived fromkeycloak.settings.homeassistant,satisfactorypolicyTypes: [Ingress], no egress section. Each argues it in its own file.satisfactory's deciding half: it is the one chart with no install-test at all, so an egress cap there would be the only one in the sweep with no empirical check behind it, on the chart whose correct port set (Steam's CDN) is least knowable.minecraft-serverexecprobes, so no port has to stay open for the kubelet and noprobeSourcesvalue exists. Its game port has two branches rendered from the same value the Service reads.gotenbergnetworkPolicy.egress.remoteAssetsas a named switch, off by default, for releases that need remote images. Measured: paperless sends the.emlto Tika and the resulting HTML here, so embedded images are MIME parts needing no network (Tika stays DNS-only) while remote ones are fetched by Chromium and silently dropped with the switch off.bulwarkjmapServerUrlon a port the policy blocks yields aReadypod serving an empty webmail.matrix-synapsesamba,satisfactory,teamspeak-servervalkey,stalwartstalwartgainsingressControllerand a correction: it advisedallowedNamespaces: ["ingress-nginx"], and both halves of that are wrong.Keycloak's blast radius, measured
The
keycloakrow above is the largest risk in this PR, and it is now smaller than it first read. Every readable in-cluster consumer addresses Keycloak by its public name, so its traffic arrives from Traefik and is permitted by the rule exactly as shipped:bulwarkOAUTH_ISSUER_URL = https://id.mail.bekemeyer-klein.de/realms/mailhomarrAUTH_OIDC_ISSUER = https://bk.id.bekemeyer-klein.de/realms/bekemeyer-kleinpaperless-{jk,cmk,ngx}PAPERLESS_SOCIALACCOUNT_PROVIDERSblockA search across pod environments and ConfigMaps for the in-cluster Service name (
keycloak-keycloak-service,*.keycloak.svc) returned only Keycloak's own pods, reachingkeycloak-pg-rw.jlab-pg.svc.cluster.local:5432— which incidentally confirms the egress rule derived fromkeycloak.db.portis right for the live release.The login test after the upgrade stays the acceptance criterion, because a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed is that there is now a measured reason to expect it to pass.
Three things the checks caught while this was written
minecraft-server's RCON rule named a port the pod does not declare — thecontainerPortis gated onserver.rcon.enabledand the rule was not. Assertion 2 rejected it.sambaandsatisfactorywould have shipped values that reach no rule. Every one of their inbound rules is open to any source, soallowedNamespacesandprobeSourcesdid nothing. A value that silently does nothing is worse than one that is absent, because it reads as a control — both are gone from those charts and their schemas, with the reason invalues.yaml.probeSourcesassertion was a substring test, so a chart whose key had been deleted while the comment above it still discussed the value passed. Found by running the fail path; it now looks for the key.gotenberg's newNOTES.txtbranch read.Values.networkPolicy.egress.remoteAssetsdirectly, which fails the whole render withnil pointer evaluating interface {}.remoteAssetswhen an operator erases theegressblock — the schema permitsnullthere, and issue #99's rule is that an erased block means the default applies, not a broken render. Null-safe now, and an erased block falls back to DNS-only, which is the restrictive direction.Docs
README.md(style guideline §15 + the CI section) andCLAUDE.md(the binding compact summary). Wiki, pushed as8198027:Chart-Style-Guide§15,CI-CD§8 (later jobs renumbered),Charts, all 29 chart pages plustemplate-chart, and fourLessons-Learnedentries — the net that existed for a different failure than the one it was built for; a template comment that could not describe its own syntax; three values that reached no rule; and the subchart whose comments the parent could not fix.Fixes #5
The enforcement proof: measured, and the answer is not the one the plan assumed
Two experiments on this branch, run 888. Both are reverted; the commits are kept for the record (
d3ef372,813c923,de995d0).Install-test cyberchef192.0.2.11/32— an RFC 5737 documentation address that cannot be the k3d nodeInstall-test outlinepostgresandredisdo not resolve and/_healthcannot passPolicies ARE enforced in the install-test. Outline never became Ready and
rollout statustimed out after six minutes. That is the net this rollout needs, and it exists.But the kubelet probe traffic is EXEMPT from policy in k3s. CyberChef became Ready in 69 seconds with its probe port restricted to an address no probe can originate from. So the specific claim in the plan — "eine Policy, die den Probe-Pfad blockiert, sollte den Pod nie Ready werden lassen und den Install-Test rot machen" — does not hold here. It is now measured instead of assumed.
Why I kept going rather than stopping
The net holds for the failures this rollout can actually produce, and the one it misses is not reachable from the defaults:
fromuntil an operator setsprobeSources, so the trap CI cannot see is not triggered by this PR — only by a deliberate narrowing, which is exactly what theNOTES.txtsentence and the fourth CI assertion are for.If you read the trade differently, this is the point to say so: the scope question is still open until the chart commits land, and I will rework rather than argue.
Major. This is the richest policy of the sweep and the one with the largest blast radius, and it is the only chart whose three ports fall into three different classes - so it is where the convention is visible in full: http (8080) NOT addressed by any probe, so it CAN be restricted by source, and it is: own namespace, allowedNamespaces, and the ingress controller. The only real inbound restriction in this whole rollout, possible only because the probes use a different port. management (9000) the port all three probes address, so it stays open inside the cluster. That matters here specifically: this surface carries health and metrics UNAUTHENTICATED, and "no Ingress" was its only protection before this object. The policy turns "anything that can route to the pod" into "anything inside the cluster"; probeSources closes the rest. jgroups (7800) the cluster bus, restricted to the pods this policy itself selects - a podSelector with no namespaceSelector, the narrowest rule the object can express. All four port numbers come from keycloak.settings rather than being written down twice, so moving keycloak.ports.http moves the policy with it. And the egress rule for the database is the CONFIGURED port, keycloak.db.port - this is the one chart in the sweep that does not have to guess, because its database port is a value instead of a field inside an opaque secret. The outbound cluster-bus rule is not a duplicate of the inbound one: policyTypes lists Egress, so a replica dialling its peer is subject to this policy too, and without it the bus would be open inbound and blocked outbound - a cluster that never forms, with two nodes that each look healthy. THE BLAST RADIUS IS WRITTEN INTO THE CHART, because nothing in CI can catch it: this release is the cluster's identity provider, no ingress controller runs in the install-test, and the probes use 9000 - so the pod becomes Ready whether or not the http rule is right. NOTES.txt therefore asks for two checks after the first upgrade: log in, and look at whether any consumer uses the in-cluster Service address instead of the public issuer URL (those namespaces need allowedNamespaces). Not allowed at all, and named as the likely first surprise: SMTP, because the mail server is configured per realm where the chart cannot see it. The test's overlay guard is tightened in the same commit, and keycloak is why. It counted any source-restricted rule, and this chart restricts two of them in its own defaults - so the guard would have been satisfied while the probe branch, the only branch an overlay exists to reach, was never rendered. It now counts restricted PROBE rules. All twelve failure paths were re-run against the change. Part of #5garage, minecraft-router, minecraft-server, samba, teamspeak-server, satisfactory. One major each. These are the charts the plan said to leave for last, and they earned it - three of them changed the convention rather than just consuming it. GARAGE is the clearest illustration after keycloak. Its four ports split three ways: s3 and web are RESTRICTED by source (no probe touches them), admin is the probe path and stays open inside the cluster - which is uncomfortable, because admin is also the admin API, and that is said out loud instead of glossed - and rpc gets the narrowest rule the object can express, a podSelector with no namespaceSelector. All four numbers come from garage.settings. MINECRAFT-SERVER is the tightest policy in the repository, and the reason is worth knowing: all three of its probes are EXEC probes, which put no packet on the network, so no port has to stay open for the kubelet and no probeSources value is needed at all. RCON and metrics are restricted outright. The game port has two branches rendered from the same value the Service reads - server.service.type NodePort means players arrive from the internet and the rule must be open; anything else means the only path is in-cluster, so the rule is restricted and the router's namespace has to be in allowedNamespaces. MINECRAFT-ROUTER derives its egress from the routing table instead of guessing: server.backendPort plus the "port" override of every mapping that sets one. Add a backend on a non-standard port and the policy follows. What it cannot express is the destination - mappings name hosts, and this object matches no hostname - so the rule is wider than the routing table, and that is written down. SATISFACTORY gets policyTypes: [Ingress] and no egress section, and the second half of the reason is the deciding one. Steam's content delivery is not a pinnable port set (SteamCMD over TCP 80/443/27015-27050, master servers over UDP 27000-27100 and 4380, changed by Valve, re-downloaded on every update) - and this is the ONE chart with no install-test at all, because the image is multiple GB and the first start pulls over 10GB. An egress cap here would be the only one in the sweep with no empirical check behind it, on the chart whose correct port set is least knowable. SAMBA and TEAMSPEAK-SERVER carry the NodePort lesson explicitly: the rules name 445/139 and the pod's voice and file-transfer ports, never the NodePorts, and teamspeak's file is explicit that its pod port and NodePort happening to share a number is a coincidence of its values rather than a pattern to copy. Teamspeak's voice rule is UDP, and the file says why that matters: a TCP rule on the same number is accepted, looks complete, and drops every voice packet. THREE THINGS THE CHECKS CAUGHT WHILE THIS BATCH WAS WRITTEN, all of them real: - minecraft-server's RCON rule named a port the pod does not declare. The containerPort is gated on server.rcon.enabled and the rule was not, so assertion 2 rejected it. The rule now carries the same gate. - samba and satisfactory would have shipped allowedNamespaces and probeSources values that reach NO rule - every one of their inbound rules is open to any source. A value that silently does nothing is worse than one that is absent, because it reads as a control, so both are gone from those two charts and from their schemas, with the reason in values.yaml. teamspeak-server loses probeSources for the same reason and keeps allowedNamespaces, which its web-query rule uses. - the policy templates no longer declare template variables they do not use. samba keeps one, satisfactory none. Part of #5matrix-synapse, paperless-ngx, freesailarr, valkey, stalwart. One major each. All 29 installable charts plus template-chart now render a policy, and ci/run-networkpolicy-test.sh passes over all 30 with 206 assertions held. MATRIX-SYNAPSE renders TWO policies, one per workload, and the split is the decision in that file. Synapse federates - it must be able to reach any homeserver on the internet, so 443 and 8448 go to any destination - while the delegation nginx serves two static JSON documents and calls nobody, so its egress is DNS and nothing else. A single policy over both pods would have to permit the union, handing full federation reach and the database port to an nginx whose job is to return a constant, and it would read as one decision rather than as a widening. networkPolicy.egress.extraPorts deliberately does not reach the delegation policy for the same reason. PAPERLESS-NGX names the two pods of its own release that this object does NOT cover: the valkey subchart's pod, which carries its own labels and needs no cover because the valkey chart ships a tighter policy of its own; and the consume CronJob's pods, whose pod template carries NO LABELS AT ALL, so no podSelector can match them. That second one is a real gap in the convention. It is tolerable only because the job moves files between mounted volumes and reaches the SMB share through a CSI volume the node mounts - the pod opens no connection of its own - and if that ever changes the CronJob needs labels before it can need a policy. FREESAILARR is ten containers in one pod behind a VPN, and simpler than that sounds: they share a network namespace, so all inter-container traffic is localhost and no policy sees any of it. Because the namespace belongs to gluetun, everything the *arr containers send is encapsulated before it leaves, so three rules describe the whole outbound surface - DNS, UDP 51820 for the tunnel, and 443 for gluetun's server-list API, which cannot go through the tunnel because it runs before the tunnel exists. The tunnel rule is the one that can break this chart and also the best covered: gluetun's health server answers 200 only while the tunnel is up and all three of its probes address it, so a blocked 51820 is a pod that never goes Ready - in the install-test, which brings up a real tunnel. VALKEY AND STALWART, the two charts that had a policy before this issue, are pulled onto the convention without a single rule changing. What changed: - the reasoning moved out of "#" comments, which are part of the rendered object and travel into the cluster, into template comments. Both files failed the new check; that is what it is for. - stalwart gains networkPolicy.ingressController, which fixes a hole its own comment described without being able to solve: it advised putting the controller's namespace into allowedNamespaces, which is namespace-granular and would have opened the http port to every pod in kube-system. - stalwart's example was WRONG and is corrected. It suggested ["ingress-nginx"]; measured on 2026-10-14, ingress-nginx is gone from this cluster entirely and the controller is rke2-traefik in kube-system. A policy written against the old one would have been accepted, looked strict, and silently blocked all web traffic. Their justified specifics are untouched: valkey stays Ingress-only, because it opens no outbound connection and an egress rule would constrain nothing while making the object look stricter; and it keeps 6379 restricted by source with no probeSources at all, which is safe only because all three of its probes are exec probes and put no packet on the network. The convention was written to accommodate both, and homeassistant and satisfactory now invoke valkey's rule in the other direction. ONE CHANGE TO THE TEST, forced by a structural fact rather than by convenience: the rendered-comment assertion now skips documents from a SUBCHART. A dependency is fetched from the Helm registry, not from the copy in this repository, so the policy paperless-ngx and stalwart bundle is whatever valkey version is PUBLISHED - and nothing in the parent chart can change its rendered comments. Holding the parent responsible would have made the test unfixable until valkey's next release and would fail a chart for a file its own diff does not contain. The subchart's own pull request is where it is caught, because this test runs over every chart including valkey itself. All twelve failure paths were re-run against the change. Part of #5Release-side actions this PR creates — measured against the live cluster
I have not touched
jk-cluster-configand opened no PR there, as instructed. This is the list of what the merge will need on the release side, separated into what I could verify and what only you can.Verified against the live cluster — the egress guesses are right
The convention's weakest point is that most egress ports are the standard ones rather than the configured ones. For this cluster they match:
postgres-18-postgresqlmaria-db-mariadburlaubsverwaltungallows both)*-valkey-service(6 of them)paperless-ngxallows 80 ✅So no existing release should lose its database, cache or OIDC on upgrade. No ServiceMonitor or PodMonitor exists in the cluster, so the restricted metrics ports (
minecraft-server19565) break no scrape.Needs a values change at release level — measured, not guessed
All four Minecraft servers run a
ClusterIPService, which means the restricted branch ofminecraft-server's game-port rule applies to every one of them:Players reach them through
minecraft-router, which runs in themc-routernamespace. So each of those four releases needs:Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. This is the single most likely outage from this PR, and it is four one-line values changes.
Needs checking by you — I cannot read the values that decide it
garage— its s3 rule is restricted by source, andstalwarthasSTALWART_S3_ACCESS_KEY/SECRET_KEYwired, so it is using an S3 store. If that store is garage's in-cluster address, garage needsallowedNamespaces: ["stalwart"]. I cannot tell: Stalwart's blob store is an object in its database, created in the WebUI, so the host appears in no chart value and no readable object. Any other S3 consumer in another namespace needs the same.keycloak— thehttprule is the only source-restricted inbound rule in the PR and this release is the cluster's identity provider. Consumers using the public issuer URL come through Traefik and are covered; one using the in-cluster Service address (keycloak-keycloak-service:8080) is a pod in another namespace and is blocked. The discovery URLs live in 1Password items, so I cannot check them. Verify with a real login, not withkubectl— and note that CI cannot catch this at all: no controller runs there and the probes use port 9000, so the pod goesReadyeither way.bulwark— 443 is allowed, Stalwart's in-cluster 8080 is not. Ifbulwark.jmapServerUrlpoints at the in-cluster Service, it needsegress.extraPorts: [8080]. The failure is quiet: the probes test bulwark's own port, so the pod comes upReadyand serves an empty webmail.paperless-ngx— if any release fetches mail, it needs IMAP (993, or143) inegress.extraPorts. The mail accounts are rows in its database, so no chart value shows them.keycloakagain — SMTP is not allowed. If a realm sends verification or password-reset mail, it needsegress.extraPorts: [587](or 465).Not affected
apache-tikaandgotenbergkeep working untouched: their ports are the probed ones, so the rules stay open by default and the fourpaperless-*namespaces reach them as before. An action is only needed there if someone setsprobeSources.Install-test evidence: all 28 installable charts green with their policy active
73c2ec7(the final five charts)28a0230(NodePort and game servers)96c23b7(keycloak)e1adcef(nine charts with dependencies)28 of 28 installable charts have passed at least once with the policy on, and no leg has failed on any commit of this branch. (
satisfactoryandtemplate-charthave no install-test at all —ci/excluded-charts.txt.)Five of those matter more than the rest, and all five are in
73c2ec7:freesailarr— the install-test brings up a real WireGuard tunnel, and gluetun's health server answers 200 only while the tunnel is up. Its passing is the empirical check on theUDP 51820egress rule, which is the one rule that can take the whole pod down.matrix-synapse— both policies applied and both workloads becameReady.paperless-ngx— installs alongside thevalkeysubchart's own policy.stalwartandvalkey— the two rewritten precedents, with no rule changed.And the four charts whose CI fixtures sit on a non-standard dependency port are the ones that actually exercise the egress cap's cost:
patchmon,rallly,urlaubsverwaltungandvoucher-vaultreach a CI dex on 5556 rather than 443,bulwarka JMAP server on plain 8080, andoutlinethe same dex. Each needednetworkPolicy.egress.extraPortsin its fixture — the chart's documented escape hatch, used for exactly the casevalues.yamlnames. Remove any one of those entries and the install-test shows what the cap does to a dependency on an unexpected port.The render test on the runner
Validate Helm Charts / NetworkPolicy— Successful in 13s, over all 30 charts. Locally: 30 charts, 208 assertions held, 0 failed, and all twelve failure paths produce their finding.Note that the chart manifests at
HEADare byte-identical to73c2ec7: the two commits after it changed onlyREADME.md/CLAUDE.mdandci/. So the install-test evidence above applies to the charts as they stand.HEAD's own run is still working through the queue — one runner, 28 legs per commit.The maintainer's decision, and it keeps restrictive-by-default intact: not an opening but networkPolicy.egress.remoteAssets, whose purpose is in its name instead of being an unplaceable [80, 443] in extraPorts. Additive inside the major this chart already carries in this PR, so no second version step. WHAT IT BUYS, measured rather than assumed. paperless-ngx splits a mail into two steps with two separate cluster-internal endpoints: the .eml goes to TIKA for parsing (PAPERLESS_TIKA_ENDPOINT) and the resulting HTML comes here for rendering (PAPERLESS_TIKA_GOTENBERG_ENDPOINT). Of the images in that HTML, EMBEDDED ones are MIME parts inside the file and need no network from either service - which is why apache-tika stays DNS-only and is unchanged - while REMOTE ones (<img src="https://...">) are fetched by Chromium here, at render time. With the switch off they are silently dropped: the PDF is produced and is simply missing them, nothing fails, nothing is logged, no probe notices. That invisibility is the reason the switch exists. NOT CHECKED, and written down as not checked rather than implied: whether paperless-ngx re-embeds the images Tika extracted before handing the HTML over. If it does not, embedded images would be lost too - but that would be pre-existing paperless behaviour and not this policy, so the switch is not a fix for it. The SSRF argument is unchanged and is why the default is off: Gotenberg drives a headless Chromium and 3000 is its probe port, so the service is reachable from the whole cluster, and outbound web access turns anything that can POST here into a way of fetching arbitrary URLs. Two things the implementation needed, and one of them was a real defect. The NOTES.txt branch read .Values.networkPolicy.egress.remoteAssets directly, which fails the whole render with "nil pointer evaluating interface {}.remoteAssets" when an operator erases the egress block - the schema permits null there, and issue #99's rule is that an erased block means "the default applies", not a broken render. It is null-safe now, and an erased block falls back to DNS-only, which is the restrictive direction. And ci/networkpolicy/ gotenberg.yaml makes the switch's ON state permanent in CI rather than checked once by hand: it renders both the switch's egress rule and the source-restricted probe branch, so all five assertions run over the toggle in both positions on every pull request. Worth having precisely because assertions 2 and 3 look at INGRESS rules - an egress mistake has no other mechanical check. Also, three things that were load-bearing and written nowhere: - NO CHART SHIPS allowedNamespaces PRE-FILLED. A chart naming mc-router or stalwart in its defaults would bake in an assumption about this cluster's namespace layout, which a chart cannot keep true. Restrictive is the default and filling it is the DEPLOYMENT adaptation - so the release-side one-liners this sweep produces are the expected procedure, not a defect list, and the major on each chart is what announces them. ingressController is the one exception, because it names a cluster component rather than a tenant. - A POLICY APPLIES TO TRAFFIC THAT CAME THROUGH A SERVICE, and that is why the ingressController rule works at all. A Service is only destination NAT and the policy acts at the pod's interface. What the Service changes is the SOURCE ADDRESS: pod -> ClusterIP -> pod preserves it, so a podSelector can still match Traefik; NodePort traffic with the default externalTrafficPolicy: Cluster is masqueraded to a node, which is why those rules are left open. stalwart's template already carried the second half; the first half is the one everything rests on. - AND THE ONE CLUSTER SETTING THIS CONVENTION DEPENDS ON AND CANNOT CHECK: Traefik must not run with hostNetwork. Measured 2026-10-14 - the DaemonSet has none and its pods carry real pod IPs (10.42.3.120, 10.42.4.94, 10.42.0.187 in the pod CIDR 10.42.0.0/16, nodes on entirely different addresses), and only because of that does a podSelector match it. On host networking those pods share the node's namespace, stop being selectable, and EVERY WEB CHART GOES DARK AT ONCE while every pod stays Ready, because the probe path does not run through the controller. Same class as --enable-certificate-owner-ref in #126: undetectable from here. It is in README and in the header of template-chart's policy, so whoever changes the controller's networking meets the consequence on the thing they are changing. Part of #5Follow-up applied: the Gotenberg switch, plus three things that were load-bearing and written nowhere
Restrictive-by-default is unchanged everywhere.
minecraft-server's game port stays closed,garage3900/3902 stay closed, and the release-side list is now described as the expected procedure rather than a risk register.gotenberggets a named switch, off by default —e3f6256,b31a189networkPolicy.egress.remoteAssets: false. Not an opening and notextraPorts: [80, 443]: a value whose purpose is in its name, so the trade is a decision someone made rather than a port pair nobody can place. Additive inside the major this chart already carries — no second version step.Both halves, measured and written at the switch, in
values.yamland inNOTES.txt:.emlto Tika (PAPERLESS_TIKA_ENDPOINT), the resulting HTML here (PAPERLESS_TIKA_GOTENBERG_ENDPOINT).apache-tikastays DNS-only and is untouched.<img src="https://…">) are fetched by Chromium, here, at render time, and with the switch off they are silently dropped — the PDF is produced and is simply missing them. That invisibility is the reason the switch exists at all.One real defect found implementing it: the new
NOTES.txtbranch read.Values.networkPolicy.egress.remoteAssetsdirectly, which fails the whole render withnil pointer evaluating interface {}.remoteAssetswhen an operator erases theegressblock — the schema permitsnullthere, and #99's rule is that an erased block means the default applies, not a broken render. Null-safe now; an erased block falls back to DNS-only, the restrictive direction.Both switch positions are permanently under test, not checked once:
ci/networkpolicy/gotenberg.yamlrenders the switch's egress rule and the source-restricted probe branch, so all five assertions run over it on every PR. Worth having because assertions 2 and 3 look at ingress rules — an egress mistake has no other mechanical check. With the switch off (its default, and what the install-test uses) no rule is added at all, so assertions 2 and 3 are untouched. Verified in both positions plus theegress: nulledge case.Three things now written down
allowedNamespacespre-filled, ever. A chart namingmc-routerorstalwartin its defaults would bake in an assumption about this cluster's namespace layout — a claim a chart cannot keep true. Restrictive is the default; filling it is the deployment adaptation. This is the sentence that turns the release-side list from a risk into the procedure, and the major on each chart is what announces it.ingressControlleris the single exception, because it names a cluster component rather than a tenant.ingressControllerrule works at all. A Service is only destination NAT and the policy acts at the pod's interface, so a ClusterIP exempts nothing. What changes is the source address: pod → ClusterIP → pod preserves it (so apodSelectorcan match the Traefik pod); NodePort traffic with the defaultexternalTrafficPolicy: Clusteris masqueraded to a node, which is why those rules are left open.stalwartalready carried the second half; the first is the one everything rests on.hostNetwork. Measured — the DaemonSet has none and its pods carry real pod IPs (10.42.3.120,10.42.4.94,10.42.0.187in10.42.0.0/16, nodes on entirely different addresses). On host networking they share the node's namespace, stop being selectable as pods, theingressControllerentry matches nothing, and every web chart goes dark at once — while every policy is still accepted and still reads as correct. The symptom to recognise: all web traffic stops together and every pod staysReady, because the probe path does not run through the controller. Same class as--enable-certificate-owner-ref(#126). Recorded in README §15 and in the header oftemplate-chart's policy, so whoever changes the controller's networking meets it on the thing they are changing.Keycloak's blast radius is smaller than my report assumed
Every readable in-cluster consumer uses the public name —
bulwark'sOAUTH_ISSUER_URL,homarr'sAUTH_OIDC_ISSUER, the paperless releases through their socialaccount block — so their traffic arrives from Traefik and is permitted as shipped. A search across pod environments and ConfigMaps for the in-cluster Service name returned only Keycloak's own pods, reachingkeycloak-pg-rw.jlab-pg.svc.cluster.local:5432— which also confirms the egress rule derived fromkeycloak.db.portis right for the live release.The login test stays the acceptance criterion, since a consumer whose issuer URL lives in a secret or a realm import is not covered by that search. What changed: there is now a measured reason to expect it to pass rather than a hope. On the PR body and the
keycloakwiki page.Wiki pushed as
f775e45(fetch + rebase, no force). Local suite: 30 charts, 208 assertions, 0 failed; all twelve fail paths still fire. CI on the new HEAD to follow.CI re-proved on the new HEAD
b31a189—OVERALL: success, 95 tasks, 0 failuresRender tests, all over every chart:
NetworkPolicyResource quantitiesYAML scalarsSelector matchHTTPRoute matchBump levelAll 28 install-test legs green (
Validate Helm Charts / Install-test, Successful in 44m14s) —gotenberg1m19s with the switch change,freesailarr3m20s with a real WireGuard tunnel,keycloak2m13s,paperless-ngx2m53s,stalwart1m25s,valkey1m16s.And the commit that actually carries the switch,
e3f6256, is independently green on its own full run: 95 tasks, 28/28 install-test legs,gotenbergincluded.Local: 30 charts, 208 assertions held, 0 failed; all twelve fail paths still produce their finding. The switch verified in both positions plus the
egress: nulledge case — with it off (the default, and what the install-test installs) it adds no rule at all, so assertions 2 and 3 are untouched; with it on,ci/networkpolicy/gotenberg.yamlkeeps it and the source-restricted probe branch under all five assertions on every PR.Every commit on the branch is signed (
%G?=G), noCo-Authored-By, no "Generated with" footer. Wiki atf775e45.Nothing left from my side — the PR is green and waits on you. I have not merged and have not armed auto-merge.
Branch updated — the PR had gone
mergeable: falseunder an automerge, nowtrueagainNothing to do with the review. Renovate automerged a stalwart app patch onto
mainwhile this PR was open (1fd6c56,1.3.0+upv0.16.25to1.3.1+upv0.16.26), which collided with the major this PR gives the same chart. Approval and green checks were already in place; the conflict was the only thing in the way.Resolved as
version: 2.0.0+upv0.16.26,appVersion: "v0.16.26"— my major absorbs their patch rather than being added to it, and the+upsuffix followsappVersionas the scheme requires (verified: suffix equalsappVersionwith dashes normalised).A merge rather than a rebase, deliberately: the branch is pushed and reviewed, and force-pushing it would be destructive — so
maincame in instead. The branch now containsmainin full, with zero commits behind.And it caught a stale comment worth fixing. The block above that version line argued MINOR, from a diff for the two previous rounds — #96 spread constraint and PDB (gated on a computed replica count the chart never reaches) and #123 MTA-STS routes (whose list ships empty) — both of which rendered byte-for-byte identically against the previous version. It was then sitting directly above a
2.0.0. It now says why #5 fails that same test on every count: a new value, a changed rendered form, and an object that reaches a running release on upgrade and changes what can reach the pod. The old evidence is kept as history, because the contrast is the useful part.Local re-verification after the merge: NetworkPolicy 30 charts, 208 assertions, 0 failed; selector-match, quantity, HTTPRoute and YAML-scalar all green. CI is re-running on
b617068— I will confirm it green.Still not merged and no auto-merge armed.
Post-merge verification — all four checks pass
Merged by @jklein as
ec9e641. The in-flight PR checks showing "Canceled" are the merge cancelling its own run, not a failure.Fixes #5auto-closed it, which works because the issue is in this repositorymainec9e641, everypublish-helm-chartincludedapache-tika 11.0.0,cyberchef 10.0.0,freesailarr 5.0.0,gotenberg 9.0.0,keycloak 2.0.0,matrix-synapse 8.0.0,minecraft-server 7.0.0,paperless-ngx 14.0.0,samba 8.0.0,satisfactory 8.0.0,stalwart 2.0.0,valkey 2.0.0; none missingf775e45at the tip, both commits present, 30 chart pages carrying anetworkPolicysectionThe one thing that now needs doing outside this repository
The charts are published, so the policies reach a release on its next upgrade — and
minecraft-serveris the case that needs a values line before that happens. All four releases run aClusterIPService, so the restricted branch applies and players arrive throughminecraft-routerin its own namespace:for
mc-vanilla-server,mc-oceanblock-2-server,mc-ftb-skies-2-serverandmc-sultan-saladin-server. Without it the server is unreachable and the symptom is a connection timeout in a game client with a perfectly healthy pod behind it. The rest of the release-side list, and the two items only you can check (garage/stalwart's S3 host, and a Keycloak login), are in the earlier comment — that list is the expected procedure, not a defect register.Thanks for the review. Nothing further from my side.