View Full Linux Foundation KCNA Exam Dumps and Practice Test Dumps.
Question 301
Which taint effect prevents new Pods from being scheduled onto a node unless they tolerate the taint?
- NoExecute
- NoSchedule
- PreferNoSchedule
- AllowSchedule
Correct Answer: 2
Explanation
The NoSchedule taint effect prevents Kubernetes from scheduling new Pods onto a node unless those Pods have a matching toleration. This mechanism is useful when administrators want to reserve nodes for particular workloads or keep general workloads away from specialized infrastructure. PreferNoSchedule is a softer preference that tells the scheduler to avoid placing Pods on the node when possible, but it does not strictly prevent scheduling. NoExecute has an additional effect on existing Pods. Taints and tolerations therefore provide an important mechanism for controlling workload placement across cluster nodes.
Question 302
Which taint effect can cause existing Pods without a matching toleration to be removed from a node?
- NoSchedule
- PreferNoSchedule
- NoExecute
- RemovePod
Correct Answer: 3
Explanation
The NoExecute taint effect affects both scheduling and existing Pods. When a node has a NoExecute taint, Pods that do not have a matching toleration can be evicted from that node. Pods with an appropriate toleration may remain for the duration specified by tolerationSeconds, if configured. NoSchedule primarily prevents new scheduling, while PreferNoSchedule expresses a preference rather than a strict restriction. NoExecute is therefore useful when workloads must be actively removed from a node unless they explicitly tolerate the node condition.
Question 303
What does a Pod toleration allow a Pod to do when a matching taint exists on a node?
- Ignore all resource limits
- Access every Namespace
- Bypass container image requirements
- Be considered for scheduling onto the tainted node
Correct Answer: 4
Explanation
A toleration allows a Pod to tolerate a matching taint on a node. This means the taint does not automatically prevent the Pod from being considered for scheduling there, depending on the taint effect and other scheduling requirements. A toleration does not force the scheduler to place the Pod on that node. It simply removes the particular taint as a blocking condition. Resource limits, Namespace permissions, and image requirements are controlled by other Kubernetes mechanisms. Tolerations are commonly used with specialized nodes that are reserved for particular workloads.
Question 304
Which scheduling mechanism directly specifies that a Pod should run on nodes having a particular label?
- nodeSelector
- Service selector
- ResourceQuota
- ConfigMap
Correct Answer: 1
Explanation
nodeSelector provides a simple way to constrain a Pod to nodes containing specific labels. For example, a Pod can specify a nodeSelector requiring a label such as disktype=ssd. The scheduler then considers only nodes matching that requirement. Service selectors perform a different function by selecting Pods for network traffic. ResourceQuota limits aggregate resource consumption, while ConfigMap stores configuration. nodeSelector is therefore appropriate when a straightforward label-based node placement requirement is sufficient and more advanced affinity rules are not necessary.
Question 305
Which Kubernetes feature provides more expressive rules for selecting nodes than a simple nodeSelector?
- Service discovery
- Node affinity
- ConfigMap
- ReplicaSet
Correct Answer: 2
Explanation
Node affinity provides more expressive scheduling rules than nodeSelector. It allows administrators to define required or preferred relationships between Pods and node labels. Required affinity can make a condition mandatory, while preferred affinity expresses a scheduling preference. This flexibility is useful when workloads need to target specific hardware, geographic zones, operating systems, or other node characteristics. Services use selectors to identify Pods for networking, ConfigMaps store configuration, and ReplicaSets maintain Pod replicas. Node affinity is therefore a flexible mechanism for controlling workload placement.
Question 306
Which scheduling feature helps distribute Pods across failure domains such as zones or nodes?
- Pod topology spread constraints
- ConfigMap
- ServiceAccount
- ResourceQuota
Correct Answer: 1
Explanation
Pod topology spread constraints help distribute Pods across defined topology domains such as nodes, availability zones, or other labeled failure domains. This can improve application availability by avoiding excessive concentration of replicas in one location. Administrators can define constraints that describe how evenly workloads should be distributed. ConfigMaps provide configuration, ServiceAccounts provide workload identities, and ResourceQuotas control aggregate resource consumption. Topology spread constraints are particularly useful for highly available applications where replicas should not all depend on the same node or failure domain.
Question 307
Which Kubernetes scheduling concept is commonly used to keep certain Pods apart from each other?
- ResourceQuota
- Pod anti-affinity
- ConfigMap
- Service
Correct Answer: 2
Explanation
Pod anti-affinity allows administrators to express rules that discourage or prevent certain Pods from being scheduled close to other Pods matching specified label selectors. This can be useful for spreading replicas across nodes or zones to reduce the impact of node failures. For example, replicas of a highly available application can be configured so that multiple replicas do not share the same node. ResourceQuota manages aggregate resource consumption, ConfigMap stores configuration, and Service provides networking. Pod anti-affinity therefore focuses specifically on relationships between Pod placement locations.
Question 308
Which resource unit is commonly used to represent a fraction of a CPU in Kubernetes?
- Gi
- Mi
- m
- Ki
Correct Answer: 3
Explanation
The letter m represents millicpu units in Kubernetes. One CPU is equivalent to 1000m, so a request of 500m represents approximately half of one CPU. CPU resources can be specified using whole CPU values or millicpu quantities. Units such as Mi and Gi are commonly associated with memory quantities, while Ki represents kibibytes. Understanding resource units is important when defining container requests and limits because Kubernetes uses these values for scheduling and resource management decisions.
Question 309
What can happen when a container exceeds its configured memory limit?
- The container may be terminated due to an out-of-memory condition
- Kubernetes automatically increases the memory limit
- The container becomes a privileged container
- The Pod is automatically moved to another Namespace
Correct Answer: 1
Explanation
If a container exceeds its configured memory limit, it can be terminated by the system because of an out-of-memory condition. Kubernetes does not automatically increase the configured memory limit simply because the application requires more memory. The exact behavior can depend on node conditions and workload configuration, but memory limits are enforced differently from CPU limits. CPU usage above a limit is generally throttled, while excessive memory consumption can result in termination. Appropriate resource requests and limits should therefore be selected based on realistic application requirements.
Question 310
Which Kubernetes QoS class is typically assigned when every container in a Pod has CPU and memory requests and limits set, with requests equal to limits?
- BestEffort
- Burstable
- Guaranteed
- Priority
Correct Answer: 3
Explanation
A Pod can receive the Guaranteed Quality of Service class when its containers have both CPU and memory requests and limits configured appropriately, with each request equal to its corresponding limit. Guaranteed workloads generally receive stronger resource guarantees compared with lower QoS classes during resource pressure. BestEffort applies when no requests or limits are specified, while Burstable applies to many configurations that fall between these conditions. QoS classification helps Kubernetes make decisions about workload behavior during resource pressure on a node.
Question 311
Which Kubernetes QoS class generally applies to a Pod that has no CPU or memory requests and limits configured?
- Guaranteed
- Burstable
- BestEffort
- Critical
Correct Answer: 3
Explanation
A Pod generally receives the BestEffort QoS class when none of its containers specify CPU or memory requests or limits. Such workloads have fewer resource guarantees than Pods in the Guaranteed or Burstable classes. During severe node resource pressure, BestEffort workloads can be more vulnerable to eviction. This classification does not mean the Pod cannot run; it describes how Kubernetes categorizes its resource configuration. Administrators should understand QoS classes when designing workloads because resource requests and limits influence scheduling and behavior during resource contention.
Question 312
Which QoS class commonly applies when a Pod has some resource requests or limits configured but does not meet the requirements for Guaranteed?
- Burstable
- BestEffort
- Guaranteed
- Static
Correct Answer: 1
Explanation
The Burstable QoS class commonly applies when a Pod has CPU or memory requests and limits configured but does not satisfy the conditions required for Guaranteed. For example, a Pod might specify a memory request without setting an equal memory limit. Burstable workloads receive more resource information than BestEffort workloads but do not have the same classification as Guaranteed Pods. Kubernetes uses QoS classifications when managing resources and responding to resource pressure. Properly configured requests and limits can therefore help workloads receive more predictable resource management.
Question 313
Which probe determines whether a container is ready to receive network traffic?
- Startup probe
- Readiness probe
- Liveness probe
- Resource probe
Correct Answer: 2
Explanation
A readiness probe determines whether a container is ready to receive traffic. When a readiness check fails, Kubernetes can remove the Pod from the endpoints used by Services, preventing traffic from being sent to an application that is not currently ready. A readiness probe does not normally restart the container. A liveness probe is used to determine whether a container should be restarted, while a startup probe helps handle slow-starting applications. Readiness checks are therefore important for reliable traffic management during application startup and temporary unavailability.
Question 314
Which probe is designed to determine whether a container should be restarted because it is considered unhealthy?
- Readiness probe
- Startup probe
- Liveness probe
- NetworkPolicy
Correct Answer: 3
Explanation
A liveness probe is used to determine whether a running container is still healthy enough to continue operating. If the configured liveness check repeatedly fails according to the probe thresholds, Kubernetes can restart the container. This is useful for applications that may become stuck or otherwise unable to recover without a restart. Readiness probes control whether traffic should be sent to a Pod, while startup probes help protect slow-starting applications from premature liveness failures. Liveness probes therefore focus primarily on detecting conditions that require container recovery.
Question 315
Which probe is particularly useful for an application that requires significant time to start before liveness checking should begin?
- Startup probe
- Readiness probe
- ResourceQuota
- Service probe
Correct Answer: 1
Explanation
A startup probe is designed for applications that may require substantial time to initialize. Kubernetes can use the startup probe to determine when the application has successfully started before allowing other probe behavior, such as liveness checking, to take effect. This prevents a slow-starting application from being incorrectly restarted because its liveness endpoint was not ready quickly enough. Readiness probes address traffic availability, while ResourceQuota controls Namespace-level resource consumption. Startup probes are therefore especially useful for applications with long or unpredictable initialization processes.
Question 316
Which container type runs before the main application containers and must complete successfully before they start?
- Sidecar container
- Init container
- Ephemeral container
- Registry container
Correct Answer: 2
Explanation
An init container runs before the main application containers in a Pod. Init containers can perform setup tasks such as preparing files, waiting for dependencies, or initializing configuration. Kubernetes runs init containers in order, and each must complete successfully before the next one starts and before the main containers are launched. This makes them useful for initialization logic that should happen only before the application begins normal execution. Regular application containers are designed for ongoing workloads, while init containers have a distinct startup-oriented lifecycle.
Question 317
What happens to an emptyDir volume when the Pod that uses it is removed?
- It becomes a PersistentVolume automatically
- Its data is normally deleted
- Its contents are moved to etcd
- It remains permanently available to all Pods
Correct Answer: 2
Explanation
An emptyDir volume is created when a Pod is assigned to a node and provides temporary storage that can be shared among containers within that Pod. Its contents normally exist for the lifetime of the Pod. When the Pod is removed from the node, the emptyDir data is deleted. It is therefore suitable for temporary files, caching, and sharing data between containers in the same Pod, but it should not be used when data must survive Pod deletion. PersistentVolumes and PersistentVolumeClaims are designed for longer-lived persistent storage.
Question 318
Which Kubernetes object can expose a Service using an external load balancer when supported by the environment?
- ClusterIP Service
- NodePort Service
- LoadBalancer Service
- Headless Service
Correct Answer: 3
Explanation
A Service of type LoadBalancer can request an external load balancer from an infrastructure provider when the Kubernetes environment supports that capability. This provides an externally reachable endpoint for the Service and can be useful for applications that need to accept traffic from outside the cluster. ClusterIP provides internal cluster access, NodePort exposes a port on nodes, and a headless Service does not provide a conventional cluster virtual IP. LoadBalancer is therefore the Service type commonly associated with external load-balancing functionality.
Question 319
Which Kubernetes Service type exposes a service on a port that is allocated from a range on each node?
- ClusterIP
- ExternalName
- LoadBalancer
- NodePort
Correct Answer: 4
Explanation
A NodePort Service exposes the Service on a specific port across the nodes in the cluster. External clients can reach the service using a node address and the assigned NodePort, subject to network configuration and firewall rules. NodePort also typically creates the underlying ClusterIP behavior. ClusterIP is primarily for internal access, LoadBalancer can integrate with an external load-balancing system, and ExternalName maps a Service to an external DNS name. NodePort is therefore useful when access through node-level ports is required.
Question 320
Which Kubernetes Service type is normally used for internal cluster communication and receives a stable virtual IP?
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
Correct Answer: 1
Explanation
ClusterIP is the default Kubernetes Service type and provides a stable virtual IP for internal communication within the cluster. Other workloads can access the Service without needing to know the changing IP addresses of individual Pods. Kubernetes uses the Service selector to identify the appropriate backend Pods and route traffic to them. NodePort additionally exposes a port on cluster nodes, while LoadBalancer can provide external load-balancing functionality. ExternalName instead maps a Service to an external DNS name. ClusterIP is therefore the standard choice for internal Service-to-Service communication.