thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Network Policy

A Kubernetes resource that controls allowed ingress and egress traffic for selected pods at the IP and port level.

Definition

Pods are non-isolated by default. Once a policy selects a pod for a direction, only explicitly allowed traffic is permitted. Selectors use podSelector, namespaceSelector, and ipBlock. Enforcement requires a supporting CNI.

Example

A default-deny policy with podSelector: {} and policyTypes: [Ingress] blocks all inbound traffic in a namespace.

Exam tip

Start with default deny, then allow; remember to allow DNS egress (port 53) when restricting egress.

Related terms