Enforces ingress network policy using iptables. The controller is run on each Node as a daemonset.
Theory of Operation
For each selected pod, create a chain in the filter table with a default REJECT policy
Create rules in the FORWARD chain to intercept packets destined to pods selected by network policies. These packets are sent to the chains created in (1)
Check the source ip and destination port of the packet: if it matches the ingress rule selector and destination port, ACCEPT it.
Ports in the Ingress policy can be names: handle this (assumes Integer right now)
Delete rules that are obsoleted by changes to policies/pods selectively instead of flushing the IPtables chain. This should automatically be the case if IPSets are used
According to the NetworkPolicy documentation, ("DefaultDeny: Pods in the namespace will be inaccessible from any source except the pod’s local node.
") ingress rules do not apply to traffic originating from the same host. Not sure why this should be the case. This controller will block traffic even originating on the same host if it does not match any rule.