Working with NetworkPolicy
As a resource of Kubernetes, NetworkPolicy uses label selectors to configure the firewall of Pods from infrastructure level. Without a specified NetworkPolicy, any Pod in the same cluster can communicate with each other by default. On the other hand, once a NetworkPolicy with rules is attached to a Pod, either it is for ingress or egress, or both, and all traffic that doesn't follow the rules will be blocked.
Before demonstrating how to build a NetworkPolicy, we should make sure the network plugin in Kubernetes cluster supports it. There are several CNIs that support NetworkPolicy: Calico, Contive, Romana (https://github.com/romana/kube), Weave Net (https://github.com/weaveworks/weave), Trireme (https://github.com/aporeto-inc/trireme-kubernetes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access