CNCF CKA Practice Test Questions and Exam Dumps Part10 Q181-200

View Full CNCF CKA Exam Dumps and Practice Test Dumps

 

Question 181

Which command displays recent cluster events?

  1. kubectl logs
  2. kubectl events
  3. kubectl records
  4. kubectl activity

Correct Answer: 2

Explanation:

The kubectl events command displays Kubernetes Event objects and is useful for investigating recent cluster activity. Events can reveal scheduling failures, image-pull problems, container lifecycle changes, and other operational conditions. Administrators can filter events by namespace or other criteria when narrowing down a problem. Events are especially valuable during troubleshooting because they provide contextual information about actions taken by Kubernetes components. They complement, rather than replace, application logs and detailed resource inspection.

Question 182

Which kubeadm command initializes a control plane?

  1. kubeadm start
  2. kubeadm create
  3. kubeadm setup
  4. kubeadm init

Correct Answer: 4

Explanation:

kubeadm init initializes a Kubernetes control-plane node. During initialization, kubeadm performs several setup operations, including generating certificates, configuring control-plane components, and preparing the cluster for administration. After initialization, administrators typically configure kubectl access using the generated kubeconfig information. Worker nodes can subsequently join the cluster using an appropriate join command. In CKA administration tasks, understanding kubeadm is useful for cluster bootstrap, recovery, and control-plane maintenance scenarios.

Question 183

Which field prevents a Pod from being evicted during voluntary disruption?

  1. priorityClassName
  2. disruptionPolicy
  3. safeEviction
  4. evictionProtection

Correct Answer: 1

Explanation:

priorityClassName assigns a Pod to a PriorityClass, which influences scheduling and preemption behavior. It does not directly guarantee protection from voluntary disruption. A PodDisruptionBudget is the Kubernetes mechanism used to limit voluntary disruptions for selected workloads. This distinction is important because Pod priority and disruption protection address different scheduling and availability concerns. Priority affects how workloads are treated when scheduling resources are constrained, while disruption budgets help maintain application availability during planned Pod evictions.

Question 184

Which command displays a node’s allocated resource details?

  1. kubectl node-resources
  2. kubectl resource nodes
  3. kubectl describe node
  4. kubectl inspect capacity

Correct Answer: 3

Explanation:

kubectl describe node provides detailed information about a node, including capacity, allocatable resources, conditions, taints, labels, and allocated resources. This information is useful when investigating scheduling failures or resource pressure. The output can help determine whether a node has enough CPU, memory, or Pod capacity for additional workloads. Kubernetes scheduling considers resource requests rather than merely current utilization, so reviewing the node’s allocated resources can explain why a seemingly underused node may still reject a new Pod.

Question 185

Which storage mode allows multiple nodes to write to a volume?

  1. ReadOnlyMany
  2. ReadWriteMany
  3. ReadWriteOnce
  4. WriteOnlyMany

Correct Answer: 2

Explanation:

ReadWriteMany, commonly abbreviated RWX, allows a PersistentVolume to be mounted with read-write access by multiple nodes when the underlying storage implementation supports it. This mode is useful for workloads that need shared writable storage across different Pods running on separate nodes. Not every storage backend supports RWX, so administrators must verify the capabilities of the provisioner. ReadWriteOnce generally permits read-write mounting from a single node, while ReadOnlyMany provides read-only access across multiple nodes.

Question 186

Which command can inspect container runtime information through CRI?

  1. crictl info
  2. runtimectl show
  3. kubectl runtime
  4. containerctl inspect

Correct Answer: 1

Explanation:

crictl info communicates with the container runtime through the Container Runtime Interface and displays runtime information. crictl is particularly useful for troubleshooting nodes when Kubernetes-level commands do not provide enough detail. Administrators can also use other crictl commands to inspect containers, images, and Pods directly at the runtime layer. This makes it valuable when investigating problems involving container creation, image retrieval, or runtime behavior on a worker node.

Question 187

Which object can specify a default namespace for kubectl operations?

  1. Role
  2. Context
  3. Service
  4. NamespacePolicy

Correct Answer: 2

Explanation:

A kubeconfig context can specify a default namespace along with a cluster and user. When that context is active, namespace-scoped kubectl commands use the configured namespace unless another namespace is explicitly provided. This can simplify repeated administrative work within a particular environment. Contexts are especially useful when administrators manage multiple clusters or namespaces. Checking the active context and its namespace before executing destructive commands is a practical way to reduce accidental operations against the wrong environment.

Question 188

Which command removes all completed Pods matching a workload selector?

  1. kubectl cleanup
  2. kubectl prune
  3. kubectl delete
  4. kubectl purge

Correct Answer: 3

Explanation:

The kubectl delete command removes Kubernetes resources, including Pods that have completed or failed. Administrators can combine resource selection options to target specific objects rather than deleting unrelated workloads. For completed batch workloads, cleanup is often performed to prevent unnecessary accumulation of old Pods. Before deleting resources, administrators should verify the selected objects carefully because deletion is an actual change to cluster state. Controllers such as Jobs may also influence whether replacement resources are created.

Question 189

Which field defines the namespace containing a namespaced object?

  1. metadata.namespace
  2. spec.namespace
  3. object.scope
  4. resource.namespace

Correct Answer: 1

Explanation:

The metadata.namespace field identifies the namespace associated with a namespaced Kubernetes object. Namespaces provide logical boundaries for many resources, allowing teams or applications to separate workloads within the same cluster. If a manifest omits the namespace, Kubernetes may use the namespace supplied through the command context or default behavior. Cluster-scoped resources, such as Nodes, do not use this field in the same way. Correct namespace placement is important when applying manifests and troubleshooting resource visibility.

Question 190

Which controller manages completed batch workloads?

  1. DaemonSet
  2. Deployment
  3. StatefulSet
  4. Job

Correct Answer: 4

Explanation:

A Job creates and manages Pods that are expected to run to successful completion. Unlike Deployments, which maintain continuously running application replicas, Jobs focus on finite tasks. A Job can be configured for a specific number of completions and parallel executions. Once the required successful completions are achieved, the Job reaches completion rather than continuously maintaining active Pods. Jobs are commonly used for database migrations, batch processing, administrative tasks, and other workloads with a defined beginning and end.

Question 191

Which command displays the namespace associated with the active context?

  1. kubectl config current-namespace
  2. kubectl config view –minify
  3. kubectl namespace current
  4. kubectl context namespace

Correct Answer: 2

Explanation:

kubectl config view –minify can display the configuration associated with the active context, including its configured namespace when one is explicitly set. This is useful when verifying which environment and namespace kubectl will target. There is no standard kubectl config current-namespace command. Checking kubeconfig information is especially important before modifying resources because an administrator may have several contexts with different namespaces and clusters.

Question 192

Which resource enables a Pod to use a node-local file path?

  1. localVolume
  2. hostPath
  3. nodeStorage
  4. pathVolume

Correct Answer: 3

Explanation:

A hostPath volume mounts a file or directory from the node’s filesystem into a Pod. This can be useful for specialized node-level workloads, but it introduces a dependency on the particular node’s filesystem and configuration. Because of this dependency, hostPath should be used carefully for ordinary applications. If a Pod moves to another node, the expected path or data may not exist there. Node-local storage therefore requires deliberate scheduling and operational planning.

Question 193

Which resource limits the number of Pods disrupted simultaneously?

  1. PodDisruptionBudget
  2. ResourceQuota
  3. LimitRange
  4. DisruptionLimit

Correct Answer: 1

Explanation:

A PodDisruptionBudget specifies the amount of voluntary disruption that a selected group of Pods can tolerate. It can define a minimum available count or a maximum number of unavailable replicas. This helps preserve application availability during administrative operations such as node maintenance and controlled evictions. A PodDisruptionBudget does not prevent unexpected failures caused by hardware problems or resource exhaustion. It is therefore an availability safeguard for voluntary disruptions rather than a general Pod failure-prevention mechanism.

Question 194

Which command shows container logs from the previous instance?

  1. kubectl logs –old
  2. kubectl logs –history
  3. kubectl logs –previous
  4. kubectl logs –restart

Correct Answer: 3

Explanation:

The –previous option with kubectl logs retrieves logs from the previous terminated instance of a container. This is particularly useful when a container repeatedly crashes and restarts because the current instance may have little or no useful output yet. Reviewing the previous container’s logs can reveal startup failures, configuration errors, or application crashes that occurred immediately before the restart. It is an important troubleshooting technique for workloads experiencing repeated container restarts.

Question 195

Which policy determines whether a Pod can be scheduled onto a tainted node?

  1. nodeSelector
  2. affinity
  3. toleration
  4. priorityClass

Correct Answer: 3

Explanation:

A toleration allows a Pod to remain eligible for scheduling on a node with a matching taint. Taints are applied to nodes to repel Pods unless they explicitly tolerate the corresponding condition. A toleration does not require the Pod to use that node; it simply removes the taint-based restriction. Additional scheduling rules may still determine placement. This mechanism is commonly used for specialized nodes, dedicated workloads, and nodes that require controlled workload placement.

Question 196

Which Kubernetes component runs containers on each worker node?

  1. kube-scheduler
  2. kubelet
  3. kube-apiserver
  4. controller manager

Correct Answer: 2

Explanation:

The kubelet runs on each Kubernetes node and is responsible for ensuring that containers described by assigned Pods are running and healthy according to the Pod specification. It communicates with the container runtime through the Container Runtime Interface. The kubelet also reports node and workload status back to the control plane. It does not decide where Pods should run; scheduling decisions are made by the kube-scheduler. This separation allows the control plane to manage placement while nodes handle actual workload execution.

Question 197

Which Service behavior distributes traffic across selected endpoints?

  1. Endpoint balancing
  2. Replica spreading
  3. Service load distribution
  4. Pod allocation

Correct Answer: 3

Explanation:

A Kubernetes Service provides a stable abstraction over a set of selected backend endpoints and distributes connections according to the cluster’s networking implementation. The Service selector identifies which Pods belong to the backend set, while endpoint information represents the actual destinations. This allows Pods to be replaced without requiring clients to track changing Pod addresses. The exact traffic distribution behavior can depend on kube-proxy mode, networking configuration, and Service settings.

Question 198

Which resource defines a custom API schema for extension objects?

  1. CustomResourceDefinition
  2. ExtensionSchema
  3. APIType
  4. ResourceTemplate

Correct Answer: 1

Explanation:

A CustomResourceDefinition extends the Kubernetes API with a new resource type and defines characteristics such as its API group, versions, names, and schema. Once installed, instances of that custom resource can be created through the Kubernetes API like other objects. CRDs are commonly paired with controllers or operators that implement the behavior associated with those resources. They provide a standardized way to extend Kubernetes without modifying the core API server source code.

Question 199

Which field defines CPU capacity requested by a container?

  1. resources.requests.cpu
  2. resources.limits.cpu
  3. cpu.requestValue
  4. container.cpuNeed

Correct Answer: 1

Explanation:

The resources.requests.cpu field specifies the CPU amount requested by a container. Kubernetes uses resource requests when determining whether a node has sufficient capacity to schedule the Pod. A request is different from a CPU limit: the request influences placement and resource allocation expectations, while the limit establishes an upper CPU boundary for the container. Accurate CPU requests help the scheduler make reliable placement decisions and allow workloads to receive appropriate resource guarantees during contention.

Question 200

Which Kubernetes object identifies a storage provisioner and its parameters?

  1. PersistentVolumeClaim
  2. StorageClass
  3. VolumeAttachment
  4. PersistentVolume

Correct Answer: 2

Explanation:

A StorageClass defines a class of storage and can specify the provisioner responsible for dynamically creating volumes. It can also contain parameters that control backend-specific provisioning behavior. PersistentVolumeClaims can request a StorageClass when workloads need dynamically provisioned storage. This separation allows applications to request storage characteristics without directly managing infrastructure-specific volume creation. StorageClasses are therefore an important abstraction for connecting Kubernetes storage requests with the capabilities of the underlying storage system.