100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
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.
Question 261
A Pod is selected by a NetworkPolicy with `policyTypes: [Egress]` and `egress: []`. There is no ingress policy in its namespace. What is true about incoming connections to that Pod? Choose ONE answer.
- Ingress is denied only when the Service uses ClusterIP.
- The new policy does not isolate ingress; other network controls may still apply.
- Ingress is allowed only from Pods in the same namespace.
- All ingress is denied because any policy selects both directions.
Explanation
Correct Answer
B:Only the Egress direction is selected by this policy, so it does not itself deny inbound connections.
Incorrect Answers
A:Service type does not determine whether this policy isolates ingress.
C:There is no ingress selector rule in this policy establishing that namespace-only limit.
D:PolicyTypes explicitly limits which traffic directions the policy isolates.
Question 262
Two teams want a policy in payments that denies TCP/8443 but permits all other egress from app=gateway. They propose a NetworkPolicy with one explicit deny rule. Choose ONE answer.
- NetworkPolicy includes an explicit deny priority integer.
- The last-written policy always denies an earlier allow.
- A deny: true field is part of the standard NetworkPolicy rule syntax.
- Standard NetworkPolicy has allow rules rather than explicit deny actions.
Explanation
Correct Answer
D:There is no deny action field in the NetworkPolicy ingress or egress rule schema.
Incorrect Answers
A:Standard NetworkPolicy has no such priority rule.
B:Kubernetes network policy is not ordered firewall ACL logic.
C:The API does not define this field.
Question 263
A NetworkPolicy selecting app=gateway in payments omits policyTypes, defines one egress allow and no ingress allow. Choose ONE answer.
- A single egress allow rule grants all ingress traffic.
- Ingress isolation is included by default.
- Omitting policyTypes always means ingress and egress are unrestricted.
- The policy cannot be created without policyTypes.
Explanation
Correct Answer
B:When policyTypes is omitted, Ingress is always inferred.
Incorrect Answers
A:Ingress and egress permissions are independent.
C:API defaulting enables Ingress and optionally Egress.
D:The field has documented defaulting semantics.
Question 264
A client Pod is egress-isolated. Its egress policy allows TCP/443 only to Pods labeled `app=proxy` in namespace `gate`, selected by a namespace label. It tries to connect to a public IP with no matching policy peer. What happens? Choose ONE answer.
- Any TCP/443 connection is automatically allowed once the port matches.
- The public-IP connection is not allowed by that policy; its destination does not match the permitted Pod peer.
- External traffic is always permitted even under egress isolation.
- The Pod automatically gains access after its Service account token rotates.
Explanation
Correct Answer
B:A destination Pod selector does not implicitly permit arbitrary Internet IPs.
Incorrect Answers
A:NetworkPolicy rules require destination and port conditions when both are specified.
C:Egress policies can restrict destinations outside the cluster.
D:ServiceAccount token rotation does not change egress peer matching.
Question 265
A policy in payments allows ingress only from namespaces with label purpose=shared. The namespace named shared has no such label. Choose ONE answer.
- The policy chooses Namespaces by creation timestamp.
- A namespace name alone does not satisfy a namespaceSelector matchLabels rule.
- Pod labels alone can satisfy a missing namespace label.
- Namespace name shared automatically implies purpose=shared.
Explanation
Correct Answer
B:NamespaceSelector matches labels on Namespace objects.
Incorrect Answers
A:NamespaceSelector uses labels, not age.
C:The rule explicitly selects Namespace metadata.
D:Names are not synthesized into arbitrary label keys.
Question 266
A NetworkPolicy ingress rule permits `ipBlock.cidr: 10.2.0.0/16` with `except: [10.2.40.0/24]`. Traffic originates from 10.2.40.7. Is it covered by that peer? Choose ONE answer.
- Yes, because except applies only to DNS.
- No, that address is inside the excluded /24.
- Yes, any address in the /16 always matches.
- No, because a /16 never includes /24 addresses.
Explanation
Correct Answer
B:The except CIDR removes those addresses from the broader permitted /16 peer.
Incorrect Answers
A:NetworkPolicy ipBlock exceptions are address filters and not DNS-specific.
C:The /24 exception narrows the otherwise allowed address range.
D:The /24 is inside the /16; it is the except that excludes the source.
Question 267
An egress rule uses `ipBlock: cidr: 10.20.0.0/16, except: [10.20.8.0/24]`, permitting TCP/443. A Pod sends to 10.20.8.9. Ignoring source-NAT complications, does the destination match that IPBlock? Choose ONE answer.
- Yes; every address inside the outer /16 is always allowed.
- It depends only on the container image name.
- No; 10.20.8.9 is inside the explicitly excluded subnet.
- Yes; port 443 overrides the IPBlock exception.
Explanation
Correct Answer
C:The except CIDR is removed from the allowed 10.20.0.0/16 range.
Incorrect Answers
A:The except entry excludes a subset from the outer CIDR.
B:IPBlock matching tests network addresses, not image metadata.
D:A port condition does not cancel a destination CIDR exception.
Question 268
A Pod in payments uses hostNetwork: true. The CNI’s treatment of this Pod under NetworkPolicy is not documented. Which statements reflect the portability issue? Choose ONE answer.
- All CNIs enforce identical hostNetwork Pod selectors.
- hostNetwork Pods always obtain an ordinary separate Pod IP.
- A namespaceSelector alone always isolates node-local traffic.
- NetworkPolicy behavior for hostNetwork Pods can vary by CNI implementation.
Explanation
Correct Answer
D:Kubernetes documents implementation-dependent handling.
Incorrect Answers
A:The Kubernetes API does not guarantee this.
B:They share the node network namespace.
C:Host-network matching can be treated as node traffic.
Question 269
A NetworkPolicy rule permits TCP port 8000 through endPort 8010 for app=gateway in payments. A client tries TCP/8005 and UDP/8005. Choose TWO statements.
- UDP/8005 automatically inherits the TCP range.
- The endPort value restricts source ports, not destination ports.
- TCP/8011 is permitted because it is close to 8010.
- UDP/8005 does not match the TCP protocol.
- TCP/8005 is inside the inclusive allowed port range.
Explanation
Correct Answers
D:NetworkPolicy ranges still require the specified protocol.
E:The endPort range covers ports 8000 through 8010.
Incorrect Answers
A:Protocols are matched separately.
B:NetworkPolicy ports refer to the destination traffic port.
C:The boundary is inclusive through 8010 only.
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.
Certified Kubernetes Administrator (CKA) Practice Tests