Kubernetes CNI network
Do not use for app manifest authoring or Helm values. Not for service-mesh mTLS policy in depth.
Procedure
- Identify CNI (Cilium eBPF vs Calico iptables/eBPF). Overlay vs native routing vs BGP to the fabric.
- Services: ClusterIP inside, LoadBalancer via BGP (MetalLB / Cilium BGP) to the ToR, not a cloud NLB in on-prem.
- NetworkPolicy default-deny per namespace. Egress to DNS and the allowed CIDR only.
- Node MTU and kube-proxy-free mode. VXLAN fabric MTU must fit.
- Verify: a probe pod,
cilium connectivity testor calico equivalent, and a deny that still denies.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
spec:
podSelector: {}
policyTypes: [Ingress, Egress]
egress:
- to: [{namespaceSelector: {matchLabels: {name: kube-system}}}]
ports: [{port: 53, protocol: UDP}]
Anti-patterns
- Never run the cluster overlay on a fabric already doing VXLAN without MTU math.
- Do not leave egress any.
Safety
CNI swaps are a maintenance window. Policy edits are reviewed.