EX280 Networking And Network Policies Practice Question
An administrator wants to configure a NetworkPolicy that allows incoming traffic only from pods with the label 'role=frontend' residing in any namespace, provided those namespaces have the label 'environment=production'. How should the namespaceSelector and podSelector be combined?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
In the same ingress 'from' array item, combining namespaceSelector and podSelector
A single ingress rule in a NetworkPolicy can contain both a namespaceSelector and a podSelector within the same 'from' array element to target specific pods in specific namespaces.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
By referencing an external ClusterRole binding with label selectors
Why it's wrong here
ClusterRole bindings are for RBAC, not NetworkPolicies.
- ✓
In the same ingress 'from' array item, combining namespaceSelector and podSelector
Why this is correct
Placing both selectors inside the same 'from' array element creates a logical AND condition.
- ✗
Using a peerSelector object that nests both labels
Why it's wrong here
peerSelector is not a valid field in Kubernetes NetworkPolicy.
- ✗
In separate ingress rules, where one rule has namespaceSelector and another has podSelector
Why it's wrong here
Separate rules act as a logical OR, which would allow any pod in production or any frontend pod anywhere, failing the requirement.
About these practice questions
One of 509 original EX280 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Red Hat exam blueprint
This EX280 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX280 exam.