View Full Linux Foundation KCNA Exam Dumps and Practice Test Dumps.
Question 241
Which Kubernetes object is used to control whether specific Pods can communicate with other Pods or network endpoints?
- ConfigMap
- NetworkPolicy
- ServiceAccount
- ResourceQuota
Correct Answer: 2
Explanation
A NetworkPolicy defines rules that control network traffic to and from selected Pods. Policies can regulate ingress traffic, egress traffic, or both, depending on their configuration. Rules may use Pod selectors, Namespace selectors, IP blocks, and ports to identify allowed traffic. NetworkPolicy enforcement depends on the cluster’s networking implementation and whether the CNI plugin supports the required functionality. NetworkPolicies are useful for reducing unnecessary communication between workloads and implementing network segmentation. They provide a declarative mechanism for expressing network access requirements within a Kubernetes cluster.
Question 242
Which Kubernetes object is commonly used to provide a stable DNS name for a group of application Pods?
- Service
- ReplicaSet
- Job
- PersistentVolume
Correct Answer: 1
Explanation
A Kubernetes Service provides a stable network identity for a group of Pods and can be accessed through a DNS name generated by the cluster’s DNS system. This allows applications to communicate without depending on individual Pod IP addresses, which can change when Pods are recreated. The Service uses selectors to identify its backend Pods in the common case. ReplicaSets maintain Pod replicas, Jobs handle finite workloads, and PersistentVolumes provide storage. Services therefore provide an important abstraction for reliable application-to-application communication.
Question 243
Which container runtime is an example of software that can implement the Kubernetes Container Runtime Interface?
- CoreDNS
- containerd
- kube-scheduler
- etcd
Correct Answer: 2
Explanation
containerd is a container runtime that can be used by Kubernetes through the Container Runtime Interface. It is responsible for core container lifecycle operations such as creating, starting, stopping, and deleting containers. Kubernetes does not directly implement all container runtime functionality itself; instead, the CRI provides an interface between Kubernetes components and compatible runtimes. CoreDNS handles DNS, kube-scheduler handles Pod placement, and etcd stores cluster state. Understanding containerd and CRI helps explain how Kubernetes executes containers on worker nodes.
Question 244
Which Kubernetes component stores cluster configuration and state as a distributed key-value database?
- kubelet
- kube-proxy
- etcd
- CoreDNS
Correct Answer: 3
Explanation
etcd is the distributed key-value store used by Kubernetes to persist important cluster state. Information about objects such as Deployments, Services, ConfigMaps, and other resources is stored through the Kubernetes API and persisted in etcd. The API server provides controlled access to this state rather than allowing ordinary clients to interact with etcd directly. Because etcd contains critical cluster information, backups and appropriate security controls are important. kubelet manages node workloads, kube-proxy handles Service networking, and CoreDNS provides DNS functionality.
Question 245
Which Kubernetes component validates and processes requests made to the Kubernetes API?
- kube-apiserver
- kube-scheduler
- kubelet
- containerd
Correct Answer: 1
Explanation
The kube-apiserver is the central entry point for the Kubernetes API. Clients such as kubectl, controllers, and other components communicate with the cluster through the API server. It handles requests and works with authentication, authorization, admission control, and persistent cluster state. After an API operation is accepted, the appropriate controllers and components can work toward the requested state. The scheduler is responsible for Pod placement, the kubelet manages Pods on nodes, and containerd runs containers. The API server therefore plays a central role in Kubernetes communication.
Question 246
Which Kubernetes component watches for unscheduled Pods and selects suitable nodes for them?
- kube-controller-manager
- kubelet
- kube-scheduler
- kube-proxy
Correct Answer: 3
Explanation
The kube-scheduler is responsible for selecting nodes for Pods that do not yet have a node assignment. It evaluates scheduling requirements such as resource requests, node affinity, taints and tolerations, and other constraints. After selecting a suitable node, the scheduler records the placement through the Kubernetes API. The kubelet on the selected node then works to start the Pod. The controller manager runs reconciliation controllers, while kube-proxy supports Service networking. The scheduler is therefore the component responsible for making Pod placement decisions.
Question 247
Which Kubernetes component runs on each node and ensures that assigned Pods are running?
- kubelet
- etcd
- kube-scheduler
- CoreDNS
Correct Answer: 1
Explanation
The kubelet is the primary Kubernetes agent running on each node. It receives Pod specifications assigned to its node and works with the container runtime to ensure that the required containers are running. It also reports information about Pod and node status back to the control plane. The kube-scheduler determines placement, etcd stores cluster state, and CoreDNS provides DNS services. The kubelet therefore forms the operational link between the Kubernetes control plane and the workloads running on individual nodes.
Question 248
Which Kubernetes concept allows an application to run several closely related containers together as one scheduling unit?
- Namespace
- Pod
- Service
- Deployment
Correct Answer: 2
Explanation
A Pod can contain one or more containers that are scheduled together on the same node. Containers within the same Pod share the Pod’s network namespace and can share configured storage volumes. This makes Pods useful for tightly coupled application components, such as an application container and a supporting sidecar. Although a Pod may contain multiple containers, many Kubernetes workloads use one main application container per Pod. Deployments manage Pods, Services provide networking, and Namespaces provide logical organization. The Pod is therefore the fundamental execution unit in Kubernetes.
Question 249
Which Kubernetes resource is commonly used to inject configuration values into a container as environment variables?
- ConfigMap
- Node
- ReplicaSet
- Service
Correct Answer: 1
Explanation
A ConfigMap can provide configuration values to containers through environment variables or mounted files. This allows configuration to remain separate from the application image. For example, a container can receive an application mode, service endpoint, or feature setting from a ConfigMap without requiring a new image build. Sensitive information should generally be stored in a Secret rather than a ConfigMap. ReplicaSets manage Pod counts, Services provide network endpoints, and Nodes provide compute resources. ConfigMaps therefore support flexible and reusable application configuration.
Question 250
Which Kubernetes resource should generally be used for passwords, tokens, and other sensitive configuration values?
- ConfigMap
- Secret
- Annotation
- Label
Correct Answer: 2
Explanation
Kubernetes Secrets are designed for sensitive information such as passwords, tokens, certificates, and other credentials. Secrets can be consumed by Pods through environment variables or mounted files. Appropriate access controls should be applied because a Secret is not automatically equivalent to a complete security solution. In particular, administrators should consider RBAC permissions and encryption at rest for stored Secret data. ConfigMaps are intended for non-sensitive configuration, while labels and annotations provide metadata. Secrets therefore provide the standard Kubernetes object for managing sensitive application information.
Question 251
Which Kubernetes feature can be used to expose a Service externally using infrastructure-provided load balancing?
- ClusterIP
- LoadBalancer
- Headless
- ExternalName
Correct Answer: 2
Explanation
A Service of type LoadBalancer can request an external load-balancing mechanism when the Kubernetes environment supports integration with an appropriate infrastructure or cloud provider. This can provide an externally reachable address that forwards traffic to the Service and its backend Pods. ClusterIP is primarily for internal access, while a headless Service does not provide a traditional virtual IP. ExternalName maps a Service to an external DNS name rather than creating a load balancer. LoadBalancer is therefore commonly used when external network access is required.
Question 252
Which Kubernetes Service type is useful when clients need to discover individual Pod IP addresses through DNS?
- NodePort
- LoadBalancer
- Headless Service
- ClusterIP
Correct Answer: 3
Explanation
A headless Service is created by setting its clusterIP to None. Instead of providing a traditional virtual IP, DNS can return the addresses of the Pods associated with the Service. This is useful when applications need direct access to individual Pod instances or when client-side discovery is preferred. StatefulSets commonly use headless Services to support stable network identities. NodePort and LoadBalancer provide additional exposure mechanisms, while a normal ClusterIP Service provides a virtual IP. Headless Services are particularly useful for distributed and stateful applications.
Question 253
Which Kubernetes object is responsible for keeping a specified number of identical Pods running?
- ReplicaSet
- ConfigMap
- Service
- Secret
Correct Answer: 1
Explanation
A ReplicaSet maintains a desired number of matching Pods. If the number of available Pods falls below the configured replica count, the ReplicaSet creates additional Pods. If there are more matching Pods than desired, it can remove the excess. Deployments commonly manage ReplicaSets to provide higher-level features such as rolling updates and rollback. ConfigMaps and Secrets store configuration information, while Services provide networking. ReplicaSets therefore provide the basic replication and self-healing mechanism for interchangeable Pods.
Question 254
Which Deployment capability allows an administrator to inspect previous versions of a Deployment?
- kubectl rollout history
- kubectl deployment versions
- kubectl history deployment
- kubectl get revisions
Correct Answer: 1
Explanation
The kubectl rollout history command displays revision information for a Deployment or another supported workload. Reviewing rollout history can help administrators understand which revisions have been created during application updates. This information is useful when investigating deployment changes or preparing to roll back to a previous version. The related kubectl rollout undo command can be used to revert a Deployment when an earlier revision is available. Rollout history therefore provides an important part of Kubernetes deployment management and troubleshooting.
Question 255
Which Kubernetes command can be used to apply the desired state defined in a YAML manifest?
- kubectl create-state
- kubectl apply
- kubectl update-file
- kubectl sync
Correct Answer: 2
Explanation
The kubectl apply command is commonly used to create or update Kubernetes resources from configuration manifests. It supports declarative management by allowing users to describe the desired state in YAML or JSON and then asking Kubernetes to reconcile the resources accordingly. This makes it useful for repeatable deployments and configuration management. Unlike commands that perform a single imperative operation, kubectl apply is commonly associated with maintaining resources from declarative configuration files. It is widely used in Kubernetes administration and deployment workflows.
Question 256
Which kubectl command removes a Kubernetes resource?
- kubectl erase
- kubectl remove
- kubectl delete
- kubectl destroy
Correct Answer: 3
Explanation
The kubectl delete command is used to remove Kubernetes resources. It can delete individual resources or groups of resources according to the specified type, name, selectors, or manifest. For example, an administrator can use it to remove a Pod, Deployment, Service, or other supported object. Deleting a resource can trigger additional behavior depending on relationships and controllers. For example, deleting a Pod managed by a Deployment may result in another Pod being created to maintain the desired replica count. Therefore, deletion should be used carefully in production environments.
Question 257
Which Kubernetes command can display recent cluster events useful for troubleshooting?
- kubectl get events
- kubectl logs events
- kubectl show events
- kubectl list events
Correct Answer: 1
Explanation
The kubectl get events command displays Kubernetes events that can provide useful information about resource activity and problems. Events may indicate scheduling failures, image-pull errors, container restarts, node conditions, and other operational changes. They are especially useful when combined with commands such as kubectl describe pod, which often includes relevant events for a particular resource. Events are not a replacement for application logs, but they provide important information about actions taken by Kubernetes and conditions observed by cluster components.
Question 258
Which Kubernetes object can provide default CPU and memory requests or limits for containers in a Namespace?
- ResourceQuota
- LimitRange
- PodDisruptionBudget
- NetworkPolicy
Correct Answer: 2
Explanation
A LimitRange can define default resource requests and limits for containers within a Namespace. It can also establish minimum and maximum values for supported resources. This helps administrators enforce consistent resource configuration when developers do not explicitly provide all required values. ResourceQuota operates at the aggregate Namespace level and controls total resource consumption. PodDisruptionBudget manages availability during voluntary disruptions, while NetworkPolicy controls network traffic. LimitRange is therefore the appropriate Kubernetes resource for setting per-container or per-Pod resource defaults and constraints.
Question 259
Which Kubernetes mechanism helps protect an application from losing too many replicas during voluntary disruptions?
- NetworkPolicy
- ResourceQuota
- PodDisruptionBudget
- LimitRange
Correct Answer: 3
Explanation
A PodDisruptionBudget, or PDB, specifies availability requirements for a group of Pods during voluntary disruptions. For example, it can require that a certain minimum number of replicas remain available during supported maintenance operations. This can help protect highly available applications when nodes are drained or other planned disruptions occur. A PDB does not prevent all Pod failures and does not directly control application scaling. ResourceQuota controls resource consumption, LimitRange manages resource constraints, and NetworkPolicy controls network communication. PDBs therefore focus specifically on workload availability during voluntary disruption.
Question 260
Which Kubernetes scheduling feature allows a Pod to prefer running on nodes with a particular label without making the requirement mandatory?
- Required node affinity
- Preferred node affinity
- Toleration
- ResourceQuota
Correct Answer: 2
Explanation
Preferred node affinity allows a Pod to express a scheduling preference for nodes with specific labels without making that placement an absolute requirement. The scheduler considers the preference when selecting a suitable node but can choose another node if necessary. Required node affinity, in contrast, establishes a condition that must be satisfied for the Pod to be scheduled. Tolerations allow Pods to be considered for tainted nodes but do not themselves express node-label preferences. Preferred node affinity is therefore useful when administrators want to influence placement while retaining scheduling flexibility.