CertKeen

Certified Kubernetes Administrator (CKA) · Free practice question 11 of 12

NetworkPolicy ipBlock with except

Pods in namespace export at Aysgarth Media may send traffic to the partner range 203.0.113.0/24 except the host 203.0.113.9. How is this written in an egress rule?

  1. A.ipBlock: {cidr: 203.0.113.0/24, deny: [203.0.113.9]}
  2. B.ipBlock: {cidr: 203.0.113.0/24, except: [203.0.113.9/32]}
  3. C.namespaceSelector: {cidr: 203.0.113.0/24, except: [203.0.113.9]}
  4. D.ipBlock: {cidr: 203.0.113.9/32, invert: true}
Show answer and explanation

Correct answer: B. ipBlock: {cidr: 203.0.113.0/24, except: [203.0.113.9/32]}

Why: ipBlock selects IP ranges outside the pod network, and except lists CIDRs inside that range to leave out, so a /32 removes a single host. There is no deny or invert field, and namespaceSelector selects namespaces by label rather than by IP.

More free Certified Kubernetes Administrator (CKA) questions