Repository navigation
Conversation
The edge policy admitted the named port "http" for the API and realtime (8080) and the console (3000). One policy admitting a named port with two numbers trips a race reported against kube-router, the NetworkPolicy controller k3s ships, that can briefly reject new connections (cloudnativelabs/kube-router#2226; found in its source, not yet captured live). Admit the ports by number instead, one policy per number: "edge" for the API and realtime on 8080, and the new "edge-console" for the console on 3000. Each keeps both ingress rules of the old policy, so the same traffic is admitted. A unit test ties the numbers to the containerPorts of the three Deployments. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
🟢 Tier S · Ready to merge
The edge NetworkPolicy now renders separate numeric TCP-port policies for API/realtime and console, preserving the configured-source and same-release ingress rules. Tests, the security guide, and the changelog were updated for the split and its port mappings.
Note @gurkangul does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. 📂 Walkthrough · 6
Reviewed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With
networkPolicy.enabled,<fullname>-edgeselects the API, realtime and console pods and admits the named porthttp. That name is 8080 on the API and realtime and 3000 on the console. This is valid Kubernetes, but it seems to trip a race in kube-router, the NetworkPolicy controller k3s ships: for a named port with two numbers, new connections can be rejected for a moment during a policy sync (cloudnativelabs/kube-router#2226).This admits the same ports by number. A policy has one
podSelector, so it takes two policies:<fullname>-edge: API and realtime, TCP 8080<fullname>-edge-console(new): console, TCP 3000Each keeps both ingress rules of the old policy:
networkPolicy.ingress.fromon the port (any source when empty), and pods of the release on any port. So this works around kube-router#2226, with no behaviour change on other CNIs: the same traffic is admitted.containerPorts the three Deployments hard-code. A unit test now fails if a Deployment's port changes without its policy.helm upgradecreates it before it narrowsedge(Helm applies a release's resources in manifest order).builds-to-api,orchestrator,mqttandobject-storageare untouched: each of their named ports is one number.What I can and can't show:
iptables-saveoripsettrace), and #2226 has no maintainer reply yet.Bad Gatewayresponses from Traefik in front of Appwrite between 2026-11-16 07:00 and 2026-11-17 22:02 UTC. A wrapper chart has added the same numeric-port rules next toedgesince about 23:15 UTC on 2026-11-17. From 23:30 UTC to 2026-11-18 06:54 UTC: none in the client logs, and no 502 in Traefik's access log.edgeNetworkPolicy: named porthttp(8080 on api/realtime, 3000 on console) trips a kube-router race on k3s #60.Fixes #60
Testing
make testpasses locally with Helm 4.3.2:ct lint,helm lint --strictfor everyci/scenario,make unittest(261 passed),make kubeconform,make examples,make check-generated(no generated file changed) andmake check-changes.helm unittest --strict charts/appwritealso passes with Helm 3.18.6.ci/scenario before and after. Apart from the generated secrets, which differ on every render, the only difference isedge(selector without the console, port 8080/TCP) and the newedge-console.make kind-up install helm-test smoke. Our cluster runs the equivalent rules through a wrapper chart, not this branch.Checklist
make testpasses locallymake generatewas run and the generated files (values.schema.json, the chartREADME.md, theartifacthub.io/imagesannotation) are committed (nothing changed)docs/and files inexamples/updated for changes to how the chart is configured (docs/security.md; no example names the policy)[Unreleased]inCHANGELOG.mdfor user-facing changes (or theskip-changeloglabel). Noversionbump orartifacthub.io/changesedit: those happen when a release is cut, seeRELEASING.md🤖 Generated with Claude Code