100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 250
A policy selects app=gateway in payments and allows ingress from matching Pods on protocol TCP, port 8443. A test sends UDP to the same numeric port. Choose THREE statements.
- The source peer selector must still match for TCP traffic.
- The policy alters the port number exposed by the container.
- All protocols share a port grant automatically.
- A separate UDP allowance would be needed for the UDP test.
- The UDP connection does not match a TCP-only allow.
- A matching source bypasses the protocol field.
Explanation
Correct Answers
A:Allowed ports alone never authorize an unmatched source.
D:TCP and UDP are independent protocol values in a policy.
E:Protocol is part of the NetworkPolicy port match.
Incorrect Answers
B:NetworkPolicy authorizes packet flows; it does not modify container listeners.
C:TCP does not imply UDP.
F:Both peer and port constraints must be satisfied.
Question 251
A NetworkPolicy `from` array contains two separate entries: one selects namespaces labeled `zone=shared`; the other selects Pods labeled `role=healthcheck` in the policy namespace. A Pod in a `zone=shared` namespace lacks `role=healthcheck`. How is it evaluated? Choose ONE answer.
- It matches the first peer; separate array entries are alternatives, not an intersection.
- It must match both peers because Kubernetes treats the array as AND.
- It is allowed only if the source uses the destination Service ClusterIP as its IP.
- It is rejected because `role=healthcheck` is mandatory for every namespace.
Explanation
Correct Answer
A:The source needs to satisfy at least one `from` peer to match the ingress rule.
Incorrect Answers
B:Separate NetworkPolicyPeer objects are ORed; AND arises from fields inside a single peer.
C:Policy peer selection is based on source namespace/Pod identity, not target Service virtual IP.
D:That label belongs to only the second alternative peer.
Question 252
A client Pod is egress-isolated and a server Pod is ingress-isolated. Only the server policy permits the client TCP/443, but the client has no egress allow rule. Does the connection succeed? Choose ONE answer.
- Yes, Kubernetes automatically adds a reverse egress rule.
- No, the client’s egress policy must also allow the flow.
- No, no two Pods may communicate when both are isolated.
- Yes, server ingress alone always suffices.
Explanation
Correct Answer
B:For isolated endpoints, both source egress and destination ingress must permit the connection.
Incorrect Answers
A:NetworkPolicy does not synthesize missing egress allowances for the initiator.
C:Communication is possible once both directional rules allow it.
D:The client’s outbound traffic remains blocked by its own egress isolation.
Question 253
An egress ipBlock allows 10.20.0.0/16 except 10.20.4.0/24, TCP/8443; app=gateway is egress-isolated in payments. Choose ONE answer.
- Every destination in 10.20.0.0/16 is allowed unconditionally.
- UDP/8443 matches a TCP-only rule.
- Traffic to 10.20.4.17 is excluded by the except range.
- A CIDR policy modifies the destination IP address.
Explanation
Correct Answer
C:That address is inside the excluded /24.
Incorrect Answers
A:The except /24 removes part of the range.
B:The allowed protocol is TCP.
D:NetworkPolicy filters allowed traffic rather than rewriting addressing.
Question 254
An incident team wants to deny all new TCP ingress to every Pod in namespace `archive` while leaving outbound connections unaffected. Which policy design accomplishes that under a NetworkPolicy-capable CNI? Choose ONE answer.
- Use `policyTypes: [Egress]` with no egress rules.
- Set only the namespace label `deny-all=true`.
- Use `podSelector: {}`, `policyTypes: [Ingress]`, and no ingress allow rules in the `archive` namespace.
- Use `podSelector: {app: nonexistent}` with empty ingress rules.
Explanation
Correct Answer
C:An empty Pod selector targets all namespace Pods, while an empty ingress list isolates all incoming traffic.
Incorrect Answers
A:An egress-only policy isolates outbound traffic, not ingress.
B:Namespace metadata alone does not create NetworkPolicy isolation.
D:It would isolate only Pods matching that label; the described namespace may have none.
Question 255
A Pod with label app=gateway declares named container port web=8080. A NetworkPolicy ingress allow uses port: web and TCP from a permitted peer. Choose ONE answer.
- The named port resolves against the selected destination Pod port name.
- Named ports authorize every TCP port on the selected Pod.
- The policy changes the Pod listener to port 80.
- The name web implicitly means TCP/80.
Explanation
Correct Answer
A:NetworkPolicy named ports reference destination container port names.
Incorrect Answers
B:They map to a specific declared port.
C:NetworkPolicy does not reconfigure the application listener.
D:The named port resolves to the Pod declaration, here 8080.
Question 256
An ingress rule has a `from:` list containing one namespaceSelector for team=ops and a separate podSelector for app=ui. Which traffic sources are selected? Choose ONE answer.
- Only app=ui Pods in team=ops namespaces.
- Only Pods satisfying both selectors in the policy namespace.
- Pods in ops-labeled namespaces OR app=ui Pods in the policy namespace.
- All Pods in every namespace.
Explanation
Correct Answer
C:Distinct from-list peers are OR alternatives; a podSelector-only peer is local to the policy namespace.
Incorrect Answers
A:That requires combining both selectors in one peer item, not separate list entries.
B:The separate peer elements do not create a joint AND condition.
D:Each peer retains its own selector constraints.
Question 257
A policy in `inventory` uses `podSelector: matchLabels: {app: api}`. Two Pods exist: one `app=api` and one `app=cron`. Which Pod becomes ingress-isolated when that policy has no ingress rules? Choose ONE answer.
- Neither Pod, because policies with zero ingress rules do not isolate anything.
- Both Pods, because every NetworkPolicy automatically selects all namespace Pods.
- Only `app=cron`, because it does not have a matching allow rule.
- Only `app=api`; `app=cron` is not selected by that policy.
Explanation
Correct Answer
D:The top-level podSelector selects the destination Pods governed by this NetworkPolicy.
Incorrect Answers
A:An empty ingress list makes selected Pods ingress-isolated.
B:NetworkPolicies scope to their configured Pod selector, not all Pods by default.
C:Unselected Pods are not isolated by this policy.
Question 258
A team creates a NetworkPolicy selecting app=gateway in payments, but the installed cluster CNI does not implement NetworkPolicy enforcement. Choose ONE answer.
- The object guarantees all traffic is denied immediately.
- The API object can exist without blocking actual packets.
- Creating a NetworkPolicy automatically replaces the CNI.
- The API server alone filters every inter-Pod packet.
Explanation
Correct Answer
B:The NetworkPolicy API requires compatible CNI enforcement.
Incorrect Answers
A:Without an enforcing CNI, traffic need not be filtered.
C:Policy objects do not install networking software.
D:NetworkPolicy is enforced by the network implementation.
Question 259
A NetworkPolicy in payments selects only Pods labeled app=gateway. A Pod loses that label during a rollout while the policy remains unchanged. Choose TWO statements.
- The unlabeled Pod no longer matches this policy podSelector.
- An arbitrary Pod name substitutes for missing label match.
- This policy cannot select Pods in another namespace directly.
- Changing Pod labels updates the policy spec automatically.
- The policy always selects every Pod in the cluster.
Explanation
Correct Answers
A:Pod label selection determines which Pods are isolated by the policy.
C:NetworkPolicy spec.podSelector selects Pods only in its own namespace.
Incorrect Answers
B:Selection uses labels, not Pod names.
D:The policy object remains unchanged; selection results change.
E:The podSelector and policy namespace limit scope.
Question 260
An ingress-isolated app=gateway Pod has a policy with ingress: [{}] (a rule with no from or ports restrictions), and only Ingress is in policyTypes. Choose THREE statements.
- The empty ingress rule allows ingress from all sources and ports.
- The rule denies all TCP but permits UDP.
- The policy does not impose egress isolation.
- An empty rule is the same as zero rules.
- A truly default-deny ingress policy would have no ingress allow rules.
- The empty ingress rule blocks Pods by their namespace name.
Explanation
Correct Answers
A:An ingress rule with omitted from and ports matches broadly.
C:Only Ingress is listed in policyTypes.
E:An empty list and one empty rule have different meanings.
Incorrect Answers
B:No protocol or port restriction is present.
D:One unconstrained rule is allow-all, not deny-all.
F:The rule has no peer filter.
Certified Kubernetes Administrator (CKA) Practice Tests