100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 290
An egress ipBlock allows 10.20.0.0/16 except 10.20.4.0/24, TCP/5432; app=collector is egress-isolated in audit. Choose THREE statements.
- UDP/5432 matches a TCP-only rule.
- Both destination and TCP/5432 must match.
- A CIDR policy modifies the destination IP address.
- Traffic to 10.20.5.17 is inside the allowed /16 and outside the except range.
- Traffic to 10.20.4.17 is excluded by the except range.
- Every destination in 10.20.0.0/16 is allowed unconditionally.
Explanation
Correct Answers
B:An ipBlock condition does not remove the port restriction.
D:The address satisfies the outer block without matching the exclusion.
E:That address is inside the excluded /24. The superficially plausible alternative 'Every destination in 10.20.0.0/16 is allowed unconditionally' fails on a different constraint: The except /24 removes part of the range.
Incorrect Answers
A:The allowed protocol is TCP. The choice that fits these stated constraints is 'Traffic to 10.20.5.17 is inside the allowed /16 and outside the except range': The address satisfies the outer block without matching the exclusion.
C:NetworkPolicy filters allowed traffic rather than rewriting addressing. The choice that fits these stated constraints is 'Both destination and TCP/5432 must match': An ipBlock condition does not remove the port restriction.
F:The except /24 removes part of the range. The choice that fits these stated constraints is 'Traffic to 10.20.5.17 is inside the allowed /16 and outside the except range': The address satisfies the outer block without matching the exclusion.
Question 291
A policy targets `app=db` and denies all ingress to that selection. In the same namespace, a Pod labeled only `app=worker` remains reachable by peers. What explains the difference? Choose ONE answer.
- The worker is exempt because it has no Service object.
- The worker is not selected by the policy and is not isolated by that particular policy.
- All Namespace Pods are denied by any policy, so the observation is impossible.
- Only Pods with a public IP are subject to NetworkPolicy.
Explanation
Correct Answer
B:NetworkPolicy isolation is per selected Pod, not a namespace-wide firewall unless selector is empty or broad.
Incorrect Answers
A:Direct Pod traffic can still be affected by policies independent of Service existence.
C:A selective policy does not automatically isolate unrelated Pods.
D:NetworkPolicies target Pods by labels, irrespective of whether they are externally exposed.
Question 292
A policy permits ingress to Pods labeled app=exporter on named TCP port `metrics`. The destination Pod defines ports named `http` and `admin`, but does not declare a `metrics` port. Which statement identifies the correct effect? Choose ONE answer.
- The rule automatically resolves metrics to 9090.
- The policy changes the container port name to metrics.
- The named-port rule does not match a destination port on this Pod.
- Any TCP port matches because a named port is an alias for all ports.
Explanation
Correct Answer
C:The destination Pod has no container port named metrics for the NetworkPolicy port reference.
Incorrect Answers
A:Kubernetes does not assign a well-known numeric port to the arbitrary name metrics.
B:NetworkPolicy enforcement does not mutate the Pod containerPorts list.
D:Named policy ports refer to a particular declared container port name.
Question 293
A source app=collector Pod in audit is egress-isolated and destination db Pod is ingress-isolated. Source allows TCP/443 only, destination allows TCP/5432 only. Choose ONE answer.
- Pod RBAC get permission opens the network flow.
- The source egress rule prevents this TCP/5432 connection if 5432 differs from 443.
- Service DNS changes remove both NetworkPolicies.
- Allowing destination ingress bypasses all source egress restrictions.
Explanation
Correct Answer
B:An isolated source requires a matching egress allowance.
Incorrect Answers
A:API authorization and packet policy are different mechanisms.
C:DNS naming is not a policy amendment.
D:Both sides are independently enforced.
Question 294
A NetworkPolicy rule has a `ports` entry containing `port: 8080` but omits `protocol`. What transport protocol does Kubernetes interpret for that port entry? Choose ONE answer.
- Both TCP and UDP because a port number implies all protocols.
- UDP, because application port 8080 is always UDP.
- TCP, because the NetworkPolicy port protocol defaults to TCP when omitted.
- ICMP, because ICMP is the default for policy ports.
Explanation
Correct Answer
C:The NetworkPolicy API defines TCP as the default protocol for a port entry.
Incorrect Answers
A:A single port rule with default TCP does not authorize UDP.
B:Port number alone does not determine transport; omission uses TCP.
D:ICMP does not use the TCP/UDP-style port matching represented here.
Question 295
A cluster has replaced its CNI with a policy-enforcing implementation, but a DaemonSet rollout has left three nodes running the old plugin. A new NetworkPolicy seems effective on some nodes but not others. Which next action best tests the likely cause? Choose ONE answer.
- Assume API creation proves identical dataplane enforcement on all nodes.
- Edit every Pod RBAC Role to include NetworkPolicy verbs.
- Compare CNI agent rollout and actual pod connectivity on affected nodes.
- Delete all EndpointSlices to force network policy convergence.
Explanation
Correct Answer
C:Policy enforcement depends on the installed node dataplane; mixed CNI rollout can cause differing outcomes.
Incorrect Answers
A:The API accepts policy objects independently of individual node enforcement health.
B:Kubernetes API RBAC for Pods does not deploy the packet-filtering CNI.
D:Service endpoint objects do not install missing CNI agents.
Question 296
An operator applies a NetworkPolicy in `audit` with `podSelector: {}`, `policyTypes: [Egress]`, and a single egress rule allowing TCP/443 to IPBlock 192.0.2.0/24. What is true for a selected Pod reaching 198.51.100.20:443? Choose ONE answer.
- It is allowed because every HTTPS connection is exempt from egress isolation.
- It is allowed because an empty podSelector matches no Pods.
- That destination is not allowed by the shown policy because it falls outside the permitted CIDR.
- It is allowed when the source and destination use the same container image.
Explanation
Correct Answer
C:Matching TCP/443 is insufficient when the destination is outside 192.0.2.0/24.
Incorrect Answers
A:No HTTPS-specific exemption exists in standard NetworkPolicy.
B:Empty podSelector selects all Pods in that namespace.
D:Policy matching does not depend on container image equality.
Question 297
A NetworkPolicy in audit selects only Pods labeled app=collector. A Pod loses that label during a rollout while the policy remains unchanged. Choose ONE answer.
- Changing Pod labels updates the policy spec automatically.
- The unlabeled Pod no longer matches this policy podSelector.
- An arbitrary Pod name substitutes for missing label match.
- The policy always selects every Pod in the cluster.
Explanation
Correct Answer
B:Pod label selection determines which Pods are isolated by the policy. 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 policy object remains unchanged; selection results change. This policy decision is limited to selected Pods in the policy namespace and requires a matching allowed peer, traffic direction, protocol and destination port.
C:Selection uses labels, not Pod names. 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:The podSelector and policy namespace limit scope. 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 298
Two ingress NetworkPolicies select the same backend Pod: policy A permits TCP/443 from role=web; policy B permits TCP/9090 from role=metrics. Choose TWO true statements. Choose TWO answers.
- Policy B revokes everything permitted by policy A.
- TCP/443 from role=web can be allowed by policy A.
- Traffic is permitted only if both policies allow the same flow.
- Policies automatically add a matching outbound rule to every source.
- TCP/9090 from role=metrics can be allowed by policy B.
Explanation
Correct Answers
B:Ingress allowances from policies selecting the Pod are additive.
E:A second policy adds its allowed flow without replacing the first allowance.
Incorrect Answers
A:Kubernetes NetworkPolicies do not use ordered last-wins deny semantics.
C:Allows are unioned for the isolated Pod, not intersected across separate policies.
D:Destination ingress allowances do not globally alter source egress isolation.
Question 299
A policy in `audit` selects Pods labeled app=ledger and has no ingress rules, but a second policy also selects those Pods and permits TCP/9443 from Pods labeled role=watcher in the same namespace. Which connection is allowed by the combined policies, assuming normal CNI enforcement? Choose THREE statements.
- The default-deny policy always overrides every other policy.
- A role=watcher Pod in audit can reach TCP/9443 on the selected ledger Pod.
- The app=ledger Pods remain selected by both policies.
- All TCP ports are permitted because another policy exists.
- TCP/22 from the same watcher source is still denied by these stated rules.
- No ingress is possible under any circumstances when one policy has an empty ingress list.
Explanation
Correct Answers
B:Ingress allowances are additive across selecting policies; the second rule admits this peer and port.
C:Selection comes from matching podSelector labels; the second policy does not remove the first.
E:Only TCP/9443 is allowed; neither policy adds a port-22 ingress allow.
Incorrect Answers
A:Standard NetworkPolicy has no deny-overrides-allow precedence.
D:Only the second policy specified TCP/9443 and a particular peer.
F:A second selecting policy can add allowed connections.
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.
Certified Kubernetes Administrator (CKA) Practice Tests