View Full Linux Foundation KCNA Exam Dumps and Practice Test Dumps.
Question 121
Which Kubernetes resource is used to define CPU and memory requirements for a container?
- Service
- Resource requests and limits
- ConfigMap
- Ingress
Correct Answer: 2
Explanation
Kubernetes allows containers to define resource requests and limits for CPU and memory. A request represents the amount of a resource that Kubernetes uses when making scheduling decisions. A limit establishes an upper boundary on how much of that resource a container can consume. These settings help Kubernetes place workloads on appropriate nodes and prevent individual containers from consuming excessive resources. Services handle networking, ConfigMaps store configuration, and Ingress manages HTTP routing. Proper resource configuration is important for predictable workload behavior and efficient cluster resource utilization.
Question 122
What does a Kubernetes CPU resource request primarily influence?
- Container image selection
- Pod scheduling
- Service discovery
- DNS resolution
Correct Answer: 2
Explanation
A CPU resource request tells Kubernetes how much CPU capacity a container requires for scheduling purposes. The kube-scheduler considers the resource requests of Pods when determining whether a node has sufficient available capacity to host them. A request does not necessarily represent a hard maximum; the CPU limit serves that purpose. Image selection, Service discovery, and DNS resolution are separate Kubernetes functions. Resource requests are therefore important because they help the scheduler make informed placement decisions and reduce the likelihood of overcommitting node resources.
Question 123
What happens when a container attempts to use more CPU than its configured CPU limit?
- The container is automatically deleted
- The Pod moves to another namespace
- CPU usage is throttled
- The node is immediately terminated
Correct Answer: 3
Explanation
When a container reaches its configured CPU limit, Kubernetes and the underlying Linux resource controls can throttle its CPU usage rather than allowing it to continuously consume additional CPU beyond the configured limit. CPU limits therefore act as a control on CPU consumption. This behavior differs from memory limits, where exceeding the configured limit can result in the container being terminated due to an out-of-memory condition. Understanding the different behavior of CPU and memory limits is useful when configuring Kubernetes workloads and troubleshooting resource-related performance problems.
Question 124
What can happen when a container exceeds its configured memory limit?
- It may be terminated due to an out-of-memory condition
- It automatically becomes a DaemonSet
- It receives unlimited memory
- It is converted into a Service
Correct Answer: 1
Explanation
Memory limits are enforced differently from CPU limits. If a container attempts to consume more memory than its configured limit, it may be terminated because of an out-of-memory condition. Kubernetes can then restart the container depending on the Pod’s restart policy and workload controller. CPU overuse is generally handled through throttling, while memory overuse can result in termination. Correctly setting memory requests and limits is important because values that are too low can cause repeated failures, while values that are too high can reduce scheduling efficiency and cluster utilization.
Question 125
Which Kubernetes object can automatically create Pods to replace failed replicas managed by a Deployment?
- Service
- ReplicaSet
- ConfigMap
- Secret
Correct Answer: 2
Explanation
A ReplicaSet maintains a specified number of matching Pod replicas. Deployments normally create and manage ReplicaSets, and those ReplicaSets ensure that the desired number of Pods remains available. If a managed Pod is deleted or fails, the ReplicaSet controller can create another Pod to restore the desired count. Services provide network access, ConfigMaps store configuration, and Secrets store sensitive information. This controller-based behavior is an example of Kubernetes reconciliation, where the system continuously works to maintain the desired state declared by the user.
Question 126
Which Kubernetes concept allows applications to discover Services through DNS names?
- Service discovery
- ResourceQuota
- RBAC
- Scheduling
Correct Answer: 1
Explanation
Kubernetes Service discovery allows applications to locate Services using stable DNS names instead of depending on changing Pod IP addresses. Kubernetes clusters commonly use CoreDNS to provide DNS-based service discovery. When a Service is created, DNS records can be made available so workloads can communicate using the Service name. This is especially useful in dynamic environments where Pods may be recreated or moved between nodes. ResourceQuota manages resource consumption, RBAC controls permissions, and scheduling determines Pod placement. Service discovery therefore simplifies communication between applications.
Question 127
Which Kubernetes component commonly provides DNS-based service discovery inside a cluster?
- kubelet
- CoreDNS
- kube-scheduler
- etcd
Correct Answer: 2
Explanation
CoreDNS is commonly deployed in Kubernetes clusters to provide DNS services, including service discovery. It can resolve Kubernetes Service names to appropriate network addresses so that applications can communicate using DNS rather than manually tracking Pod IP addresses. CoreDNS runs as a workload within the cluster and communicates with Kubernetes resources to provide relevant DNS information. The kubelet manages Pods on nodes, kube-scheduler handles Pod placement, and etcd stores cluster state. CoreDNS is therefore an important component of Kubernetes internal networking and service discovery.
Question 128
Which Kubernetes object can be used to expose a group of Pods using a stable virtual IP address?
- Service
- Job
- ConfigMap
- PersistentVolumeClaim
Correct Answer: 1
Explanation
A Kubernetes Service provides a stable virtual network endpoint for a group of Pods. The Service selects backend Pods using label selectors and directs traffic toward those Pods according to the cluster networking implementation. This abstraction remains stable even when individual Pods are recreated and receive different IP addresses. Jobs manage finite tasks, ConfigMaps store configuration, and PersistentVolumeClaims request storage. Services are therefore a fundamental Kubernetes networking abstraction that separates application clients from the changing lifecycle of individual workload Pods.
Question 129
Which Service type is primarily intended for internal communication within a Kubernetes cluster?
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
Correct Answer: 1
Explanation
ClusterIP is the default Kubernetes Service type and is primarily intended for communication within the cluster. It provides a stable virtual IP and DNS name through which other workloads can reach the selected Pods. This is commonly used for internal application components such as APIs, databases, and backend services. NodePort exposes a port on nodes, LoadBalancer can integrate with external load-balancing infrastructure, and ExternalName maps a Service to an external DNS name. ClusterIP therefore provides the standard internal Service abstraction.
Question 130
Which Kubernetes resource allows administrators to restrict network traffic to selected Pods?
- Secret
- NetworkPolicy
- ResourceQuota
- StorageClass
Correct Answer: 2
Explanation
A NetworkPolicy defines rules that control network traffic to and from selected Pods. Policies can regulate ingress, egress, or both, depending on the configuration and capabilities of the cluster’s networking implementation. For example, a policy can allow an application to receive traffic only from Pods with specific labels. NetworkPolicies are an important part of Kubernetes network security because they can reduce unnecessary communication between workloads. Secrets store sensitive data, ResourceQuotas control resource usage, and StorageClasses define storage provisioning behavior.
Question 131
Which Kubernetes resource is used to define a reusable set of authorization permissions at the cluster level?
- ClusterRole
- ConfigMap
- Service
- PersistentVolume
Correct Answer: 1
Explanation
A ClusterRole defines a set of permissions that can be used at the cluster level. It can grant access to cluster-scoped resources and can also define permissions for namespaced resources. A ClusterRole does not automatically grant access to an identity; it normally needs to be associated with users, groups, or ServiceAccounts through RoleBinding or ClusterRoleBinding. ConfigMaps store configuration, Services provide networking, and PersistentVolumes provide storage. ClusterRoles are therefore a key building block of Kubernetes RBAC and centralized authorization management.
Question 132
Which RBAC object grants permissions from a ClusterRole across the entire cluster?
- Role
- RoleBinding
- ClusterRoleBinding
- ServiceAccount
Correct Answer: 3
Explanation
A ClusterRoleBinding associates a ClusterRole with a user, group, or ServiceAccount at the cluster scope. This allows the specified identity to receive the permissions defined by that ClusterRole according to the binding. A RoleBinding can reference a ClusterRole, but the permissions granted through that RoleBinding are normally limited to its namespace. Roles define namespaced permissions, while ServiceAccounts provide identities. ClusterRoleBinding should therefore be used carefully because it can grant broad privileges across the Kubernetes cluster.
Question 133
Which Kubernetes resource provides an identity for applications running inside Pods?
- ServiceAccount
- Namespace
- ReplicaSet
- StorageClass
Correct Answer: 1
Explanation
A ServiceAccount provides an identity that workloads can use when interacting with the Kubernetes API. Pods can be associated with a ServiceAccount, and RBAC permissions can determine which operations that identity is allowed to perform. This allows administrators to grant applications only the permissions they require. Namespaces organize resources, ReplicaSets maintain Pod replicas, and StorageClasses define storage provisioning behavior. ServiceAccounts are particularly important for implementing controlled application access to Kubernetes resources and are commonly combined with Roles or ClusterRoles through appropriate bindings.
Question 134
Which Kubernetes object is used to define storage provisioning behavior and available storage classes?
- PersistentVolumeClaim
- StorageClass
- ConfigMap
- ServiceAccount
Correct Answer: 2
Explanation
A StorageClass describes a category of storage and defines how storage can be dynamically provisioned. It commonly specifies a provisioner and may include parameters that control characteristics of the resulting storage. When a PersistentVolumeClaim references a StorageClass, Kubernetes can request storage from the associated provisioner. PersistentVolumeClaims represent application storage requests, while ConfigMaps store configuration and ServiceAccounts provide identities. StorageClasses therefore provide an abstraction that allows administrators to offer different storage options to Kubernetes workloads.
Question 135
Which Kubernetes resource represents actual provisioned storage that can be bound to a PersistentVolumeClaim?
- PersistentVolume
- ConfigMap
- Service
- Job
Correct Answer: 1
Explanation
A PersistentVolume, or PV, represents storage that has been made available to a Kubernetes cluster. It can be statically created by an administrator or dynamically provisioned through a StorageClass. A PersistentVolumeClaim requests storage and can become bound to a suitable PersistentVolume. The PV abstraction separates the storage provided by infrastructure from the application’s storage request. ConfigMaps provide configuration, Services provide networking, and Jobs run finite tasks. PersistentVolumes are therefore an important part of Kubernetes persistent storage management.
Question 136
Which Kubernetes object is commonly used by applications to request a specific amount and access mode of persistent storage?
- PersistentVolume
- PersistentVolumeClaim
- StorageClass
- Secret
Correct Answer: 2
Explanation
A PersistentVolumeClaim, or PVC, is a request for persistent storage made by a Kubernetes workload or user. It can specify requirements such as storage capacity and access mode. Kubernetes attempts to bind the PVC to a suitable PersistentVolume, either from existing storage or through dynamic provisioning using a StorageClass. PersistentVolumes represent the actual storage resources, while StorageClasses define provisioning behavior. Secrets store sensitive information. PVCs therefore provide an application-friendly abstraction for requesting and consuming persistent storage without requiring direct knowledge of the underlying storage infrastructure.
Question 137
Which Kubernetes resource can ensure that only a specified amount of a namespace’s resources is consumed?
- ResourceQuota
- Ingress
- DaemonSet
- Secret
Correct Answer: 1
Explanation
ResourceQuota limits aggregate resource consumption within a Kubernetes namespace. Administrators can use quotas to control resources such as CPU, memory, Pods, Services, and PersistentVolumeClaims, depending on the configured quota rules. This helps ensure that one namespace does not consume an uncontrolled amount of shared cluster capacity. Ingress manages HTTP or HTTPS routing, DaemonSets manage node-level workloads, and Secrets store sensitive information. ResourceQuota is particularly useful in multi-team or multi-tenant clusters where administrators need clear resource boundaries between namespaces.
Question 138
Which Kubernetes mechanism can automatically increase or decrease the number of Pods based on workload metrics?
- Cluster Autoscaler
- Horizontal Pod Autoscaler
- StorageClass
- Vertical Pod Autoscaler
Correct Answer: 2
Explanation
The Horizontal Pod Autoscaler, or HPA, changes the number of replicas of a scalable workload based on observed metrics. CPU and memory utilization are common metrics, although other metrics can be used when supported by the cluster’s metrics infrastructure. HPA allows applications to respond to changing demand without requiring manual replica adjustments. Cluster Autoscaler changes node capacity, while Vertical Pod Autoscaler focuses on resource requests for individual Pods. StorageClass manages storage provisioning. HPA therefore provides horizontal workload scaling by adjusting the number of application instances.
Question 139
Which Kubernetes component is responsible for storing key-value state used by the control plane?
- etcd
- kubelet
- kube-proxy
- CoreDNS
Correct Answer: 1
Explanation
etcd is the distributed key-value store used by Kubernetes to persist important cluster state. Information about resources and configuration is stored in etcd and accessed through the Kubernetes API server. Because Kubernetes depends on this data for reconstructing the desired cluster state, etcd is a critical control-plane component. Administrators operating their own control planes should consider backup, security, availability, and recovery procedures for etcd. kubelet manages workloads on nodes, kube-proxy supports networking, and CoreDNS provides DNS services.
Question 140
Which Kubernetes principle allows the platform to automatically replace a failed Pod managed by a controller?
- Manual scheduling
- Self-healing
- Static provisioning
- Image caching
Correct Answer: 2
Explanation
Self-healing is a key Kubernetes capability enabled by controllers and reconciliation. When a managed Pod disappears or becomes unavailable, the appropriate controller compares the actual state with the desired state and can create a replacement. For example, a Deployment and its underlying ReplicaSet can maintain the configured number of replicas even after a Pod failure. This reduces the need for administrators to manually recreate workloads. Self-healing does not mean every possible application failure is automatically fixed, but it provides automated recovery for many infrastructure and workload-level conditions.