Linux Foundation KCNA Practice Test Questions and Exam Dumps Part11 Q201-220

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

 

Question 201

Which Kubernetes object is used to store non-sensitive configuration data that can be consumed by Pods?

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

Correct Answer: 3

Explanation

A ConfigMap is designed to store non-sensitive configuration data separately from application container images. Applications can consume ConfigMap values through environment variables, command-line arguments, or mounted files. This allows the same container image to be deployed with different configurations across development, testing, and production environments. ConfigMaps should not be used for sensitive credentials such as passwords or private keys; Kubernetes Secrets are intended for those purposes. Separating configuration from application code improves portability and makes it easier to update configuration without rebuilding the application container image.

Question 202

Which Kubernetes object is used to request storage resources for a Pod?

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

Correct Answer: 1

Explanation

A PersistentVolumeClaim, or PVC, is a request for storage made by a Kubernetes workload. A Pod can reference a PVC and use the storage made available through it. The PVC describes requirements such as storage capacity and access mode. Kubernetes can bind the claim to a suitable PersistentVolume, either one already available or one provisioned dynamically through a StorageClass. A PersistentVolume represents the actual storage resource, while a StorageClass describes storage provisioning characteristics. PVCs therefore provide an abstraction that allows applications to request storage without depending directly on specific storage infrastructure.

Question 203

Which Kubernetes resource represents storage that has been made available to the cluster?

  1. PersistentVolumeClaim
  2. PersistentVolume
  3. ConfigMap
  4. Secret

Correct Answer: 2

Explanation

A PersistentVolume, or PV, represents storage that is available for use by workloads in a Kubernetes cluster. It can correspond to storage provided by cloud platforms, network storage systems, local storage, or other supported backends. Applications generally consume this storage through PersistentVolumeClaims rather than directly referencing the PV. The PVC expresses the application’s storage requirements, while the PV represents the storage resource that satisfies those requirements. This separation allows storage administration and application deployment to be handled independently.

Question 204

Which Kubernetes resource can define how persistent volumes should be dynamically provisioned?

  1. PersistentVolumeClaim
  2. Secret
  3. StorageClass
  4. Service

Correct Answer: 3

Explanation

A StorageClass describes different classes of storage that can be offered by a Kubernetes cluster. It can specify a provisioner and parameters that determine how persistent storage should be dynamically created. A PersistentVolumeClaim can request storage using a particular StorageClass, allowing Kubernetes to provision an appropriate PersistentVolume automatically when supported. This approach avoids requiring administrators to manually create every PersistentVolume before applications request storage. StorageClasses are particularly useful in cloud and dynamic infrastructure environments where storage resources can be created automatically according to application requirements.

Question 205

Which Kubernetes object provides a stable virtual IP and DNS name for accessing selected Pods?

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

Correct Answer: 2

Explanation

A Kubernetes Service provides a stable networking abstraction for accessing a group of Pods. Instead of relying on individual Pod IP addresses, clients can communicate with the Service using its stable virtual IP and DNS name. The Service selects backend Pods according to configured labels and selectors. This is important because Pods can be recreated and receive different IP addresses during their lifecycle. Deployments, ReplicaSets, and Jobs manage workloads rather than providing the stable network endpoint that applications commonly need for communication.

Question 206

Which Service type is normally used to expose an application internally within a Kubernetes cluster?

  1. NodePort
  2. LoadBalancer
  3. ExternalName
  4. ClusterIP

Correct Answer: 4

Explanation

ClusterIP is the default Kubernetes Service type and provides an internal virtual IP that can be used to access Pods from within the cluster. It is commonly used for communication between application components such as frontend, backend, and database services. NodePort exposes a Service through a port on each node, while LoadBalancer can integrate with external load-balancing infrastructure. ExternalName maps a Service to an external DNS name. ClusterIP is therefore the standard choice when an application needs internal cluster networking without direct external exposure.

Question 207

Which Service type exposes a Kubernetes Service on a port available on each node?

  1. NodePort
  2. ClusterIP
  3. ExternalName
  4. Headless

Correct Answer: 1

Explanation

A NodePort Service exposes the Service through a specific port on each eligible Kubernetes node. Traffic sent to a node’s assigned NodePort can be forwarded to the Service’s backend Pods. NodePort can be useful for basic external access or as part of a larger networking configuration. ClusterIP provides internal access, while ExternalName maps a Service to an external DNS name. A headless Service does not provide a traditional virtual ClusterIP. NodePort therefore provides a straightforward mechanism for exposing a Service through node-level ports.

Question 208

Which Kubernetes Service configuration does not allocate a traditional cluster virtual IP?

  1. LoadBalancer
  2. Headless Service
  3. NodePort
  4. ClusterIP

Correct Answer: 2

Explanation

A headless Service is created by setting its clusterIP to None. Instead of providing a traditional virtual IP for load balancing, it allows DNS to return the individual Pod addresses associated with the Service. This behavior is especially useful for applications that need to discover and communicate with specific Pod instances, including many stateful workloads. StatefulSets commonly use headless Services for stable network identities. Standard ClusterIP Services provide a virtual IP, while NodePort and LoadBalancer build additional exposure mechanisms around Service networking.

Question 209

Which Kubernetes object is designed to run a finite task until it successfully completes?

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

Correct Answer: 3

Explanation

A Job creates Pods that are expected to perform a finite task and eventually complete successfully. Kubernetes tracks the completion status and can create replacement Pods when appropriate according to the Job configuration. Jobs are useful for activities such as data processing, database migrations, batch calculations, or administrative operations. Deployments are intended for continuously running applications, DaemonSets provide workloads on nodes, and StatefulSets manage applications requiring stable identities. A Job therefore represents work that has a defined completion condition rather than a continuously running service.

Question 210

Which Kubernetes resource creates Jobs according to a defined schedule?

  1. CronJob
  2. DaemonSet
  3. ReplicaSet
  4. Service

Correct Answer: 1

Explanation

A CronJob creates Jobs according to a specified schedule. The schedule uses cron-style syntax to determine when new Jobs should be created. CronJobs are useful for recurring tasks such as backups, reports, cleanup operations, and periodic data processing. The CronJob itself manages the scheduling, while each resulting Job handles an individual execution of the task. Unlike a Deployment, which normally maintains continuously running application replicas, a CronJob is designed around scheduled and finite workloads.

Question 211

Which Kubernetes controller maintains the desired number of Pod replicas for a workload?

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

Correct Answer: 2

Explanation

A ReplicaSet ensures that a specified number of matching Pods are running. If a Pod is deleted or becomes unavailable, the ReplicaSet can create another Pod to restore the desired replica count. Deployments commonly manage ReplicaSets rather than requiring administrators to manage them directly. StatefulSets provide stable identities and ordered behavior for stateful workloads, while Services provide networking. ConfigMaps store configuration data. ReplicaSets therefore provide the basic replication mechanism that maintains the desired number of interchangeable Pods.

Question 212

Which Kubernetes feature allows a workload to automatically increase or decrease its number of replicas based on resource utilization?

  1. ResourceQuota
  2. Vertical Pod Autoscaler
  3. Horizontal Pod Autoscaler
  4. LimitRange

Correct Answer: 3

Explanation

The Horizontal Pod Autoscaler, or HPA, adjusts the number of replicas for supported workloads based on observed metrics and configured targets. It can commonly use CPU or memory utilization and, depending on the environment, other metrics. The goal is to increase capacity when demand rises and reduce unnecessary replicas when demand falls. Vertical Pod Autoscaler focuses on adjusting resource requests and limits rather than replica count. ResourceQuota limits aggregate resource consumption, while LimitRange establishes resource constraints or defaults within a Namespace.

Question 213

Which Kubernetes autoscaling mechanism can adjust Pod resource requests and limits rather than the number of replicas?

  1. Horizontal Pod Autoscaler
  2. Cluster Autoscaler
  3. Vertical Pod Autoscaler
  4. ReplicaSet

Correct Answer: 3

Explanation

The Vertical Pod Autoscaler, or VPA, is designed to recommend or adjust CPU and memory resource requests and limits for Pods according to observed usage and configured policies. Unlike the Horizontal Pod Autoscaler, which changes the number of Pod replicas, VPA focuses on the resources assigned to individual Pods. The Cluster Autoscaler operates at the node level by adjusting cluster capacity when supported. ReplicaSets maintain a desired number of Pods but do not perform resource optimization. VPA is therefore useful when workload resource requirements need to be adjusted rather than simply adding replicas.

Question 214

Which Kubernetes mechanism can add or remove cluster nodes based on pending workloads and resource requirements?

  1. Cluster Autoscaler
  2. ConfigMap
  3. HPA
  4. NetworkPolicy

Correct Answer: 1

Explanation

The Cluster Autoscaler adjusts the number of nodes in a Kubernetes cluster when supported by the underlying infrastructure. It can add nodes when workloads cannot be scheduled because available capacity is insufficient and can remove underutilized nodes when they are no longer needed, subject to its configuration and safety conditions. HPA changes the number of application Pods, while VPA can adjust resource requests. ConfigMaps store configuration and NetworkPolicies control traffic. Cluster Autoscaler therefore operates primarily at the infrastructure or node-capacity level rather than directly scaling application replicas.

Question 215

Which Kubernetes component is responsible for maintaining network rules that help route Service traffic to backend Pods on nodes?

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

Correct Answer: 2

Explanation

kube-proxy is a node-level Kubernetes component associated with implementing Service networking behavior. Depending on the networking mode and Kubernetes version, it can maintain network rules that direct traffic destined for Services toward appropriate backend Pods. It works as part of the Kubernetes networking architecture rather than acting as the scheduler or storage database. The kubelet manages Pods on nodes, kube-scheduler assigns unscheduled Pods to nodes, and etcd stores cluster state. kube-proxy therefore plays an important role in implementing traditional Kubernetes Service connectivity.

Question 216

Which Kubernetes component provides DNS-based service discovery inside a typical cluster?

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

Correct Answer: 3

Explanation

CoreDNS commonly provides DNS-based service discovery within Kubernetes clusters. It allows workloads to resolve Kubernetes Service names into the appropriate DNS records and addresses. This means applications can communicate using stable DNS names rather than depending on changing Pod IP addresses. CoreDNS typically watches Kubernetes resources and generates DNS responses based on Services and other supported objects. kubelet manages node workloads, kube-proxy supports Service networking, and kube-controller-manager runs control-plane controllers. CoreDNS therefore provides an important naming and discovery function for Kubernetes applications.

Question 217

Which Kubernetes networking principle generally requires every Pod to be able to communicate directly with other Pods without requiring NAT between them?

  1. Pod network model
  2. Storage abstraction
  3. RBAC model
  4. Replica management

Correct Answer: 1

Explanation

Kubernetes follows a networking model in which Pods receive their own IP addresses and should generally be able to communicate directly with other Pods across nodes without requiring network address translation between Pod addresses. The exact implementation is provided by the cluster’s networking solution, commonly through a CNI plugin. This model allows applications to communicate using Pod IP addresses while Services provide stable access abstractions. Storage, RBAC, and replica management address different Kubernetes concerns and do not define the fundamental Pod-to-Pod networking model.

Question 218

Which interface standard allows Kubernetes to interact with container networking implementations?

  1. CRI
  2. CSI
  3. CNI
  4. OCI

Correct Answer: 3

Explanation

The Container Network Interface, or CNI, provides a standard approach for configuring networking for containers and Pods. Kubernetes networking implementations commonly use CNI plugins to assign Pod IP addresses, configure network interfaces, and implement additional networking features such as network policies when supported. CRI is associated with container runtime integration, while CSI provides storage integration. OCI defines standards related to container formats and runtimes. CNI is therefore the interface most directly associated with connecting Kubernetes workloads to their network environment.

Question 219

Which interface allows Kubernetes to communicate with container runtimes?

  1. CNI
  2. CRI
  3. CSI
  4. RBAC

Correct Answer: 2

Explanation

The Container Runtime Interface, or CRI, provides the interface through which Kubernetes can communicate with supported container runtimes. This abstraction allows Kubernetes components such as the kubelet to work with different runtime implementations without embedding the complete runtime implementation directly into Kubernetes. CNI focuses on networking, while CSI focuses on storage integration. RBAC controls authorization. Container runtimes are responsible for executing containers, and CRI defines the interaction between Kubernetes and those runtimes. Understanding CRI is important when studying the architecture of Kubernetes nodes.

Question 220

Which interface provides a standard mechanism for Kubernetes to integrate with storage systems?

  1. CSI
  2. CNI
  3. CRI
  4. API Gateway

Correct Answer: 1

Explanation

The Container Storage Interface, or CSI, provides a standard mechanism for Kubernetes to integrate with external storage systems. CSI drivers allow Kubernetes to provision, attach, mount, and manage storage according to the capabilities of the underlying storage provider. This architecture enables Kubernetes to work with many different storage technologies without implementing provider-specific storage logic directly in the core platform. CNI handles networking and CRI handles container runtime integration. CSI is therefore the key interface for connecting Kubernetes workloads with supported persistent storage systems.