Linux Foundation KCNA Practice Test Questions and Exam Dumps Part2 Q21-40

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

 

Question 21

Which Kubernetes component is responsible for making decisions about where unscheduled Pods should run?

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

Correct Answer: 2

Explanation

The kube-scheduler is the Kubernetes control plane component responsible for selecting suitable nodes for Pods that have not yet been assigned to a node. It evaluates factors such as available resources, node constraints, affinity rules, taints, and tolerations when making scheduling decisions. Once the scheduler selects a node, the kubelet on that node takes responsibility for running the assigned Pod. The kubelet does not choose nodes, while kube-proxy handles networking functions and etcd stores cluster state. Understanding the scheduler is important because it connects workload requirements with the available compute resources in a Kubernetes cluster.

Question 22

Which Kubernetes resource provides a stable endpoint for accessing a group of Pods?

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

Correct Answer: 1

Explanation

A Kubernetes Service provides a stable network endpoint for a set of Pods. Since Pod IP addresses can change when Pods are recreated, applications should generally avoid relying directly on individual Pod addresses. A Service uses selectors to identify appropriate Pods and provides a stable virtual IP and DNS name for accessing them. Services can be exposed internally or externally depending on their type. ConfigMaps store configuration information, Secrets hold sensitive data, and PersistentVolumes provide storage. Therefore, Services are a fundamental Kubernetes networking abstraction for connecting applications to dynamic Pod workloads.

Question 23

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

  1. Secret
  2. Deployment
  3. Namespace
  4. ServiceAccount

Correct Answer: 2

Explanation

A Deployment provides declarative management for application Pods and is commonly used for stateless workloads. It manages ReplicaSets and allows administrators to specify the desired number of replicas. Deployments also support rolling updates, allowing a new application version to be introduced gradually. This can help maintain availability during application updates. A Secret stores sensitive configuration information, a Namespace organizes resources, and a ServiceAccount provides an identity for workloads. Understanding Deployments is important for KCNA because they demonstrate how Kubernetes controllers maintain the desired state of application workloads.

Question 24

Which Kubernetes command displays information about the nodes in a cluster?

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

Correct Answer: 3

Explanation

The kubectl get nodes command displays information about nodes registered with the Kubernetes cluster. The output commonly includes node names, status, roles, Kubernetes version, and age. This command is useful when checking whether worker nodes are available and ready to run workloads. For more detailed information about a particular node, administrators can use kubectl describe node. The other commands shown are not standard kubectl commands for listing Kubernetes nodes. Checking node status is an important troubleshooting step because Pods cannot be scheduled successfully if suitable nodes are unavailable or unhealthy.

Question 25

What does the Kubernetes control plane primarily manage?

  1. Physical cabling
  2. Cluster state and orchestration
  3. Container image creation
  4. Application source code

Correct Answer: 2

Explanation

The Kubernetes control plane manages the overall state and orchestration of a Kubernetes cluster. Its components include the API server, scheduler, controller managers, and the cluster’s data store. The control plane receives requests, stores cluster state, schedules workloads, and continuously works to maintain the desired state. Physical cabling and application source code are outside its primary responsibilities. Container images are normally built and stored using separate tools and registries. Understanding the control plane is essential because it provides the decision-making and coordination functions that allow Kubernetes to manage workloads across multiple nodes.

Question 26

Which Kubernetes component continuously works to make the actual cluster state match the desired state?

  1. Controller
  2. Registry
  3. Container runtime
  4. DNS server

Correct Answer: 1

Explanation

Kubernetes controllers continuously observe resources and work to make the actual cluster state match the desired state defined by users or other Kubernetes resources. For example, a Deployment controller can ensure that the desired number of application replicas exists. If a Pod fails, the appropriate controller can take action to restore the required state. This reconciliation process is a core principle of Kubernetes. Container runtimes execute containers, registries store images, and DNS services provide name resolution. Controllers therefore play a central role in Kubernetes automation and self-healing behavior.

Question 27

Which Kubernetes command can be used to view detailed information about a specific Pod?

  1. kubectl inspect pod
  2. kubectl describe pod
  3. kubectl detail pod
  4. kubectl show pod

Correct Answer: 2

Explanation

The kubectl describe pod command provides detailed information about a specific Pod. Its output can include the Pod’s metadata, assigned node, container states, mounted volumes, conditions, events, and other useful information. This makes the command particularly valuable when troubleshooting Pods that are failing to start or behaving unexpectedly. kubectl get pods provides a concise list, while kubectl describe pod provides substantially more diagnostic information. Reviewing the Events section can often reveal scheduling, image-pulling, volume, or container-related problems that are not obvious from basic Pod status alone.

Question 28

Which Kubernetes resource is used to store non-sensitive application configuration?

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

Correct Answer: 2

Explanation

A ConfigMap is designed to store non-sensitive configuration data separately from application code and container images. Applications can consume ConfigMap values through environment variables, command-line arguments, or mounted files. This allows administrators to change configuration without rebuilding the application image. Secrets are intended for sensitive information, Services provide network access, and Jobs manage tasks that are expected to run to completion. Separating configuration from application images supports portability and flexibility across development, testing, and production environments. ConfigMaps are therefore an important part of Kubernetes application configuration management.

Question 29

Which Kubernetes workload resource is designed to run a task until it successfully completes?

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

Correct Answer: 1

Explanation

A Kubernetes Job creates one or more Pods and ensures that a specified task successfully completes. Jobs are useful for workloads such as batch processing, database migrations, or other finite operations. Unlike a Deployment, which is generally used to keep application replicas running continuously, a Job is designed around completion. Kubernetes can retry failed Pods according to the Job configuration until the required completion condition is achieved. Services provide networking, while ConfigMaps store configuration. Understanding the difference between continuously running workloads and completion-oriented workloads is important when selecting Kubernetes resources.

Question 30

Which Kubernetes workload is designed to run a Pod on every eligible node?

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

Correct Answer: 3

Explanation

A DaemonSet ensures that a copy of a Pod runs on each node that matches its scheduling requirements. DaemonSets are commonly used for node-level services such as log collectors, monitoring agents, and networking components. When a new eligible node joins the cluster, the DaemonSet controller can create the corresponding Pod on that node. Deployments manage a desired number of replicas without requiring one Pod per node, while StatefulSets provide stable identities for stateful workloads. Jobs are designed for finite tasks. Therefore, DaemonSet is the appropriate resource for node-wide workloads.

Question 31

Which Kubernetes resource is designed to manage stateful applications that require stable identities?

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

Correct Answer: 1

Explanation

A StatefulSet is a Kubernetes workload resource designed for applications that require stable identities, persistent storage associations, or ordered deployment and scaling behavior. Each Pod managed by a StatefulSet receives a predictable identity, making the resource useful for workloads such as databases and distributed systems. ReplicaSets maintain a specified number of interchangeable Pod replicas, while ConfigMaps store configuration information and Services provide network connectivity. StatefulSets can also work with PersistentVolumeClaims to provide persistent storage for individual replicas. Understanding StatefulSets helps distinguish stateful workloads from the more interchangeable Pods commonly managed by Deployments.

Question 32

Which Kubernetes command displays the logs produced by a container in a Pod?

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

Correct Answer: 2

Explanation

The kubectl logs command displays logs generated by a container running inside a Pod. It is one of the most commonly used troubleshooting commands because application logs can reveal errors, startup failures, configuration problems, and other runtime issues. If a Pod contains multiple containers, the appropriate container can be specified when retrieving logs. Kubernetes itself does not automatically interpret application log content; it provides mechanisms for accessing container output. Other tools may be used for centralized logging, but kubectl logs is a basic and important method for inspecting application output directly.

Question 33

Which Kubernetes feature allows workloads to use resource limits and requests for CPU and memory?

  1. Resource specifications
  2. DNS policies
  3. Service discovery
  4. Network policies

Correct Answer: 1

Explanation

Kubernetes allows containers to define resource requests and limits for resources such as CPU and memory. A request represents the amount of a resource needed for scheduling purposes, while a limit places a maximum boundary on resource usage for supported resources. These settings help Kubernetes make scheduling decisions and control workload resource consumption. Resource management is important in multi-tenant clusters because workloads share node resources. DNS policies handle name resolution behavior, Service discovery supports networking, and NetworkPolicies control selected network traffic. Resource requests and limits therefore help provide predictable resource allocation across workloads.

Question 34

Which Kubernetes feature can restrict network traffic between selected Pods?

  1. NetworkPolicy
  2. ConfigMap
  3. ReplicaSet
  4. PersistentVolume

Correct Answer: 1

Explanation

A Kubernetes NetworkPolicy can define rules controlling network traffic involving selected Pods. Depending on the networking implementation and policy configuration, administrators can specify allowed ingress and egress traffic based on factors such as Pod selectors, namespaces, and network addresses. NetworkPolicies are useful for implementing network segmentation and limiting unnecessary communication between workloads. ConfigMaps store configuration, ReplicaSets maintain Pod replicas, and PersistentVolumes provide storage. NetworkPolicy enforcement depends on the cluster’s network plugin supporting the relevant policy capabilities. Therefore, NetworkPolicy is the Kubernetes resource specifically intended for controlling Pod network communication.

Question 35

Which Kubernetes object provides an identity that a Pod can use when interacting with the Kubernetes API?

  1. Service
  2. ServiceAccount
  3. ConfigMap
  4. PersistentVolumeClaim

Correct Answer: 2

Explanation

A ServiceAccount provides an identity for processes running inside Pods when they need to interact with the Kubernetes API or other systems that recognize Kubernetes identities. ServiceAccounts can be associated with role-based access control permissions through Kubernetes RBAC. This allows administrators to grant workloads only the permissions they require. A Service provides networking, a ConfigMap stores non-sensitive configuration, and a PersistentVolumeClaim requests storage. Using dedicated ServiceAccounts instead of unnecessarily broad credentials supports better access control and follows the principle of granting only required permissions to workloads.

Question 36

What does RBAC primarily control in Kubernetes?

  1. Container image formats
  2. User and workload permissions
  3. Pod network addresses
  4. Node CPU speed

Correct Answer: 2

Explanation

Role-Based Access Control, or RBAC, controls which actions users, groups, and ServiceAccounts are permitted to perform on Kubernetes resources. Roles and ClusterRoles define permissions, while RoleBindings and ClusterRoleBindings associate those permissions with identities. For example, RBAC can allow a user to view Pods in a particular namespace without allowing that user to modify them. RBAC is therefore an important security mechanism for controlling access to the Kubernetes API. It does not determine CPU speed, container image formats, or Pod IP addresses. Proper RBAC configuration helps enforce least-privilege access.

Question 37

Which Kubernetes object can be used to run a scheduled task at specified times?

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

Correct Answer: 1

Explanation

A Kubernetes CronJob creates Jobs according to a specified schedule. It is useful for recurring tasks such as backups, reports, cleanup operations, or periodic data processing. The schedule is expressed using cron-style scheduling syntax. Each scheduled execution creates a Job, which then creates the required Pod to perform the task. Deployments are intended for continuously running applications, Services provide network access, and DaemonSets run workloads across eligible nodes. CronJobs therefore provide Kubernetes-native scheduling for recurring workloads that need to execute at defined times.

Question 38

Which CNCF project is commonly used for monitoring and collecting time-series metrics?

  1. Helm
  2. Prometheus
  3. Fluentd
  4. containerd

Correct Answer: 2

Explanation

Prometheus is a monitoring and observability system widely used for collecting and storing time-series metrics. It can scrape metrics from configured targets and store them with timestamps and labels. Prometheus is commonly used with Kubernetes to monitor cluster components and applications. Helm is a package manager for Kubernetes applications, Fluentd is commonly used for log collection and processing, and containerd provides container runtime functionality. Prometheus can also support alerting through its ecosystem and integrations. Understanding its role helps KCNA candidates distinguish monitoring and metrics tools from Kubernetes orchestration and container runtime components.

Question 39

Which Kubernetes object is used to expose a Service outside the cluster through a node port?

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

Correct Answer: 2

Explanation

A Service of type NodePort exposes a Kubernetes Service through a port on each eligible node. External clients can connect to a node’s IP address and the assigned NodePort, allowing traffic to reach the Service and its selected Pods. ClusterIP provides the standard internal Service exposure, while ExternalName maps a Service to an external DNS name. ConfigMaps are unrelated to Service exposure. NodePort is useful when external access is required without directly using a cloud-provider LoadBalancer, although the exact networking behavior depends on the Kubernetes environment and configuration.

Question 40

Which Kubernetes mechanism is commonly used to package and install applications using reusable charts?

  1. Helm
  2. CoreDNS
  3. Prometheus
  4. kube-proxy

Correct Answer: 1

Explanation

Helm is a package manager for Kubernetes that uses charts to package and deploy applications. A Helm chart can contain Kubernetes resource templates, default values, metadata, and other files needed to manage an application. Helm allows users to install, upgrade, configure, and remove packaged applications more consistently than manually managing every resource individually. CoreDNS provides DNS services, Prometheus focuses on monitoring, and kube-proxy provides networking-related functionality on nodes. Helm is therefore widely used for application deployment and lifecycle management in Kubernetes environments.