100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 300
An ingress rule admits peers from namespaces labeled `access=partner`. An administrator removes that label from one source namespace, without editing any Pods or Policies. What should policy selection reflect after reconciliation? Choose ONE answer.
- Pods in the unlabeled source namespace no longer match that namespaceSelector peer.
- All previously permitted Pods remain permanently whitelisted.
- The API server deletes the namespace because it lost an access label.
- The destination Pod selector changes to match the source namespace.
Explanation
Correct Answer
A:NamespaceSelector evaluates current namespace metadata, not a fixed list captured at policy creation.
Incorrect Answers
B:NetworkPolicies are evaluated against current label selectors, so changing namespace labels affects matches.
C:Removing an arbitrary label has no namespace deletion semantics.
D:Source namespace labels do not rewrite the destination podSelector.
Question 301
A policy in `billing` should allow connections from app=frontend Pods **only when** they are in namespaces labeled team=payments. What `from` peer shape expresses this intersection? Choose ONE answer.
- Only podSelector without namespaceSelector.
- Two separate peer items, one per selector.
- One peer item containing both namespaceSelector and podSelector.
- Only namespaceSelector without podSelector.
Explanation
Correct Answer
C:Selectors in the same NetworkPolicyPeer combine to require both the namespace and Pod labels.
Incorrect Answers
A:A bare podSelector matches only the policy namespace, not selected other namespaces.
B:Separate peers are ORed, which allows more sources than the required intersection.
D:That allows every Pod in matching namespaces rather than only app=frontend.
Question 302
An administrator creates a Service without `spec.selector` to target an external database at a managed IP address. The Service has no ready endpoints until manually provided. What additional object is needed? Choose ONE answer.
- A ClusterRoleBinding granting create on Pods to the ServiceAccount.
- An EndpointSlice associated with the Service and populated with valid backend addresses.
- A Deployment whose Pods have any arbitrary app label.
- A PodDisruptionBudget selecting an empty Pod set.
Explanation
Correct Answer
B:Selectorless Services do not have their EndpointSlices generated from Pod labels; endpoints must be supplied.
Incorrect Answers
A:RBAC permissions do not specify where a selectorless Service sends traffic.
C:Without a Service selector, Kubernetes will not discover those Pods automatically.
D:Disruption budgets do not enumerate Service backends.
Question 303
Only Pods labeled `role=frontend` in namespace `public` are permitted to call TCP/8443 of a secured backend. A Pod changes from `role=frontend` to `role=batch`. The namespace labels stay unchanged. What changes? Choose ONE answer.
- The source Pod ceases matching the Pod label selector in that ingress allow rule.
- Its ServiceAccount must be deleted by the NetworkPolicy controller.
- Its namespace automatically changes from public to batch.
- The source retains permission because its original labels are stored in an immutable snapshot.
Explanation
Correct Answer
A:NetworkPolicy peer selectors use current Pod labels; the prior role no longer matches.
Incorrect Answers
B:NetworkPolicy does not delete ServiceAccounts when source Pod labels change.
C:A Pod label update does not move the object between namespaces.
D:NetworkPolicy label selectors are not permanent admission grants.
Question 304
A policy-capable CNI enforces a NetworkPolicy in `analytics` selecting `app=cache` destination Pods. Its ingress `from` list contains TWO separate peers: one `namespaceSelector: team=monitoring`, and a second `podSelector: role=reporter` without a namespaceSelector. Only TCP destination port 443 is allowed. The policy does not isolate egress, and no other ingress allow rules exist. Choose ONE statement.
- The policy allows TCP 444 whenever either peer matches.
- A Pod with `role=reporter` in destination namespace `analytics` may reach TCP 443.
- The two separate peers require `team=monitoring` AND `role=reporter` on the same source.
- A `role=reporter` Pod in any unrelated namespace automatically matches the bare podSelector peer.
Explanation
Correct Answer
B:A standalone podSelector peer matches source Pods in the policy namespace `analytics`.
Incorrect Answers
A:The port restriction remains TCP 443; neither peer grants a different destination port.
C:Separate list items are OR alternatives; only selectors in the same peer object are combined. This policy decision is limited to selected Pods in analytics and requires a matching allowed peer, traffic direction, protocol and destination port.
D:A podSelector-only ingress peer is namespace-local to `analytics`, not a cross-namespace selector.
Question 305
An HTTPRoute in namespace `frontends` references a Service backend in namespace `shared`, but its status reports `RefNotPermitted`. The Gateway listener already permits attaching the Route. What control is missing? Choose ONE answer.
- A ReferenceGrant in the Service namespace allowing the cross-namespace backend reference.
- An arbitrary annotation on the source Pod saying allow=true.
- A Kubernetes RoleBinding that grants node get permissions.
- A Service of type NodePort in the Route namespace.
Explanation
Correct Answer
A:Backend references across namespaces require explicit authorization from a ReferenceGrant in the referenced namespace.
Incorrect Answers
B:Pod annotations do not authorize cross-namespace HTTPRoute backend references.
C:RBAC for Node objects is not the Gateway API cross-namespace reference mechanism.
D:Changing Service exposure cannot grant a blocked cross-namespace reference.
Question 306
A policy allows clients from namespaces with BOTH `environment=prod` and `owner=finance`. Namespace `finance-test` has `owner=finance` but `environment=test`. Does its Pod match the namespaceSelector? Choose ONE answer.
- Yes; the namespace name contains finance.
- No; all matchLabels entries within the same selector must be satisfied.
- Yes; matching one label key is sufficient.
- It depends only on whether the destination Service is headless.
Explanation
Correct Answer
B:The source namespace lacks the required `environment=prod` label value.
Incorrect Answers
A:Name text is irrelevant unless the policy selector actually matches a corresponding label.
C:matchLabels is conjunctive within the selector, not any-key OR.
D:Service type does not change namespace label matching.
Question 307
An SRE wants the standard Kubernetes NetworkPolicy API to log the source identity and every denied packet for app=payments. Which assessment is accurate? Choose ONE answer.
- NetworkPolicy reports denied packets as Pod readiness conditions by default.
- Standard NetworkPolicy has no built-in per-packet denied-traffic logging API.
- Creating a ClusterRoleBinding enables packet logging automatically.
- Adding `logDenied: true` to the NetworkPolicy spec enables portable logging.
Explanation
Correct Answer
B:Policy resources describe allowed traffic; telemetry must come from the CNI, dataplane, or external tooling.
Incorrect Answers
A:Pod readiness is not a universal denied-connection counter.
C:Kubernetes API authorization cannot turn on CNI packet telemetry.
D:This field is not in the standard NetworkPolicy schema.
Question 308
A NetworkPolicy in namespace `payments-v2` selects Pods labeled `app=reporter` and specifies only `policyTypes: [Egress]`. It permits TCP egress to Pods with `role=collector` in namespaces labeled `team=platform` on port 6379, but contains no DNS egress allowance. The Pod uses cluster DNS on UDP/TCP 53; its ingress is not selected by another policy. Choose TWO statements.
- The displayed policy does not by itself isolate inbound traffic to its selected Pods.
- UDP DNS to port 53 is implicitly permitted for all egress-isolated Pods.
- Egress TCP 6379 to the matching `team=platform` and `role=collector` destination is permitted.
- The rule also permits TCP 6380 to the same matching destination.
- Every destination is reachable because egress isolation requires a matching ingress policy.
Explanation
Correct Answers
A:Only Egress appears in policyTypes, so ingress remains unaffected by this particular policy. This policy decision is limited to selected Pods in payments-v2 and requires a matching allowed peer, traffic direction, protocol and destination port (the stated test includes port 53).
C:That specific peer and TCP port 6379 are included in the egress allow rule.
Incorrect Answers
B:NetworkPolicy has no universal DNS exemption; DNS must be allowed explicitly for isolated clients. This policy decision is limited to selected Pods in payments-v2 and requires a matching allowed peer, traffic direction, protocol and destination port (the stated test includes port 53).
D:The allow list specifies destination port 6379, not 6380. This policy decision is limited to selected Pods in payments-v2 and requires a matching allowed peer, traffic direction, protocol and destination port (the stated test includes port 53).
E:Egress and ingress isolation are independent; the Egress policy restricts outgoing selected Pod connections. This policy decision is limited to selected Pods in payments-v2 and requires a matching allowed peer, traffic direction, protocol and destination port (the stated test includes port 53).
Question 309
A NetworkPolicy selecting app=collector in audit omits policyTypes, defines one egress allow and no ingress allow. Choose THREE statements.
- The policy cannot be created without policyTypes.
- The policy may deny ingress while allowing only its defined egress matches.
- Egress isolation is also inferred because an egress rule exists.
- A single egress allow rule grants all ingress traffic.
- Ingress isolation is included by default.
- Omitting policyTypes always means ingress and egress are unrestricted.
Explanation
Correct Answers
B:No ingress allow means denied ingress for selected Pods.
C:The egress list causes Egress to be defaulted into policyTypes.
E:When policyTypes is omitted, Ingress is always inferred. This policy decision is limited to selected Pods in the policy namespace and requires a matching allowed peer, traffic direction, protocol and destination port.
Incorrect Answers
A:The field has documented defaulting semantics. This policy decision is limited to selected Pods in the policy namespace and requires a matching allowed peer, traffic direction, protocol and destination port.
D:Ingress and egress permissions are independent. This policy decision is limited to selected Pods in the policy namespace and requires a matching allowed peer, traffic direction, protocol and destination port.
F:API defaulting enables Ingress and optionally Egress. This policy decision is limited to selected Pods in the policy namespace and requires a matching allowed peer, traffic direction, protocol and destination port.
Question 310
A cluster accepts and stores NetworkPolicy resources, but its CNI plugin has no NetworkPolicy enforcement support. An operator assumes the new default-deny policy is protecting Pods. What is the correct risk assessment? Choose ONE answer.
- Creating the API objects alone does not enforce isolation; deploy and verify a compatible policy-capable CNI.
- Readiness probes enforce all specified ingress restrictions instead.
- Only Pods with public IPs require a NetworkPolicy-capable CNI.
- The API server automatically inserts firewall rules in every node even without a policy CNI.
Explanation
Correct Answer
A:NetworkPolicy specifies desired traffic rules, but an enforcing network plugin must implement them.
Incorrect Answers
B:Probes test health, not arbitrary traffic-policy enforcement.
C:Pod-to-Pod isolation also depends on the dataplane plugin.
D:Standard API storage does not imply dataplane policy enforcement.
Certified Kubernetes Administrator (CKA) Practice Tests