CNCF CKA Practice Test Questions and Exam Dumps Part6 Q101-120

View Full CNCF CKA Exam Dumps and Practice Test Dumps

 

Question 101

Which command shows nodes that are currently unschedulable?

  1. kubectl get nodes
  2. kubectl show nodes
  3. kubectl list nodes
  4. kubectl inspect nodes

Correct Answer: 1

Explanation:

The kubectl get nodes command lists nodes along with their status. The output can indicate whether a node is ready, unschedulable, or experiencing another condition. An administrator can use this command as an initial step when investigating scheduling problems. A node may be marked unschedulable after administrative maintenance or through other cluster operations. Reviewing node status helps determine whether Pods can currently be placed there. Additional commands such as kubectl describe node can then provide more detailed information about conditions, taints, capacity, and scheduling-related configuration.

Question 102

Which Kubernetes object stores non-confidential application configuration data?

  1. Secret
  2. ConfigMap
  3. CertificateSigningRequest
  4. ServiceAccount

Correct Answer: 2

Explanation:

A ConfigMap stores non-confidential configuration information that applications can consume as environment variables, command-line arguments, or mounted files. It separates configuration from the container image, allowing administrators to modify application settings without rebuilding the image. ConfigMaps are not intended for sensitive information such as passwords or private credentials; Kubernetes Secrets are designed for that purpose. A Pod can reference a ConfigMap directly or consume selected keys from it. This separation makes application deployment more flexible across different environments.

Question 103

Which Kubernetes component assigns newly created Pods to nodes?

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

Correct Answer: 3

Explanation:

The kube-scheduler determines suitable nodes for newly created Pods that do not already have an assigned node. It evaluates factors such as available resources, affinity rules, taints, tolerations, and other scheduling constraints before selecting a node. After a node is assigned, the kubelet on that node takes responsibility for running the Pod’s containers. The scheduler therefore handles placement decisions rather than directly launching containers. Understanding this separation is important when troubleshooting Pods that remain in a Pending state.

Question 104

Which field identifies the Kubernetes API version for an object?

  1. kind
  2. apiVersion
  3. metadata.name
  4. spec.version

Correct Answer: 2

Explanation:

The apiVersion field identifies the API group and version used to interpret a Kubernetes resource manifest. For example, Deployment objects commonly use an apps API group version. The kind field identifies the resource type, while metadata contains information such as the object’s name and namespace. Using the correct API version is essential because Kubernetes uses it to determine the schema and available fields for the object. Incorrect or unsupported API versions can cause manifest validation or creation failures.

Question 105

Which command safely marks a node unavailable for new workloads?

  1. kubectl block node
  2. kubectl freeze node
  3. kubectl pause node
  4. kubectl cordon node

Correct Answer: 4

Explanation:

The kubectl cordon command marks a node as unschedulable so that newly created Pods are not placed there. Existing workloads continue running unless another operation removes or relocates them. Cordon is commonly used before maintenance when an administrator wants to stop additional workloads from arriving on a node. It differs from draining, which also attempts to evict eligible existing Pods. This distinction makes cordon useful when an administrator needs to prevent future scheduling without immediately disrupting workloads already running on the node.

Question 106

What does kubectl rollout undo perform on a Deployment?

  1. Creates another namespace
  2. Removes the Service
  3. Restores an earlier revision
  4. Deletes all ReplicaSets

Correct Answer: 3

Explanation:

kubectl rollout undo allows an administrator to revert a Deployment toward a previous revision. This is useful when a recent image, configuration, or template change causes application problems. Kubernetes maintains revision information through the Deployment’s associated ReplicaSets. An administrator can undo the latest revision or specify a particular revision when appropriate. The command does not delete the Deployment itself or remove its Service. Rollback is therefore a useful recovery mechanism for application updates that produce unexpected behavior.

Question 107

Which field specifies the maximum number of Pods unavailable during a rolling update?

  1. maxUnavailable
  2. maxSurge
  3. unavailableLimit
  4. rollingLimit

Correct Answer: 1

Explanation:

The maxUnavailable setting controls how many Pods may be unavailable during a Deployment rolling update. It helps determine how much existing capacity can temporarily disappear while new Pods are being created. A complementary setting, maxSurge, controls how many additional Pods may temporarily exist above the desired replica count. These parameters allow administrators to balance availability, rollout speed, and temporary resource usage. Correct configuration is particularly important for applications that must maintain service capacity while new versions are introduced.

Question 108

Which field allows a Pod to tolerate a matching node taint?

  1. affinity
  2. nodeSelector
  3. tolerations
  4. schedulerName

Correct Answer: 3

Explanation:

The tolerations field allows a Pod to be considered for scheduling onto nodes carrying matching taints. A toleration does not force a Pod onto a particular node; it simply permits the Pod to remain eligible when the corresponding taint would otherwise prevent scheduling or cause eviction. Administrators commonly combine taints and tolerations to reserve specialized nodes for specific workloads. For example, a dedicated node pool can be tainted and only workloads with the appropriate toleration can use those nodes.

Question 109

Which command reveals detailed information about a specific Kubernetes object?

  1. kubectl describe
  2. kubectl summarize
  3. kubectl inspect
  4. kubectl explain

Correct Answer: 1

Explanation:

The kubectl describe command displays detailed information about a Kubernetes resource. For a Pod, the output can include container states, conditions, mounts, events, scheduling information, and other useful troubleshooting details. This makes it particularly valuable when a workload is Pending, repeatedly restarting, or failing to become ready. kubectl explain serves a different purpose by describing resource fields from the API schema. When diagnosing an individual object, describe is often one of the quickest ways to identify configuration or runtime problems.

Question 110

Which Deployment setting controls extra Pods during an update?

  1. maxUnavailable
  2. surgeLimit
  3. extraReplicas
  4. maxSurge

Correct Answer: 4

Explanation:

The maxSurge setting controls how many additional Pods may be created above the Deployment’s desired replica count during a rolling update. This allows Kubernetes to start new-version Pods before removing all old-version Pods. Increasing the surge amount can make updates progress faster but may temporarily consume additional cluster resources. maxUnavailable controls the opposite side of the rollout by defining how much capacity may be unavailable. Together, these settings determine the rollout’s availability and resource behavior.

Question 111

Which resource is commonly used to expose a workload internally?

  1. Service
  2. Job
  3. ConfigMap
  4. ReplicaSet

Correct Answer: 1

Explanation:

A Kubernetes Service provides a stable network abstraction for accessing a group of Pods. It uses label selectors to identify applicable endpoints and can provide a consistent virtual address even when individual Pods are replaced. The default ClusterIP Service type is commonly used for internal cluster communication. This prevents clients from depending directly on changing Pod IP addresses. Services can also be configured with other exposure methods, including NodePort and LoadBalancer, depending on how traffic needs to enter or leave the cluster.

Question 112

Which mechanism automatically creates Pods to maintain a desired replica count?

  1. Job
  2. Deployment
  3. ConfigMap
  4. Secret

Correct Answer: 2

Explanation:

A Deployment manages replicated application workloads and maintains the desired number of Pods through ReplicaSets. If a Pod fails, the associated controllers work to create a replacement so that the declared replica count is restored. Deployments also provide mechanisms for rolling updates and revisions. This makes them appropriate for long-running stateless applications. Jobs have a different purpose because they manage tasks expected to complete successfully rather than continuously maintaining a fixed number of running application replicas.

Question 113

Which command can reveal why a Pod remains Pending?

  1. kubectl wait
  2. kubectl pause
  3. kubectl describe pod
  4. kubectl attach

Correct Answer: 3

Explanation:

kubectl describe pod provides detailed Pod information, including scheduling events that can explain why the Pod remains Pending. Common causes include insufficient node resources, unsatisfied affinity requirements, taints without matching tolerations, or other scheduling constraints. The Events section is especially useful because the scheduler often records a reason when it cannot place a Pod. Reviewing this output allows administrators to move from the symptom of a Pending Pod toward the underlying scheduling condition.

Question 114

Which component maintains the desired state of many Kubernetes resources?

  1. Controller manager
  2. kube-proxy
  3. Container runtime
  4. CoreDNS

Correct Answer: 1

Explanation:

The controller manager runs various controllers responsible for observing cluster state and taking actions that move the actual state toward the desired state. Controllers manage resources such as Deployments, ReplicaSets, Nodes, and Jobs. They continuously compare what exists with what has been declared through Kubernetes objects. The kubelet handles workloads on individual nodes, while kube-proxy supports Service networking behavior. Understanding controllers is essential because many Kubernetes self-healing behaviors depend on their reconciliation loops.

Question 115

Which command displays the last lines of a container’s output?

  1. kubectl trace
  2. kubectl logs
  3. kubectl stream
  4. kubectl output

Correct Answer: 2

Explanation:

The kubectl logs command retrieves output produced by containers in Pods. Administrators can use options such as –tail to limit the number of recent lines displayed, which is useful when a container has generated a large amount of output. Logs are often one of the first troubleshooting sources for application failures, startup errors, or unexpected behavior. For Pods with multiple containers, the appropriate container can be selected explicitly. Reviewing container output can quickly reveal application-level problems that Kubernetes status alone does not show.

Question 116

What does a PersistentVolume access mode describe?

  1. Storage encryption method
  2. Volume attachment permissions
  3. Filesystem compression
  4. Snapshot retention period

Correct Answer: 2

Explanation:

PersistentVolume access modes describe how a volume may be mounted or accessed according to the capabilities supported by the storage implementation. Common modes include ReadWriteOnce, ReadOnlyMany, and ReadWriteMany. Access modes do not specify encryption, compression, or snapshot retention. The actual capabilities depend on the underlying storage system and driver. Administrators must select a compatible access mode when defining PersistentVolumeClaims so that the requested storage can be successfully bound and mounted by the workload.

Question 117

Which Kubernetes feature applies default resource settings within a namespace?

  1. ResourceQuota
  2. LimitRange
  3. PriorityClass
  4. HorizontalPodAutoscaler

Correct Answer: 2

Explanation:

A LimitRange can define default CPU or memory requests and limits for containers within a namespace. It can also establish minimum or maximum resource values that individual containers or Pods may request. This differs from ResourceQuota, which controls aggregate resource consumption across a namespace. LimitRange therefore provides per-object resource constraints and defaults. Using it helps ensure that workloads receive sensible resource configurations even when application manifests do not explicitly specify every requested value.

Question 118

Which API resource defines a custom Kubernetes object type?

  1. Operator
  2. Webhook
  3. CustomResourceDefinition
  4. AdmissionReview

Correct Answer: 3

Explanation:

A CustomResourceDefinition, or CRD, extends the Kubernetes API with a new custom resource type. Once a CRD is installed, users can create instances of that custom resource using Kubernetes API conventions. CRDs are frequently used with operators, where a controller watches custom resources and performs application-specific reconciliation. The CRD defines the resource’s schema and API characteristics, while an operator provides the logic that acts on instances. This mechanism allows Kubernetes to manage domain-specific resources beyond its built-in object types.

Question 119

Which command checks whether a Kubernetes Service has reachable endpoints?

  1. kubectl get endpoints
  2. kubectl get storage
  3. kubectl get routes
  4. kubectl get gateways

Correct Answer: 1

Explanation:

The kubectl get endpoints command can show the network addresses associated with a Service’s selected backend Pods. If a Service has no endpoints, clients may be unable to reach the intended application even though the Service object itself exists. This can happen because of selector mismatches, unavailable Pods, or readiness-related conditions. Examining endpoints is therefore a useful troubleshooting step when Service connectivity does not work as expected. EndpointSlice resources provide the newer scalable endpoint representation in Kubernetes.

Question 120

Which Kubernetes resource automatically adjusts replicas from observed workload metrics?

  1. VerticalPodAutoscaler
  2. ReplicaSet
  3. HorizontalPodAutoscaler
  4. PodDisruptionBudget

Correct Answer: 3

Explanation:

The HorizontalPodAutoscaler, or HPA, automatically adjusts the number of workload replicas according to observed metrics and configured scaling targets. It can scale supported workloads such as Deployments based on CPU, memory, or other available metrics. HPA differs from a ReplicaSet, which maintains a declared replica count without independently deciding the desired number. A PodDisruptionBudget controls voluntary disruption limits rather than scaling. Proper HPA configuration requires suitable resource metrics and appropriate target values so scaling decisions reflect actual application demand.