View Full Linux Foundation KCNA Exam Dumps and Practice Test Dumps.
Question 141
Which Kubernetes object is used to route external HTTP and HTTPS requests to Services based on hostnames or URL paths?
- ConfigMap
- Ingress
- Secret
- ReplicaSet
Correct Answer: 2
Explanation
An Ingress defines rules for routing HTTP and HTTPS traffic to Kubernetes Services. It can route requests based on hostnames, URL paths, or other supported matching rules. An Ingress resource itself describes the desired routing configuration, while an Ingress controller is responsible for implementing those rules. ConfigMaps store configuration, Secrets store sensitive data, and ReplicaSets maintain Pod replicas. Ingress is therefore commonly used when multiple web applications need to be exposed through shared external HTTP or HTTPS entry points.
Question 142
Which component implements the routing rules defined by an Ingress resource?
- Ingress controller
- kubelet
- etcd
- kube-scheduler
Correct Answer: 1
Explanation
An Ingress controller watches Ingress resources and implements their routing rules using a specific networking or proxy technology. The Ingress resource describes how incoming HTTP or HTTPS traffic should be routed, while the controller performs the actual traffic handling. Different Kubernetes environments can use different Ingress controller implementations. The kubelet manages Pods on nodes, etcd stores cluster state, and kube-scheduler places Pods. Understanding the distinction between the Ingress resource and its controller is important because creating an Ingress object alone does not necessarily provide traffic handling without an appropriate controller.
Question 143
Which Kubernetes Service type does not assign a virtual cluster IP and can return individual Pod IP addresses through DNS?
- NodePort
- LoadBalancer
- Headless Service
- ClusterIP
Correct Answer: 3
Explanation
A headless Service is configured without a conventional cluster IP, commonly by setting clusterIP to None. Instead of providing a single virtual IP, DNS queries can return the addresses of individual Pods selected by the Service. This is useful for applications that need direct endpoint discovery, particularly some stateful or distributed systems. ClusterIP provides a virtual internal address, NodePort exposes a node-level port, and LoadBalancer can integrate with external load-balancing infrastructure. Headless Services therefore provide a different form of service discovery focused on individual endpoints.
Question 144
Which Kubernetes object can provide stable network identities for Pods managed by a StatefulSet?
- Headless Service
- Job
- ConfigMap
- ResourceQuota
Correct Answer: 1
Explanation
A headless Service can work with StatefulSets to provide stable DNS identities for individual Pods. StatefulSet Pods have predictable names, and a headless Service allows DNS-based discovery of those individual Pod endpoints. This is particularly useful for distributed applications where each instance may need to be contacted directly. Jobs are designed for finite tasks, ConfigMaps store configuration, and ResourceQuotas control resource consumption. The combination of StatefulSet and a headless Service is a common Kubernetes pattern for applications requiring stable network identities.
Question 145
Which Kubernetes object is used to group resources and control their organizational scope?
- Namespace
- Pod
- Container
- Node
Correct Answer: 1
Explanation
A Namespace provides a logical grouping and scope for many Kubernetes resources. Organizations can use namespaces to separate development, testing, production, teams, or applications within a shared cluster. Namespaces can also be used with RBAC permissions and ResourceQuotas to establish access and resource boundaries. Pods contain application containers, Nodes provide compute resources, and containers run application processes. Namespaces are therefore an important organizational mechanism for managing resources in clusters that host multiple teams or workloads.
Question 146
Which Kubernetes command is used to view the available contexts configured for kubectl?
- kubectl context list
- kubectl config get-contexts
- kubectl contexts
- kubectl get contexts
Correct Answer: 2
Explanation
The kubectl config get-contexts command displays the contexts configured in the kubeconfig file. A context associates a cluster, user credentials, and optionally a namespace, allowing kubectl to determine where and how commands should be executed. This is particularly useful when working with multiple Kubernetes clusters. The command helps administrators inspect available contexts before selecting one. kubectl config use-context can then be used to switch to a particular context. Understanding kubectl contexts helps prevent accidental operations against the wrong cluster.
Question 147
Which kubectl command switches the active context used for subsequent commands?
- kubectl config use-context
- kubectl switch-cluster
- kubectl context-select
- kubectl use-cluster
Correct Answer: 1
Explanation
The kubectl config use-context command changes the active context used by kubectl. A context typically contains information about a cluster, user credentials, and a namespace. This allows administrators to work with multiple Kubernetes environments without manually specifying connection details for every command. Before switching contexts, administrators can use kubectl config get-contexts to inspect the configured choices. Using the correct context is especially important in environments containing development, staging, and production clusters because kubectl operations affect whichever context is currently active.
Question 148
Which Kubernetes resource allows administrators to define minimum and maximum resource consumption for individual containers?
- Service
- Resource requests and limits
- Namespace
- Ingress
Correct Answer: 2
Explanation
Container resource requests and limits define CPU and memory expectations and boundaries for workloads. Requests help the scheduler determine whether a node has enough available capacity for a Pod. Limits establish maximum resource usage for supported resources. Properly configured requests and limits improve scheduling decisions and help prevent individual workloads from consuming excessive resources. Services provide networking, Namespaces organize resources, and Ingress handles HTTP routing. Resource management is particularly important in multi-tenant clusters where many applications compete for shared CPU and memory capacity.
Question 149
Which Kubernetes resource can limit the number of Pods or total CPU and memory consumed within a namespace?
- NetworkPolicy
- ResourceQuota
- StorageClass
- Ingress
Correct Answer: 2
Explanation
ResourceQuota allows administrators to establish aggregate resource limits within a namespace. Depending on the configuration, quotas can limit CPU, memory, the number of Pods, Services, PersistentVolumeClaims, and other supported resource types. This helps prevent one namespace from consuming an excessive amount of cluster capacity. NetworkPolicies control network traffic, StorageClasses define storage provisioning behavior, and Ingress manages HTTP or HTTPS routing. ResourceQuota works at the namespace level, making it useful for managing resource consumption across teams, applications, or environments sharing a Kubernetes cluster.
Question 150
Which Kubernetes mechanism controls whether a user or ServiceAccount can perform actions on resources?
- RBAC
- CNI
- CSI
- CRI
Correct Answer: 1
Explanation
Role-Based Access Control, or RBAC, controls authorization within Kubernetes. It determines which actions an identity such as a user, group, or ServiceAccount can perform on Kubernetes resources. RBAC uses resources such as Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings to define and assign permissions. CNI is associated with networking, CSI with storage integration, and CRI with container runtime integration. RBAC is therefore a major Kubernetes security mechanism and is commonly used to implement least-privilege access for administrators, developers, and applications.
Question 151
Which Kubernetes interface provides a standard mechanism for integrating storage plugins with Kubernetes?
- CRI
- CNI
- CSI
- RBAC
Correct Answer: 3
Explanation
CSI, or Container Storage Interface, provides a standardized interface for integrating storage systems with Kubernetes. CSI drivers allow Kubernetes to perform storage-related operations such as provisioning, attaching, mounting, and managing volumes. This abstraction allows different storage vendors and platforms to integrate with Kubernetes without requiring Kubernetes itself to contain vendor-specific storage implementation details. CRI handles container runtimes, CNI handles networking, and RBAC manages authorization. CSI is therefore the primary interface to understand when studying Kubernetes storage integration.
Question 152
Which interface is used by Kubernetes to integrate with container networking implementations?
- CNI
- CSI
- CRI
- API
Correct Answer: 1
Explanation
CNI stands for Container Network Interface and 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 provide connectivity between workloads. CSI handles storage integration, while CRI provides the interface for container runtime operations. The Kubernetes API is used for communication with cluster resources but is not the networking plugin interface. CNI is therefore an important component when studying how Kubernetes establishes Pod networking.
Question 153
Which interface allows Kubernetes to communicate with container runtimes?
- CNI
- CRI
- CSI
- RBAC
Correct Answer: 2
Explanation
The Container Runtime Interface, or CRI, provides a standardized interface between Kubernetes and compatible container runtimes. Through CRI, Kubernetes can request operations needed to create and manage containers and Pods. This design separates Kubernetes orchestration logic from the implementation details of the container runtime. CNI provides networking, CSI provides storage integration, and RBAC controls authorization. Understanding CRI is useful when studying Kubernetes architecture because container runtime responsibilities are separate from scheduling, API management, networking, and storage functions.
Question 154
Which Kubernetes object represents a running instance of an application workload and can contain one or more containers?
- Pod
- Service
- Namespace
- ClusterRole
Correct Answer: 1
Explanation
A Pod is the smallest deployable unit in Kubernetes and can contain one or more containers that share networking and storage resources. Containers within the same Pod share a network namespace and can communicate through localhost. Pods are usually managed by higher-level workload resources such as Deployments, StatefulSets, DaemonSets, and Jobs rather than being created manually for long-running applications. Services provide networking to groups of Pods, Namespaces organize resources, and ClusterRoles define permissions. Understanding Pods is fundamental because most Kubernetes workloads ultimately execute inside Pods.
Question 155
Which Kubernetes object selects Pods using labels and provides a stable endpoint for accessing them?
- Service
- Secret
- Job
- ConfigMap
Correct Answer: 1
Explanation
A Kubernetes Service can use label selectors to identify the Pods that should receive network traffic. The Service provides a stable endpoint even when individual backend Pods are recreated and their IP addresses change. This separation between clients and Pod lifecycles is one of the main reasons Services are central to Kubernetes networking. Secrets store sensitive information, Jobs manage finite tasks, and ConfigMaps store configuration. By selecting Pods through labels, a Service can dynamically include or remove matching workloads as the cluster state changes.
Question 156
Which Kubernetes feature is primarily responsible for maintaining the desired number of replicas for a Deployment?
- Ingress
- ReplicaSet
- ConfigMap
- ServiceAccount
Correct Answer: 2
Explanation
A ReplicaSet maintains the desired number of matching Pods for a Deployment. When a Deployment is created, it normally creates a ReplicaSet, which then ensures that the required number of Pods exists. If a Pod is deleted or fails, the ReplicaSet controller can create a replacement. Deployments add higher-level functionality such as rolling updates and revision management. Ingress handles HTTP routing, ConfigMaps store configuration, and ServiceAccounts provide identities. ReplicaSets therefore provide the replica-maintenance mechanism underneath typical Kubernetes Deployments.
Question 157
Which Kubernetes resource is best suited for a workload that must run continuously on every eligible node?
- Job
- CronJob
- DaemonSet
- Deployment
Correct Answer: 3
Explanation
A DaemonSet is designed for workloads that need a Pod on every eligible node. Common examples include node monitoring agents, log collection agents, and certain networking components. When a new eligible node joins the cluster, the DaemonSet can create the required Pod there automatically. Jobs and CronJobs are designed for finite or scheduled tasks, while Deployments manage a desired number of replicas without requiring one replica per node. DaemonSet is therefore the appropriate workload resource when node-level coverage is required across a Kubernetes cluster.
Question 158
Which Kubernetes resource is appropriate for a task that should execute once and then finish?
- StatefulSet
- Service
- Job
- DaemonSet
Correct Answer: 3
Explanation
A Job is designed for finite workloads that should run until successful completion. Examples include database migrations, batch calculations, data processing, and maintenance tasks. The Job controller creates Pods and monitors their completion status, with retry behavior available for failures. StatefulSets are intended for stateful applications, Services provide network endpoints, and DaemonSets ensure workloads run on eligible nodes. Jobs are therefore a natural fit when the primary requirement is completing a task rather than keeping an application continuously available.
Question 159
Which Kubernetes resource is designed for recurring tasks that execute according to a schedule?
- Deployment
- CronJob
- ReplicaSet
- StatefulSet
Correct Answer: 2
Explanation
A CronJob schedules the creation of Jobs according to a defined schedule. It is useful for recurring workloads such as backups, cleanup operations, periodic reports, and scheduled data processing. Each execution results in a Job, which manages the Pods required to complete that specific run. Deployments continuously manage application replicas, ReplicaSets maintain Pod counts, and StatefulSets manage stateful applications with stable identities. CronJobs therefore provide the scheduling layer needed when a finite task must execute repeatedly at predetermined times.
Question 160
Which Kubernetes mechanism automatically attempts to restore the desired state when a managed Pod fails?
- Self-healing
- Manual provisioning
- Static scheduling
- Image building
Correct Answer: 1
Explanation
Kubernetes self-healing is enabled by controllers that continuously reconcile actual cluster state with the desired state. If a managed Pod fails or is removed, a controller such as a ReplicaSet controller can detect the difference and create a replacement. This behavior reduces the need for administrators to manually recover many common workload failures. Self-healing applies to supported Kubernetes-managed resources, but it does not guarantee that application-level problems will automatically be fixed. The concept is closely connected to Kubernetes’ declarative model and continuous reconciliation architecture.