Kubernetes Security 101 : Egress and Ingress Network policies

An Ingress network policy rule regulates incoming traffic to a pod as we can see in the below example:

Below is a configuration Yaml file of an Ingress policy rules for traffic going towards pods with the label "wep-pod" on port 3310 from pods labeled "database-pod":

The example below adds a new rules for a certain block of IP addresses:

Adding an Egress rule to the network policy:

We added an Egress network policy to allow traffic to pods with the "database-pod" label on port 88.


Leave as a comment: