Linux Foundation KCNA Practice Test Questions and Exam Dumps Part9 Q161-180

View Full Linux Foundation KCNA Exam Dumps and Practice Test Dumps.

 

Question 161

Which Kubernetes object is the smallest deployable unit in the Kubernetes object model?

  1. Service
  2. Pod
  3. Deployment
  4. Namespace

Correct Answer: 2

Explanation

A Pod is the smallest deployable unit in Kubernetes. It represents one or more containers that are scheduled together on the same node and share networking and storage resources. Most commonly, a Pod contains a single application container, although tightly coupled containers can also run together in one Pod. Higher-level resources such as Deployments, StatefulSets, DaemonSets, and Jobs manage Pods according to different workload requirements. Services provide networking to Pods, while Namespaces organize resources. Understanding Pods is fundamental because Kubernetes schedules and manages application containers through the Pod abstraction.

Question 162

Which Kubernetes object is commonly used to manage stateless application Pods and support rolling updates?

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

Correct Answer: 1

Explanation

A Deployment manages a set of Pods and provides features such as rolling updates, scaling, and revision management. It is commonly used for stateless applications where individual Pods are interchangeable. When a new container image or configuration is introduced, a Deployment can gradually replace existing Pods with new ones according to its update strategy. Deployments typically manage ReplicaSets, which maintain the desired number of Pods. Secrets store sensitive information, Services provide networking, and ConfigMaps provide configuration. Deployments are therefore a central workload resource for continuously running stateless applications.

Question 163

Which Kubernetes object is designed to provide stable identities and ordered deployment for stateful applications?

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

Correct Answer: 3

Explanation

A StatefulSet manages applications where Pods require stable identities, predictable names, and often persistent storage. StatefulSet Pods receive stable ordinal identities and can be created or terminated according to ordered behavior when configured. This makes StatefulSets useful for databases, distributed systems, and other applications where individual instances are not completely interchangeable. Jobs handle finite tasks, DaemonSets provide node-level workloads, and ReplicaSets maintain interchangeable Pod replicas. StatefulSets are therefore appropriate when an application requires identity and storage characteristics beyond those normally provided by a Deployment.

Question 164

Which Kubernetes workload controller ensures that a Pod is running on each node that matches its scheduling requirements?

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

Correct Answer: 2

Explanation

A DaemonSet ensures that a copy of a specified Pod runs on every node that meets its scheduling conditions. It is commonly used for node-level services such as monitoring agents, log collectors, and networking components. When a new eligible node joins the cluster, the DaemonSet can automatically create a Pod there. Deployments manage a specified number of replicas, Jobs run finite workloads, and CronJobs create Jobs according to a schedule. DaemonSet is therefore the Kubernetes workload controller specifically designed for node-oriented workloads.

Question 165

Which Kubernetes object is responsible for providing a stable network endpoint for a set of Pods?

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

Correct Answer: 1

Explanation

A Kubernetes Service provides a stable network endpoint for accessing a group of Pods. It commonly selects backend Pods using labels and directs traffic toward those Pods. This abstraction is important because Pod IP addresses can change when Pods are recreated or rescheduled. Clients can continue communicating with the Service without needing to know the individual Pod addresses. Jobs manage finite tasks, ConfigMaps store configuration, and PersistentVolumes provide storage. Services therefore provide a reliable networking layer between application clients and dynamically changing Pods.

Question 166

Which Kubernetes resource is used to store non-sensitive application configuration separately from the container image?

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

Correct Answer: 2

Explanation

A ConfigMap stores non-sensitive configuration information separately from application container images. Applications can consume ConfigMap values as environment variables, command-line arguments, or mounted files. This allows the same container image to be reused in multiple environments with different configuration settings. Sensitive information such as passwords and tokens should generally be stored using Secrets instead. ServiceAccounts provide workload identities, while NetworkPolicies control network traffic. ConfigMaps are therefore useful for separating application configuration from application code and improving deployment flexibility.

Question 167

Which Kubernetes resource is intended for storing sensitive configuration information?

  1. ResourceQuota
  2. ConfigMap
  3. Secret
  4. Namespace

Correct Answer: 3

Explanation

Kubernetes Secrets are designed to hold sensitive information such as passwords, access tokens, certificates, and other credentials. A Secret can be exposed to containers through environment variables or mounted files. Access to Secrets should be restricted using appropriate RBAC permissions, and clusters may also use encryption at rest for stronger protection. ConfigMaps are intended for non-sensitive configuration. ResourceQuota controls resource usage, while Namespaces organize resources. Secrets therefore provide the standard Kubernetes abstraction for managing sensitive application configuration separately from container images and ordinary configuration data.

Question 168

Which Kubernetes command can be used to display the nodes registered with a cluster?

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

Correct Answer: 1

Explanation

The kubectl get nodes command displays the nodes registered with a Kubernetes cluster. Its output commonly includes the node name, status, role information, Kubernetes version, and age. Administrators can use this command to quickly determine whether nodes are available and ready to schedule workloads. More detailed information can be obtained with commands such as kubectl describe node. Nodes provide the compute resources where Pods run, while the control plane determines how workloads are scheduled and managed. Checking node status is a basic cluster administration task.

Question 169

Which Kubernetes command can be used to display the resources and events associated with a specific node?

  1. kubectl inspect node
  2. kubectl describe node
  3. kubectl node-info
  4. kubectl show node

Correct Answer: 2

Explanation

The kubectl describe node command provides detailed information about a specific Kubernetes node. The output can include labels, capacity, allocatable resources, conditions, Pods running on the node, taints, and recent events. This makes the command useful when investigating scheduling problems, resource pressure, node failures, or unexpected node behavior. kubectl get nodes provides a concise list of nodes, while kubectl describe node provides more detailed diagnostic information. Understanding these commands helps administrators investigate issues at the node level.

Question 170

Which Kubernetes component communicates with the container runtime to manage containers on a node?

  1. kube-scheduler
  2. kube-apiserver
  3. kubelet
  4. CoreDNS

Correct Answer: 3

Explanation

The kubelet runs on each Kubernetes node and communicates with the container runtime to ensure that containers specified by Pods are running as expected. It receives Pod specifications through the Kubernetes control plane and manages the local workload lifecycle. The kubelet also reports node and Pod status back to the API server. The scheduler decides where Pods should run, the API server provides the central Kubernetes API, and CoreDNS provides DNS services. The kubelet is therefore the primary node-level agent responsible for managing Pods.

Question 171

Which Kubernetes control-plane component exposes the Kubernetes API to clients and other cluster components?

  1. etcd
  2. kube-apiserver
  3. kubelet
  4. kube-proxy

Correct Answer: 2

Explanation

The kube-apiserver provides the central API endpoint for Kubernetes. Users interact with the cluster through this API using tools such as kubectl, while controllers, schedulers, and other components also communicate through it. The API server handles request validation and works with authentication and authorization mechanisms before processing operations. etcd stores persistent cluster state, kubelet manages workloads on individual nodes, and kube-proxy provides networking functionality. Because the API server is the central communication point for Kubernetes resources, it is one of the most important control-plane components.

Question 172

Which Kubernetes component is primarily responsible for persistent storage of cluster state?

  1. kube-proxy
  2. kubelet
  3. etcd
  4. kube-scheduler

Correct Answer: 3

Explanation

etcd is a distributed key-value store used by Kubernetes to persist cluster state. Information about Kubernetes resources, configuration, and other control-plane data is stored in etcd. The API server communicates with etcd to read and write this state. Because loss or corruption of etcd data can affect the ability to recover cluster configuration, backups and access controls are important operational considerations. kube-proxy handles networking, kubelet manages node workloads, and kube-scheduler handles Pod placement. etcd is therefore a critical component of the Kubernetes control plane.

Question 173

Which Kubernetes control-plane component is responsible for assigning unscheduled Pods to nodes?

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

Correct Answer: 2

Explanation

The kube-scheduler watches for Pods that do not yet have a node assignment and evaluates available nodes against the Pod’s scheduling requirements. It considers factors such as resource requests, node affinity, taints and tolerations, and other constraints. After selecting a suitable node, the scheduler records the assignment through the Kubernetes API. The kubelet on the selected node then works with the container runtime to start the workload. The controller manager runs reconciliation controllers, while kube-proxy provides networking functions.

Question 174

Which Kubernetes control-plane component runs multiple controllers that reconcile resources toward their desired state?

  1. kube-controller-manager
  2. kube-proxy
  3. CoreDNS
  4. containerd

Correct Answer: 1

Explanation

The kube-controller-manager runs a collection of Kubernetes controllers. These controllers continuously observe resources and compare their actual state with the desired state. Examples include controllers responsible for Nodes, ReplicaSets, Jobs, and other resources. When differences are detected, controllers take corrective actions to move the cluster toward the desired state. kube-proxy handles networking, CoreDNS provides DNS, and containerd is a container runtime. The controller manager is therefore central to Kubernetes automation and self-healing because it implements much of the reconciliation logic used by the control plane.

Question 175

Which Kubernetes command displays the currently configured kubectl contexts?

  1. kubectl context list
  2. kubectl config get-contexts
  3. kubectl get contexts
  4. kubectl show contexts

Correct Answer: 2

Explanation

The kubectl config get-contexts command displays the contexts stored in the kubectl configuration. A context typically associates a cluster, user credentials, and a namespace. This allows administrators to manage access to multiple Kubernetes environments from the same workstation. The currently active context is indicated in the command output. After reviewing available contexts, administrators can use kubectl config use-context to select one. Understanding contexts is particularly important when working with several clusters because commands are executed against the currently selected context.

Question 176

Which kubectl command changes the active Kubernetes context?

  1. kubectl config use-context
  2. kubectl config change-context
  3. kubectl set-context
  4. kubectl switch-context

Correct Answer: 1

Explanation

The kubectl config use-context command changes the active context used by kubectl. A context contains information that determines which Kubernetes cluster and credentials are used, and it can also specify a default namespace. Administrators working with multiple clusters can switch between them using this command instead of repeatedly specifying connection details. It is good practice to verify the active context before executing important commands. The command kubectl config get-contexts can be used beforehand to inspect the available contexts and identify the desired one.

Question 177

Which Kubernetes feature is commonly used to automatically restart a failed container within a Pod?

  1. Service discovery
  2. Restart policy
  3. ResourceQuota
  4. NetworkPolicy

Correct Answer: 2

Explanation

A Pod’s restart policy determines how Kubernetes responds when containers terminate. Common restart policies include Always, OnFailure, and Never, with the default behavior for many managed workloads being Always. Kubernetes can restart containers according to the configured policy, helping maintain workload availability. This is different from a controller replacing an entire failed Pod. Services provide networking, ResourceQuota controls aggregate resource consumption, and NetworkPolicy controls traffic. Understanding restart policies helps distinguish container-level recovery from higher-level workload controller behavior.

Question 178

Which Kubernetes object can be used to expose an application externally through a cloud provider’s load-balancing service?

  1. LoadBalancer Service
  2. ConfigMap
  3. Role
  4. PersistentVolumeClaim

Correct Answer: 1

Explanation

A Service with type LoadBalancer can request an external load balancer from an integrated infrastructure or cloud provider. The exact behavior depends on the Kubernetes environment and its cloud or infrastructure integration. The external endpoint can then direct traffic toward the Kubernetes Service and its backend Pods. ConfigMaps store configuration, Roles define namespace-scoped permissions, and PersistentVolumeClaims request storage. LoadBalancer Services are therefore commonly used when an application needs an externally reachable network endpoint without manually configuring an external load-balancing system.

Question 179

Which Kubernetes resource allows multiple containers in the same Pod to share a network namespace?

  1. Pod
  2. Namespace
  3. Service
  4. Deployment

Correct Answer: 1

Explanation

Containers within the same Pod share the Pod’s network namespace. This means they normally share the same IP address and network interfaces and can communicate with one another using localhost. Containers in the same Pod can also share configured storage volumes. Pods are therefore useful for tightly coupled containers that need to operate together, such as an application container and a supporting sidecar. A Namespace is a logical resource boundary, a Service provides network access to Pods, and a Deployment manages Pods. The Pod is the unit that provides these shared runtime resources.

Question 180

Which Kubernetes design principle describes defining the desired state and allowing controllers to make the cluster match it?

  1. Declarative management
  2. Manual provisioning
  3. Static execution
  4. Direct container management

Correct Answer: 1

Explanation

Declarative management means that users describe the desired state of Kubernetes resources, and Kubernetes controllers work continuously to make the actual state match that desired configuration. YAML manifests are commonly used to express this desired state. For example, a Deployment can specify that three replicas of an application should exist, and Kubernetes works to maintain that condition. This approach differs from manually instructing every individual container operation. Declarative management, combined with reconciliation, enables automation, self-healing, repeatable configuration, and consistent workload management across Kubernetes clusters.