View Full CNCF CKA Exam Dumps and Practice Test Dumps
Question 141
Which command opens an interactive shell inside a running container?
- kubectl shell
- kubectl exec -it
- kubectl enter
- kubectl connect
Correct Answer: 2
Explanation:
The kubectl exec -it command allows an administrator to start an interactive process inside a running container. The -i option keeps standard input available, while -t allocates a terminal. This is commonly used for troubleshooting applications, checking files, testing connectivity, or examining processes from inside the container environment. When a Pod contains multiple containers, the -c option can identify the intended container. This technique is especially useful when logs alone do not provide enough information to diagnose a running workload.
Question 142
Which object provides a stable identity for StatefulSet Pods?
- Deployment
- ReplicaSet
- DaemonSet
- StatefulSet
Correct Answer: 4
Explanation:
A StatefulSet manages applications that require stable identities for their Pods. Its Pods receive predictable names based on ordinal positions, such as web-0 and web-1. These identities remain associated with the corresponding StatefulSet replicas even when individual Pods are recreated. StatefulSets are useful for workloads that need stable network identities, persistent storage associations, or ordered deployment and termination behavior. This differs from ordinary replicated workloads where Pod names can change when replacement Pods are created.
Question 143
Which field specifies a container’s memory request?
- resources.requests.memory
- resources.memory.request
- memory.resources.request
- requests.resources.ram
Correct Answer: 1
Explanation:
A container’s memory request is defined under resources.requests.memory. The request represents the amount of memory Kubernetes uses when making scheduling decisions for the Pod. It does not necessarily represent the maximum memory the process can consume. That behavior is controlled by the memory limit. Resource requests help the scheduler determine whether a node has sufficient allocatable capacity for the workload. Correctly defining them is important because overly large requests can prevent scheduling, while unrealistically small values can produce inaccurate resource planning.
Question 144
Which command displays the kubelet service status on a systemd node?
- systemctl show kubelet
- service kubelet list
- systemctl status kubelet
- kubectl status kubelet
Correct Answer: 3
Explanation:
On a systemd-based Linux node, systemctl status kubelet displays the current status of the kubelet service. It can reveal whether the service is active, stopped, failed, or repeatedly restarting. The output also provides recent service messages that can help identify configuration or startup problems. This is useful during node troubleshooting because the kubelet is responsible for managing Pods assigned to that node. If the kubelet is unhealthy, workloads may stop being managed correctly even though the node itself remains reachable.
Question 145
Which field determines how many Pods a Job may run simultaneously?
- activeDeadlineSeconds
- completionMode
- parallelism
- successLimit
Correct Answer: 3
Explanation:
The parallelism field controls how many Pods belonging to a Job may run concurrently. Increasing this value allows multiple instances of the batch task to execute at the same time, potentially reducing overall completion time. It differs from completions, which specifies how many successful executions are required for the Job to finish. The appropriate value depends on the workload and available cluster resources. Excessive parallelism can create unnecessary resource pressure, while a very low value may make batch processing slower.
Question 146
Which object controls voluntary disruption for a replicated workload?
- ResourceQuota
- PodDisruptionBudget
- LimitRange
- PriorityClass
Correct Answer: 2
Explanation:
A PodDisruptionBudget helps maintain application availability during voluntary disruptions. It can specify either a minimum number of available Pods or a maximum number of unavailable Pods for a selected workload. This is particularly relevant during operations such as node maintenance or controlled Pod eviction. A PodDisruptionBudget does not prevent involuntary failures such as hardware crashes or severe resource pressure. Instead, it gives Kubernetes and administrators guidance about how much voluntary disruption the application can tolerate while remaining operational.
Question 147
Which command lists the contexts configured in kubeconfig?
- kubectl config get-contexts
- kubectl config list
- kubectl contexts show
- kubectl get contexts
Correct Answer: 1
Explanation:
The kubectl config get-contexts command lists the contexts available in the current kubeconfig. Each context can identify a cluster, user, and namespace combination. The output also indicates which context is currently active. This command is useful when administrators manage several Kubernetes environments and need to select the correct target before running commands. Unlike current-context, which reports only the active context, get-contexts provides the broader set of configured context choices.
Question 148
Which volume type exposes Pod metadata to a container?
- configMap
- secret
- downwardAPI
- metadataVolume
Correct Answer: 3
Explanation:
The downwardAPI volume allows selected Pod and container metadata to be made available to a container as files. Information such as Pod labels, annotations, and certain resource-related values can be exposed this way. This allows applications to discover information about their own execution environment without requiring direct access to the Kubernetes API. The approach is useful for applications that need contextual metadata while maintaining a clean separation from cluster administration credentials.
Question 149
Which command applies a manifest while creating or updating its objects?
- kubectl sync
- kubectl apply
- kubectl merge
- kubectl publish
Correct Answer: 2
Explanation:
The kubectl apply command creates or updates Kubernetes resources based on a manifest. It is commonly used for declarative resource management because the manifest represents the desired configuration. When the configuration changes, applying the updated manifest allows Kubernetes to reconcile the object toward that desired state. This differs from commands designed for imperative creation of individual resources. Declarative management through manifests is especially useful when configurations need to be maintained consistently and reapplied across environments.
Question 150
Which storage mode presents a volume as a filesystem inside a container?
- block
- raw
- device
- Filesystem
Correct Answer: 4
Explanation:
The Filesystem value for a volume’s volumeMode makes the storage available to the container as a mounted filesystem. The alternative Block mode exposes the storage as a raw block device, allowing applications that require direct block-level access to use it. The choice depends on the workload’s storage requirements and the capabilities of the underlying storage provider. Filesystem mode is the common choice for applications that expect ordinary directories and files rather than a raw device.
Question 151
Which command displays the current Kubernetes cluster endpoint information?
- kubectl cluster-info
- kubectl cluster-url
- kubectl endpoint-info
- kubectl server-info
Correct Answer: 1
Explanation:
The kubectl cluster-info command displays information about the Kubernetes control plane and other registered cluster services. It is useful as a quick connectivity check when beginning cluster troubleshooting. If the command cannot communicate with the API server, the administrator can investigate kubeconfig settings, network connectivity, authentication, or control-plane availability. The command does not provide complete cluster health diagnostics, but it offers a convenient first indication that kubectl can reach the configured Kubernetes environment.
Question 152
Which resource lets administrators define storage provisioning behavior?
- PersistentVolume
- VolumePolicy
- StorageClass
- ProvisioningRule
Correct Answer: 3
Explanation:
A StorageClass describes a class of storage and defines parameters used for dynamic volume provisioning. It can identify a provisioner and include settings that influence how storage is created. PersistentVolumeClaims can request a StorageClass when they need dynamically provisioned storage. This abstraction allows different storage types to be offered to workloads without requiring application manifests to contain provider-specific provisioning details. Administrators can create multiple StorageClasses for different performance, replication, or storage-backend requirements.
Question 153
Which container hook runs immediately before termination?
- startup
- shutdown
- preStop
- beforeExit
Correct Answer: 3
Explanation:
The preStop lifecycle hook executes immediately before a container is terminated, allowing the application to perform shutdown-related actions. It can be useful for tasks such as notifying another system, completing cleanup, or allowing an application to stop accepting new work. The hook runs as part of the Pod termination process and should complete within the available termination grace period. Administrators should design the hook carefully because a long-running or failed cleanup operation can affect how gracefully the container shuts down.
Question 154
Which RBAC object contains a reusable set of permissions?
- ClusterRole
- RoleBinding
- ServiceAccount
- SubjectAccessReview
Correct Answer: 1
Explanation:
A ClusterRole defines a set of RBAC permissions that can be reused by bindings. Despite its name, a ClusterRole can describe permissions for both cluster-scoped resources and namespaced resources. A Role is another permission definition that exists within a namespace. Bindings then associate these permission definitions with users, groups, or ServiceAccounts. Keeping permission rules separate from their assignments makes RBAC configuration easier to reuse and manage across different subjects or namespaces.
Question 155
Which command removes a Kubernetes resource immediately by name?
- kubectl erase
- kubectl delete
- kubectl remove
- kubectl destroy
Correct Answer: 2
Explanation:
The kubectl delete command removes Kubernetes resources such as Pods, Deployments, Services, and other objects. Administrators can specify the resource type and object name, or use a manifest to identify resources for deletion. Deletion behavior can be influenced by object ownership and finalizers, so an object may remain temporarily while required cleanup occurs. This command should be used carefully because removing a controller-managed resource can trigger significant changes to the workloads it manages.
Question 156
Which mechanism can expose a Secret as files inside a container?
- secretRef
- secretEnv
- Secret volume
- credentialMount
Correct Answer: 3
Explanation:
A Secret can be mounted as a volume so that its keys become files within a container filesystem. This allows applications to consume credentials or other sensitive configuration without embedding those values directly into container images. Kubernetes manages the Secret object separately from the Pod specification, while the volume provides the container with access to the selected data. Administrators should still apply appropriate RBAC permissions because access to the Secret object determines who can retrieve its underlying values.
Question 157
Which node condition indicates insufficient available memory?
- MemoryPressure
- MemoryShortage
- LowMemory
- RAMPressure
Correct Answer: 1
Explanation:
The MemoryPressure node condition indicates that a node is experiencing memory pressure. Kubernetes can respond to resource pressure through eviction mechanisms when available resources become critically constrained. Administrators can inspect node conditions to determine whether memory availability is contributing to workload problems. Memory pressure may result from workloads consuming substantial memory or from insufficient node capacity. Investigating resource requests, limits, actual consumption, and node capacity can help identify the cause before changing workloads or adding capacity.
Question 158
Which scheduling stage removes nodes that cannot satisfy Pod requirements?
- Binding
- Scoring
- Filtering
- Reservation
Correct Answer: 3
Explanation:
During scheduling, the filtering stage removes nodes that cannot satisfy the Pod’s requirements. Factors can include resource requests, taints, affinity rules, and other scheduling constraints. The remaining feasible nodes then proceed to scoring, where Kubernetes determines which suitable node is preferable. If no nodes survive filtering, the Pod remains unscheduled until conditions change. Understanding filtering helps explain why a Pod can remain Pending even when nodes appear available, because available capacity alone does not guarantee that every scheduling constraint is satisfied.
Question 159
Which resource defines the maximum number of stored object versions for a ConfigMap?
- ResourceQuota
- LimitRange
- RevisionHistoryLimit
- ConfigMapDataPolicy
Correct Answer: 3
Explanation:
revisionHistoryLimit is associated with workload controllers such as Deployments and controls how many old ReplicaSet revisions are retained for rollback purposes. It does not define versions for ConfigMaps themselves. Retaining historical workload revisions can make rollback possible while limiting unnecessary object accumulation. Administrators should choose a value that provides sufficient recovery history without retaining excessive obsolete revisions. This setting is particularly relevant when applications undergo frequent Deployment updates and rollback capability needs to remain available.
Question 160
Which command checks authorization for a specific Kubernetes action?
- kubectl auth check
- kubectl auth can-i
- kubectl permission-test
- kubectl access verify
Correct Answer: 2
Explanation:
The kubectl auth can-i command checks whether the current identity is authorized to perform a specified Kubernetes action. For example, it can determine whether a user or ServiceAccount may create Pods, read Secrets, or delete Deployments. Administrators can also evaluate permissions in the context of another identity when appropriate authorization exists. This makes the command valuable for diagnosing RBAC problems because it tests authorization directly rather than requiring administrators to infer permissions from multiple Role and RoleBinding objects.