In Kubernetes when you run modern, microservices-based applications, you often want to control which components can communicate with each other. The principle of least privilege should be applied to how traffic can flow between pods in an Azure Kubernetes Service (AKS) cluster. The Network Policy feature in Kubernetes lets you define rules for ingress and egress traffic between pods in a cluster.
In an AKS cluster, all pods can send and receive traffic without limitations, by default. To improve security, you can define rules that control the flow of traffic. Network Policy is a Kubernetes specification that defines access policies for communication between Pods. These network policy rules are defined as YAML manifests.The network policy feature can only be enabled when the cluster is created. You can’t enable network policy on an existing AKS cluster. To create AKS cluster that supports network policy, please refer – https://docs.microsoft.com/en-us/azure/aks/use-network-policies?ocid=AID754288&wt.mc_id=CFID0471#create-an-aks-cluster-and-enable-network-policy.