100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 270
An ingress rule selecting app=gateway Pods in payments contains namespaceSelector: {} as the only from peer and TCP/8443. Choose THREE statements.
- An empty namespaceSelector matches all namespaces.
- The rule allows every UDP port automatically.
- namespaceSelector: {} matches no namespaces.
- An empty namespaceSelector selects only the policy namespace.
- TCP/8443 is permitted from a Pod in another namespace if no other constraints apply.
- The rule is not equivalent to a podSelector-only peer.
Explanation
Correct Answers
A:An empty label selector imposes no namespace-label restrictions.
E:The namespace source peer is unrestricted and the port matches.
F:A podSelector-only peer would match Pods just in the policy namespace.
Incorrect Answers
B:It is TCP and port-specific.
C:Empty selectors select all objects in the relevant scope.
D:The peer admits Pods from any namespace.
Question 271
Two policies select the same frontend Pods. A broad allow ingress rule permits TCP/8080 from a trusted namespace; a later policy has no ingress allow rules. Can the later policy revoke the earlier allow? Choose ONE answer.
- Yes; the newest NetworkPolicy always wins.
- No; NetworkPolicies combine allows additively, so the trusted rule remains effective.
- Yes; the empty policy deletes the earlier allow rule automatically.
- Only if the allow policy uses an Ingress controller.
Explanation
Correct Answer
B:A policy with zero allows does not override a different matching policy that allows a particular flow.
Incorrect Answers
A:NetworkPolicy has no configured priority/ordering that makes the newest one a deny rule.
C:Separate policies remain independent objects.
D:Ingress controllers are not the ordering mechanism for NetworkPolicy allow rules.
Question 272
A policy uses podSelector: {} in namespace payments, policyTypes [Ingress], and no ingress allow entries. Choose ONE answer.
- Every Pod in payments is selected for ingress isolation.
- This policy blocks all access to the API server cluster-wide.
- The policy selects only Pods with no labels.
- The policy automatically isolates egress as well.
Explanation
Correct Answer
A:An empty policy podSelector selects all Pods in that namespace.
Incorrect Answers
B:Its scope is selected Pod ingress, not cluster control plane.
C:An empty selector means match all, not label-less only.
D:Only Ingress is in policyTypes.
Question 273
An ingress rule in payments lists podSelector role=client without a namespaceSelector; the destination app=gateway is isolated for ingress. Choose ONE answer.
- The rule grants cluster-wide RBAC read permissions.
- The Pod must share a node with the destination.
- The source Pod must be in the policy namespace payments.
- Every role=client Pod in the cluster matches.
Explanation
Correct Answer
C:A peer with only podSelector is scoped to the policy namespace.
Incorrect Answers
A:NetworkPolicy is about traffic, not Kubernetes API authorization.
B:A policy peer does not require node colocation.
D:PodSelector alone is local to policy namespace.
Question 274
After adding namespace egress isolation, most DNS lookups fail. A new rule allows UDP/53 to CoreDNS; large or truncated DNS replies may still require TCP. Which enhancement is justified? Choose ONE answer.
- Increase PodDisruptionBudget minAvailable.
- Use UDP/443 because every DNS query must be HTTPS.
- Where required, permit TCP/53 as well as UDP/53 to the correct DNS destination.
- Change Service account token expiration to 24 hours.
Explanation
Correct Answer
C:DNS clients can retry over TCP; allowing only UDP may leave TCP-based resolution blocked.
Incorrect Answers
A:Disruption budgets are independent of network-policy DNS egress.
B:Ordinary cluster DNS uses port 53 unless explicitly configured otherwise.
D:Kubernetes API authentication tokens do not control DNS transport protocol.
Question 275
A team wants to allow only HTTP GET /health on app=gateway while denying POST to the same TCP/8443. They use only a standard NetworkPolicy in payments. Choose ONE answer.
- Standard NetworkPolicy cannot distinguish HTTP GET and POST.
- An ingress rule supports an HTTP methods field.
- NetworkPolicy can validate application JWT claims directly.
- Changing the namespaceSelector enables HTTP method filtering.
Explanation
Correct Answer
A:The API handles L3/L4 peer, protocol and port matching, not HTTP methods.
Incorrect Answers
B:No such field exists in standard NetworkPolicy schema.
C:Application authorization requires separate L7 controls.
D:Namespace labels cannot inspect HTTP verbs.
Question 276
A Service port is 443 and its `targetPort` is the name `https-backend`. Its selected Ready Pods declare container port `https-backend: 9443`. Which destination port is appropriate for Service forwarding? Choose ONE answer.
- UDP/53 because named target ports are resolved through DNS.
- TCP/9443 on the endpoint Pods.
- TCP/30000 because every ClusterIP uses NodePort internally.
- TCP/443 on the Pods because a Service port always equals targetPort.
Explanation
Correct Answer
B:The named targetPort resolves to the port declared with that name on each selected Pod.
Incorrect Answers
A:Named container ports are matched in Pod specifications and do not cause Service forwarding to DNS.
C:NodePort allocation is not required for an ordinary ClusterIP Service.
D:The Service front-end port and backend targetPort are independently configured.
Question 277
A NetworkPolicy egress rule permits TCP port named `metrics`; destination Pods expose container port name `metrics` on 9090. The client connects to TCP/9090 on those Pods. How should the named port be interpreted? Choose ONE answer.
- Named ports are the same as Service metadata labels.
- It always means destination TCP/80 regardless of container ports.
- The named port can resolve to the target Pod container port 9090 for matching TCP traffic.
- It allows all UDP traffic because port names omit protocol.
Explanation
Correct Answer
C:Named NetworkPolicy ports refer to named container ports on destination Pods where supported by the plugin.
Incorrect Answers
A:NetworkPolicy port names and labels are separate fields with different semantics.
B:A named port is resolved from Pod port names, not hardcoded to HTTP.
D:The rule explicitly restricts protocol to TCP.
Question 278
A policy in namespace audit selects app=collector, has policyTypes [Ingress], and ingress is omitted. No other policies apply. Choose ONE answer.
- Every Pod in audit is selected regardless of labels.
- The policy allows all TCP ingress because no ports are listed.
- Ingress to selected app=collector Pods has no allowed peers under this policy.
- This policy isolates egress DNS queries.
Explanation
Correct Answer
C:An ingress-isolated Pod with no ingress allow rules receives no permitted ingress from policy rules. The superficially plausible alternative 'This policy isolates egress DNS queries' fails on a different constraint: Ingress-only policy does not impose egress isolation.
Incorrect Answers
A:The selector requires app=collector.
B:No ingress rules means no allowed ingress. The choice that fits these stated constraints is 'Ingress to selected app=collector Pods has no allowed peers under this policy': An ingress-isolated Pod with no ingress allow rules receives no permitted ingress from policy rules.
D:Ingress-only policy does not impose egress isolation. The choice that fits these stated constraints is 'Ingress to selected app=collector Pods has no allowed peers under this policy': An ingress-isolated Pod with no ingress allow rules receives no permitted ingress from policy rules.
Question 279
An ingress rule on app=collector Pods in audit has one from peer containing namespaceSelector team=monitoring and podSelector role=collector, on TCP/5432. Choose TWO statements.
- A collector in a namespace lacking team=monitoring does not match the peer.
- Only collector-labeled Pods in monitoring-labeled namespaces meet that peer.
- Every Pod in any namespace with team=monitoring matches.
- The two selectors are alternatives because they appear in one peer object.
- A collector in any namespace can connect on all TCP ports.
Explanation
Correct Answers
A:The namespace selector is required as well.
B:Namespace and Pod selectors within one peer are ANDed. The superficially plausible alternative 'A collector in any namespace can connect on all TCP ports' fails on a different constraint: Namespace and port constraints still apply.
Incorrect Answers
C:The peer additionally requires role=collector. The choice that fits these stated constraints is 'A collector in a namespace lacking team=monitoring does not match the peer': The namespace selector is required as well.
D:Within the same peer object the constraints form an intersection. The choice that fits these stated constraints is 'A collector in a namespace lacking team=monitoring does not match the peer': The namespace selector is required as well.
E:Namespace and port constraints still apply. The choice that fits these stated constraints is 'A collector in a namespace lacking team=monitoring does not match the peer': The namespace selector is required as well.
Question 280
An ingress allow list for app=collector in audit has two distinct from list items: namespaceSelector team=finance, and podSelector role=api. It allows TCP/5432. Choose THREE statements.
- Either distinct peer entry can satisfy the from condition.
- A Pod labeled role=api in namespace audit can match the podSelector peer.
- A Pod from any namespace labeled team=finance can match the namespaceSelector peer.
- Both selectors must match the same Pod.
- The rule allows UDP/5432 because TCP is listed.
- role=api in a random other namespace matches the podSelector-only peer.
Explanation
Correct Answers
A:Separate from array elements are OR alternatives. The superficially plausible alternative 'The rule allows UDP/5432 because TCP is listed' fails on a different constraint: NetworkPolicy protocol matching distinguishes TCP and UDP.
B:A podSelector-only peer is scoped to the policy namespace.
C:That list element selects the namespace independently of its Pod role.
Incorrect Answers
D:The selectors are in separate peer list items, not a combined peer. The choice that fits these stated constraints is 'A Pod from any namespace labeled team=finance can match the namespaceSelector peer': That list element selects the namespace independently of its Pod role.
E:NetworkPolicy protocol matching distinguishes TCP and UDP. The choice that fits these stated constraints is 'A Pod labeled role=api in namespace audit can match the podSelector peer': A podSelector-only peer is scoped to the policy namespace.
F:A podSelector-only peer is local to the policy namespace. The choice that fits these stated constraints is 'A Pod labeled role=api in namespace audit can match the podSelector peer': A podSelector-only peer is scoped to the policy namespace.
Certified Kubernetes Administrator (CKA) Practice Tests