6. Network isolation through centrally defined, label-selected policies
- Status: Accepted
- Date: 2026-04
Context
What a workspace may reach depends on the team: some need the internet only, some need internal services. Writing NetworkPolicies requires knowing the cluster network, which team administrators often do not. NetworkPolicies are namespaced, while teams have their own namespaces.
Decision
Cluster administrators write a small set of NetworkPolicies once, in the
operator namespace, labeled code.kornercloud.dev/managed=true and
code.kornercloud.dev/network-policy-id=<id>, each selecting pods with the
label netpol.code.kornercloud.dev/<id>=true. The Team controller copies
them into every team namespace and keeps the copies in sync. A
SecurityProfile lists the policy IDs that apply, and the operator sets the
matching labels on workspace pods when it creates them.
Consequences
- Policies are written by people who know the network and applied by name.
- Changing a policy updates every team at once.
- A profile can disable enforcement; the workspace then carries the
NetworkPolicyDisabledcondition, and the dashboard shows it. - Isolation is only as strong as the CNI’s NetworkPolicy implementation; see network isolation.