View Full CNCF CKA Exam Dumps and Practice Test Dumps
Question 121
Which field makes a container execute a custom startup command?
- args
- entrypoint
- startupCommand
- command
Correct Answer: 4
Explanation:
The command field in a Kubernetes container specification overrides the image’s default executable. It is commonly used when a workload needs to start with a different process or command than the one defined by the container image. The args field supplies arguments to that command. Kubernetes separates these concepts so administrators can independently control the executable and its parameters. Understanding the distinction is useful when troubleshooting containers that start with unexpected processes or immediately terminate because their startup behavior differs from what the application requires.
Question 122
Which volume type combines data from multiple volume sources?
- hostPath
- projected
- emptyDir
- downwardAPI
Correct Answer: 2
Explanation:
A projected volume allows several existing volume sources to be presented together through a single directory inside a container. Supported sources can include ConfigMaps, Secrets, downward API information, and service account data. This is useful when an application expects related configuration or metadata under one filesystem location. Instead of mounting each source independently, administrators can combine them into a projected volume definition. The underlying data remains managed by its respective Kubernetes resources while the container receives a unified filesystem view.
Question 123
Which command creates a new Kubernetes namespace?
- kubectl create namespace
- kubectl add namespace
- kubectl make namespace
- kubectl init namespace
Correct Answer: 1
Explanation:
The kubectl create namespace command creates a namespace directly from the command line. Namespaces provide logical separation for resources within a Kubernetes cluster and can be used to organize workloads, apply quotas, and manage access boundaries. For example, an administrator can create a dedicated namespace for a development workload before deploying its resources. After creation, resources can be targeted using the namespace option or by specifying namespace metadata in manifests. Namespaces are particularly useful in multi-team or multi-environment clusters.
Question 124
Which Pod field selects a specific node by its label?
- nodeAffinity
- nodeName
- nodeSelector
- targetNode
Correct Answer: 3
Explanation:
The nodeSelector field provides a straightforward way to constrain a Pod to nodes carrying specified labels. Kubernetes schedules the Pod only onto nodes whose labels satisfy the selector. This is useful for simple placement requirements such as choosing nodes with a particular hardware type or operating-system label. More complex placement rules can use node affinity. nodeSelector is therefore a convenient mechanism when the scheduling requirement is based on a direct label match rather than a more sophisticated expression.
Question 125
Which Service type exposes an application through each node’s IP and port?
- ClusterIP
- ExternalName
- LoadBalancer
- NodePort
Correct Answer: 4
Explanation:
A NodePort Service exposes a Service on a static port across the nodes in the cluster. Clients can access the application using a node address together with the assigned NodePort. Kubernetes also maintains the Service abstraction and routes traffic toward suitable backend endpoints. NodePort is commonly used when external access is required without directly configuring a cloud load balancer. The actual port is allocated from the configured NodePort range unless an administrator explicitly specifies a valid value.
Question 126
Which resource stores information about a Kubernetes object’s creator and ownership relationships?
- metadata
- spec
- status
- data
Correct Answer: 1
Explanation:
The metadata section contains identifying and organizational information about Kubernetes objects. It can include names, namespaces, labels, annotations, owner references, and other metadata fields. Owner references are particularly important for controller-managed resources because they establish relationships between objects. Kubernetes can use these relationships during garbage collection when an owning object is removed. The spec describes the desired configuration, while status represents observed state. Understanding metadata is therefore essential when inspecting relationships and object identity.
Question 127
Which setting controls whether a failed container is restarted automatically?
- restartPolicy
- failurePolicy
- recoveryMode
- restartStrategy
Correct Answer: 1
Explanation:
The Pod restartPolicy controls how containers are restarted when they terminate. Common values include Always, OnFailure, and Never, with behavior depending on the workload type and Pod configuration. Deployments normally use the default Always behavior for their Pods, while Jobs commonly use OnFailure or Never. This setting concerns restarting containers within the Pod rather than recreating the entire Pod through a controller. Choosing the appropriate policy helps Kubernetes handle workloads according to their expected lifecycle.
Question 128
Which Kubernetes object assigns a numeric priority to Pods?
- PriorityPolicy
- PriorityClass
- PodPriority
- SchedulingClass
Correct Answer: 2
Explanation:
A PriorityClass defines a priority value that can be associated with Pods. The scheduler can use Pod priority when making scheduling and preemption decisions. Higher-priority workloads may receive preferential treatment when cluster resources are constrained, including situations where lower-priority Pods can be preempted to make room. PriorityClass objects can also define whether the priority should be considered for preemption. Administrators should use meaningful priority levels because they influence scheduling behavior across workloads sharing the same cluster.
Question 129
Which command displays the API resources available in a cluster?
- kubectl api-list
- kubectl resources
- kubectl api-resources
- kubectl show-api
Correct Answer: 3
Explanation:
The kubectl api-resources command lists the resource types available through the Kubernetes API server. Its output can show resource names, short names, API groups, whether resources are namespaced, and their associated kinds. This is useful when administrators need to discover the exact resource name accepted by kubectl commands. It can also help when working with unfamiliar custom resources installed through extensions. The command queries the API server rather than merely displaying locally remembered resource definitions.
Question 130
Which setting makes a Service reachable only inside the cluster by default?
- ClusterIP
- InternalOnly
- PrivateIP
- LocalService
Correct Answer: 1
Explanation:
ClusterIP is the default Kubernetes Service type and provides a virtual IP reachable from within the cluster’s networking environment. It allows Pods and other internal clients to communicate with the selected backend Pods through a stable Service endpoint. ClusterIP does not normally expose the application directly to external clients. Other Service types, such as NodePort or LoadBalancer, provide additional exposure mechanisms. Internal Services are commonly used for communication between application tiers such as frontend, API, and database workloads.
Question 131
Which command removes a taint from a node?
- kubectl taint nodes
- kubectl untaint node
- kubectl clear-taint
- kubectl remove taint
Correct Answer: 1
Explanation:
The kubectl taint nodes command can add or remove taints from Kubernetes nodes. To remove a specific taint, the taint key is followed by a trailing minus sign. This allows administrators to change node scheduling behavior without recreating the node. Removing a taint can make the node eligible for Pods that previously lacked the required toleration. Care should be taken because taints are often used deliberately to reserve nodes or protect specialized workloads from unsuitable scheduling.
Question 132
Which field defines environment variables from all keys in a ConfigMap?
- envConfig
- envFrom
- configEnv
- mapEnvironment
Correct Answer: 2
Explanation:
The envFrom field allows a container to import environment variables from an entire ConfigMap or Secret. Each eligible key becomes an environment variable inside the container, subject to Kubernetes naming requirements. This differs from the individual env configuration, where specific keys can be selected and assigned explicitly. Using envFrom can simplify manifests when an application needs many configuration values from the same source. Administrators should ensure that ConfigMap keys are suitable for use as environment variable names.
Question 133
Which storage resource requests capacity from a PersistentVolume system?
- PersistentVolumeClaim
- StorageRequest
- VolumeClaimSet
- PersistentStorage
Correct Answer: 1
Explanation:
A PersistentVolumeClaim, or PVC, represents a request for storage by a workload. It can specify requirements such as requested capacity, access modes, and a StorageClass. Kubernetes then attempts to bind the claim to a compatible PersistentVolume, either through an existing volume or dynamic provisioning. Applications normally reference the PVC rather than directly managing the underlying PersistentVolume. This separation allows storage administrators and application developers to work with storage through a consistent Kubernetes abstraction.
Question 134
Which admission feature can reject or modify API requests before persistence?
- kube-proxy
- kubelet
- Admission controller
- CoreDNS
Correct Answer: 3
Explanation:
Admission controllers intercept requests after authentication and authorization but before the object is persisted by the API server. They can validate requests, apply policies, or modify objects depending on the configured controller. This provides an important control point for enforcing cluster-wide rules. Admission webhooks can also extend this behavior with custom validation or mutation logic. Admission control therefore operates at the API layer and is separate from node-level components such as kubelet or network components such as kube-proxy.
Question 135
Which Pod field requests a specific DNS resolution policy?
- dnsPolicy
- nameResolution
- dnsMode
- resolverPolicy
Correct Answer: 1
Explanation:
The dnsPolicy field controls how DNS configuration is established for containers in a Pod. The default policy is typically ClusterFirst, which uses the cluster DNS service for Kubernetes service discovery while allowing other names to be resolved according to the configured environment. Other policies can be used for specialized networking scenarios. Correct DNS policy configuration matters when applications need to resolve internal Service names or when a Pod uses host networking and requires different DNS behavior.
Question 136
Which command shows all Pods across every namespace?
- kubectl get pods –global
- kubectl get pods –all-namespaces
- kubectl list pods –cluster
- kubectl show pods –everywhere
Correct Answer: 2
Explanation:
The kubectl get pods –all-namespaces command displays Pods from every namespace visible to the current Kubernetes credentials. This is useful when troubleshooting cluster-wide issues because a namespace-specific query may hide workloads running elsewhere. The commonly used short form is kubectl get pods -A. Administrators can use the output to identify unexpected workloads, compare Pod states across namespaces, or quickly determine whether an issue affects one namespace or a broader portion of the cluster.
Question 137
Which controller maintains one Pod on each eligible node?
- StatefulSet
- ReplicaSet
- DaemonSet
- Deployment
Correct Answer: 3
Explanation:
A DaemonSet ensures that a copy of a Pod runs on each node matching its scheduling requirements. This makes DaemonSets useful for node-level services such as logging agents, monitoring collectors, and networking components. When a new eligible node joins the cluster, the DaemonSet controller can create the corresponding Pod there automatically. Conversely, when a node becomes ineligible or is removed, the associated DaemonSet workload is adjusted accordingly. Unlike a Deployment, its purpose is tied to node coverage rather than maintaining a general replica count.
Question 138
Which command validates the fields supported by a Kubernetes resource?
- kubectl inspect
- kubectl schema
- kubectl explain
- kubectl fields
Correct Answer: 3
Explanation:
The kubectl explain command displays documentation for Kubernetes resource fields and their structure. It is useful when creating or troubleshooting manifests because administrators can inspect which fields are available and understand their expected usage. For example, kubectl explain deployment.spec can provide information about the Deployment specification. This command queries the API schema available to kubectl and is especially valuable during CKA-style tasks where writing or modifying manifests quickly is required.
Question 139
Which scheduling mechanism can prevent two replicas sharing a node?
- Pod anti-affinity
- NodeSelector
- Pod priority
- ResourceQuota
Correct Answer: 1
Explanation:
Pod anti-affinity allows administrators to express rules that discourage or prevent selected Pods from being scheduled near other Pods matching specified labels. A common use is distributing replicas across different nodes to reduce the impact of a single-node failure. Required anti-affinity can impose a hard placement restriction, while preferred rules express a scheduling preference. This differs from node selection, which targets node characteristics rather than relationships between workloads. Anti-affinity is therefore useful when workload distribution itself is part of the availability requirement.
Question 140
Which Kubernetes resource records events such as scheduling failures?
- EventLog
- ClusterEvent
- Event
- ActivityRecord
Correct Answer: 3
Explanation:
The Kubernetes Event resource records notable occurrences involving cluster objects. Events can describe scheduling failures, image-pull problems, container lifecycle changes, and other operational conditions. Administrators commonly inspect them while troubleshooting with commands such as kubectl get events or through object descriptions. Events are especially useful because they provide contextual information about what Kubernetes observed and attempted. They are not intended to replace comprehensive application or audit logging, but they provide valuable short-term diagnostic information about cluster activity.