100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 240
During a remediation drill, the team evaluates the safe next steps and their consequences. A finite batch task needs successful completions and should stop when the requested number is reached, unlike a continuously running web service Context: the affected environment is `payments` and the component is `controller`. Identify only claims supported by this evidence. Choose THREE statements.
- Use a PersistentVolume reclaimPolicy as the batch completion counter.
- Use a Deployment with replicas equal to desired completions.
- Set restartPolicy Always in a Job Pod template to mark completion.
- Specify a valid restartPolicy such as Never or OnFailure in its Pod template.
- Inspect Job status for succeeded/failed completions.
- Use a Job with completions/parallelism appropriate to the batch task.
Explanation
Correct Answers
D:Job Pod templates allow Never or OnFailure rather than Always.
E:Job status reports batch progress and conditions such as complete or failed.
F:Jobs track successful Pod completions instead of continuously maintaining available serving Pods.
Incorrect Answers
A:volume reclamation is unrelated to succeeded Job Pod counts.
B:Deployments continuously reconcile serving replica count and do not model finished work.
C:Job Pod templates require Never or OnFailure; Always is not valid for Job work Pods.
Question 241
A namespace has no NetworkPolicies. A security team adds a policy with `podSelector: {}` and `policyTypes: [Egress]` but no egress rules. What changes for Pods in that namespace when the CNI implements NetworkPolicy? Choose ONE answer.
- All ingress connections are denied while outgoing connections remain open.
- All IP packets become exempt because there are no rule entries.
- All selected Pods become isolated for egress with no allowed egress destinations from that policy.
- Only Pods with the label `app=api` are selected.
Explanation
Correct Answer
C:An empty egress allow list isolates outgoing connections; incoming traffic is unaffected by an egress-only policy.
Incorrect Answers
A:Only Egress is in policyTypes; the new policy does not isolate incoming traffic.
B:No egress entries means no traffic is allowed by this isolation policy, not an allow-all shortcut.
D:An empty podSelector matches all Pods within the namespace, not a particular application.
Question 242
A policy in namespace payments selects app=gateway, has policyTypes [Ingress], and ingress is omitted. No other policies apply. Choose ONE answer.
- Every Pod in payments is selected regardless of labels.
- Ingress to selected app=gateway Pods has no allowed peers under this policy.
- This policy isolates egress DNS queries.
- The policy allows all TCP ingress because no ports are listed.
Explanation
Correct Answer
B:An ingress-isolated Pod with no ingress allow rules receives no permitted ingress from policy rules.
Incorrect Answers
A:The selector requires app=gateway.
C:Ingress-only policy does not impose egress isolation.
D:No ingress rules means no allowed ingress.
Question 243
An ingress rule on app=gateway Pods in payments has one from peer containing namespaceSelector team=monitoring and podSelector role=collector, on TCP/8443. Choose ONE answer.
- Every Pod in any namespace with team=monitoring matches.
- A collector in any namespace can connect on all TCP ports.
- The two selectors are alternatives because they appear in one peer object.
- Only collector-labeled Pods in monitoring-labeled namespaces meet that peer.
Explanation
Correct Answer
D:Namespace and Pod selectors within one peer are ANDed.
Incorrect Answers
A:The peer additionally requires role=collector.
B:Namespace and port constraints still apply.
C:Within the same peer object the constraints form an intersection.
Question 244
Two ingress NetworkPolicies select the same database Pods. The first permits TCP/5432 from `app=api`; the second permits TCP/5432 from `app=metrics`. A client Pod has only `app=metrics` and its egress is allowed. Which result follows? Choose ONE answer.
- Traffic from the metrics Pod may reach TCP/5432 because allows from multiple policies are combined.
- The destination must match both client labels `app=api` and `app=metrics`.
- The first policy always overrides the second policy.
- The new policy automatically deletes the old policy.
Explanation
Correct Answer
A:Ingress NetworkPolicy allow rules are additive; a second matching policy can allow another source.
Incorrect Answers
B:The sources are alternatives across separate ingress rules, not simultaneous requirements.
C:There is no last-wins or first-wins ordering between additive NetworkPolicies.
D:Independent NetworkPolicy objects coexist until changed or removed explicitly.
Question 245
An ingress allow list for app=gateway in payments has two distinct from list items: namespaceSelector team=finance, and podSelector role=api. It allows TCP/8443. Choose ONE answer.
- The rule allows UDP/8443 because TCP is listed.
- Both selectors must match the same Pod.
- role=api in a random other namespace matches the podSelector-only peer.
- Either distinct peer entry can satisfy the from condition.
Explanation
Correct Answer
D:Separate from array elements are OR alternatives.
Incorrect Answers
A:NetworkPolicy protocol matching distinguishes TCP and UDP.
B:The selectors are in separate peer list items, not a combined peer.
C:A podSelector-only peer is local to the policy namespace.
Question 246
A namespace has a default-deny egress NetworkPolicy. Applications can contact approved IPs but DNS lookups fail. Which additional allowed flow is most directly required? Choose ONE answer.
- RBAC get on ConfigMaps for all Pods.
- A new Deployment replica without a DNS rule.
- Ingress on an unrelated Pod port.
- Egress to the actual DNS resolver on its required UDP/TCP DNS ports.
Explanation
Correct Answer
D:Egress isolation blocks DNS unless an explicit egress allowance reaches CoreDNS or another configured resolver.
Incorrect Answers
A:API authorization does not open egress packets to DNS.
B:More replicas inherit the same egress isolation and will not restore DNS.
C:Ingress to the application does not authorize its outbound DNS queries.
Question 247
An ingress peer lists `namespaceSelector: matchLabels: {team: payments}` and `podSelector: matchLabels: {role: client}` in the SAME `from` entry. A Pod labeled `role=client` runs in namespace `team=analytics`. Is it an allowed source? Choose ONE answer.
- No; the peer requires both the namespace label and Pod label to match together.
- Yes; matching the Pod label alone is sufficient.
- The NetworkPolicy grants access only if both Pods share a ServiceAccount.
- Yes; any Pod in any namespace is allowed by a namespaceSelector key.
Explanation
Correct Answer
A:Selectors in the same NetworkPolicyPeer constrain the selected namespace and Pod simultaneously.
Incorrect Answers
B:Pod and namespace selectors in one peer are an intersection, not a logical OR.
C:ServiceAccounts are not part of the documented namespaceSelector/podSelector test.
D:The namespaceSelector is constrained to `team=payments`, which the source namespace does not satisfy.
Question 248
A NetworkPolicy in payments selects app=gateway, policyTypes [Egress], and allows only TCP/8443 to an application peer. The selected Pod uses CoreDNS on UDP/53. Choose ONE answer.
- UDP/53 DNS traffic is not allowed by the stated egress rule.
- All DNS is exempt from NetworkPolicy.
- TCP/8443 to the app permits UDP/53 to all destinations.
- The ingress rule implicitly allows UDP/53.
Explanation
Correct Answer
A:NetworkPolicy has no automatic DNS exception.
Incorrect Answers
B:No universal DNS bypass exists.
C:Ports, protocols, and destinations are separately matched.
D:This policy contains no ingress rule and egress is independent.
Question 249
Two NetworkPolicies select the same app=gateway Pods in payments. One allows TCP/443 ingress from role=frontend; the other allows TCP/8443 ingress from role=monitor. Choose TWO statements.
- A monitoring Pod may connect on TCP/8443 when its peer matches.
- Allowing TCP/443 automatically allows SSH port 22.
- The policies process a first-match deny rule for everything else.
- Either policy can contribute a matching ingress allow.
- The last-created NetworkPolicy overwrites the first.
Explanation
Correct Answers
A:The second policy explicitly allows that peer and port.
D:NetworkPolicy allows are additive, not priority-ordered.
Incorrect Answers
B:The permitted ports are specific.
C:NetworkPolicy has no ordered explicit deny rules.
E:Kubernetes policy rules are additive across selecting policies.
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.
Certified Kubernetes Administrator (CKA) Practice Tests