KCNA · Question #42
What is the role of a NetworkPolicy in Kubernetes?
The correct answer is B. The ability to classify the Pods as isolated and non isolated. A Kubernetes NetworkPolicy defines rules that control the network access to and from Pods, classifying them as either isolated or non-isolated based on these rules.
Question
What is the role of a NetworkPolicy in Kubernetes?
Options
- AThe ability to cryptic and obscure all traffic.
- BThe ability to classify the Pods as isolated and non isolated.
- CThe ability to prevent loopback or incoming host traffic.
- DThe ability to log network security events.
How the community answered
(19 responses)- A5% (1)
- B89% (17)
- C5% (1)
Why each option
A Kubernetes NetworkPolicy defines rules that control the network access to and from Pods, classifying them as either isolated or non-isolated based on these rules.
NetworkPolicy's purpose is to allow specific traffic and deny others based on rules, not to cryptically obscure all traffic.
A NetworkPolicy defines how groups of pods are allowed to communicate with each other and other network endpoints, effectively classifying pods as 'isolated' when a policy selects them, meaning they reject all traffic not explicitly allowed by the policy, or 'non-isolated' if no policy applies to them.
NetworkPolicy prevents certain incoming or outgoing traffic based on defined rules, but 'prevent loopback or incoming host traffic' is not its primary descriptive role; its scope is broader for pod-to-pod and pod-to-external communication.
While network security events can be logged by underlying CNI plugins or external tools, NetworkPolicy itself is an enforcement mechanism, not a logging tool.
Concept tested: Kubernetes NetworkPolicy functionality
Source: https://kubernetes.io/docs/concepts/services-networking/network-policies/
Topics
Community Discussion
No community discussion yet for this question.