Watch
0
0
Fork
You've already forked hyperhive
0

k8s: deny ingress to every pod by default

This commit is contained in:
atlas 2026-11-27 15:10:15 +01:00 • committed by maia
commit d579c54f82

View file

@ -1190,6 +1190,28 @@ in
};
};
}
# Every pod of the namespace is selected for ingress and no rule admits
# anyone, so a pod is reachable from the node alone until a policy of its own
# admits more. The cluster's policy engine takes the union of the policies
# that select a pod and always admits the node's own addresses, so the
# kubelet's probes and the host's gateway still reach every pod. A port a pod
# opens later is closed to the other pods and to the hive bridge without a
# line here.
// {
"default-deny-ingress/networkpolicy" = {
apiVersion = "networking.k8s.io/v1";
kind = "NetworkPolicy";
metadata = {
name = "default-deny-ingress";
inherit (k8sCfg) namespace;
labels."app.kubernetes.io/part-of" = "hyperhive";
};
spec = {
podSelector = { };
policyTypes = [ "Ingress" ];
};
};
}
// lib.concatMapAttrs (_: w: w.objects) enabled;
# The image each enabled service's pod runs: what the main node imports,