Kubernetes - Network isolation with NetworkPolicy
Blog post from Qovery
Kubernetes networking involves using NetworkPolicy resources to control network traffic, functioning like a firewall by allowing or denying traffic. To effectively employ NetworkPolicy, a Kubernetes Networking plugin must be installed, such as those provided by GKS, AKS, or Calico, the latter recommended for AWS with EKS. The configuration process mirrors firewall setup, initially blocking all inbound traffic and then selectively allowing necessary communications. For instance, within a "production" namespace, traffic can be configured to allow communication between pods of the same namespace or to permit external access to specific ports, like a web server on port 8000. NetworkPolicy can also restrict outbound traffic to prevent access to resources like the AWS metadata server. While useful for basic traffic filtering, NetworkPolicy alone may not offer comprehensive control over pod communications, prompting further exploration of tools like Istio for more detailed filtering in future discussions.