Let a caproni up enforce NetworkPolicy on request
Closes #44 (closed)
What changes
A caproni rig starts k3s with --disable-network-policy, so a NetworkPolicy applied to it is accepted and ignored. The flag stays the default: the bootstrap comment records that with enforcement on, the chart's redis and gitaly policies dropped webservice-to-gitaly traffic.
SIM_NETWORK_POLICY=1 on up is the opt-in.
- The bootstrap installs k3s with the controller held off through
/etc/rancher/k3s/config.yaml, installs the chart, and waits for sign-in to answer. It then removes the file, restarts k3s and waits for the node and webservice. A first-boot enforced install stalled the dev stack's first-run jobs (OpenBao would not unseal), which is why enforcement comes on last. - State and
status --jsoncarrynetwork_policyasenforcedordisabled.schema_versionis 13. uprefuses the knob on omnibus and dev before it creates a VM.gce/bases.md,docs/maintenance.mdand the changelog describe it. The skill's word budget is paid with equal cuts (40478 of 40489).scan-accept.ymlcarries the signature counts the skill scan reports for the new bootstrap lines.
No diagram: the change is one conditional and a two-step order, and the table below shows the effect.
Proof
Live, caproni on e2-standard-16, same two-pod test namespace and policies on both rigs.
| Step | Enforced rig | Default rig (control) |
|---|---|---|
| no policy | reached | reached |
| deny-all ingress | blocked | reached |
| plus allow-client policy | reached | reached |
| kube-router iptables rules | 170 | 0 |
| GitLab sign-in from outside | 200 | 200 |
All pods on the enforced rig were Running or Completed after the restart.
The engine self-test pins the default install command, the held-off enforced one, the order of the two steps, the state record and the refusals. It fails without the change.