Courseiva

Certified Kubernetes Administrator CKA (CKA) — Questions 376–450

726 questions total · 10pages · All types, answers revealed

Page 5

Page 6 of 10

Page 7
376
Multi-Selectmedium

Which THREE components are required for a pod to resolve a Service DNS name?

Select 3 answers
A.The Service exists in the cluster
B.CoreDNS is running and has a Service entry for the cluster domain
C.kubelet configures the pod's /etc/resolv.conf
D.kube-proxy is running in iptables mode
E.A CNI plugin is installed
AnswersA, B, C

The Service must exist in the cluster because the cluster DNS system only creates DNS A/AAAA records for Service objects, not for individual pods or arbitrary endpoints. When a Service is created, the DNS controller registers a name in the form <service>.<namespace>.svc.<cluster-domain>, and without that object there is no record for the resolver to return. This is a prerequisite independent of the DNS server itself or the pod's resolver configuration: even a healthy CoreDNS and correctly set resolv.conf cannot resolve a Service name that was never defined.

Why this answer

A Pod resolves a Service DNS name by querying the cluster's DNS service, which only returns an A/AAAA record if the Service object exists. Without the Service, the DNS name has no corresponding cluster IP to resolve, so the query fails with NXDOMAIN.

Exam trap

A common trap is confusing kube-proxy's role in Service traffic routing with DNS name resolution. kube-proxy handles load balancing of traffic to Service pods, but it does not resolve DNS names. DNS resolution relies solely on CoreDNS and the pod's resolv.conf configuration.

377
MCQeasy

Which resource type is used to configure HTTP/HTTPS routing to Services?

A.EndpointSlice
B.NetworkPolicy
C.Ingress
D.Service
AnswerC

Ingress is the standard Kubernetes API resource designed specifically to manage external access to services, typically via HTTP and HTTPS. It allows administrators to define routing rules based on hostnames (Layer 7 domain names) and URL paths, enabling a single external IP address to expose multiple backend services.

Why this answer

Ingress is the Kubernetes resource that provides HTTP and HTTPS routing from outside the cluster to Services within the cluster. It defines rules for host-based and path-based routing, TLS termination, and load balancing, making it the correct choice for configuring external HTTP/HTTPS access.

Exam trap

The trap here is that candidates confuse a Service's external exposure (e.g., NodePort or LoadBalancer) with the need for HTTP/HTTPS routing, forgetting that Ingress is the dedicated resource for L7 routing and TLS termination.

How to eliminate wrong answers

Option A is wrong because EndpointSlice is a resource that tracks network endpoints (IP addresses and ports) for a Service, not for routing HTTP/HTTPS traffic. Option B is wrong because NetworkPolicy is used to control ingress and egress traffic between Pods at the network layer (L3/L4), not for HTTP/HTTPS routing. Option D is wrong because a Service exposes Pods internally or via a load balancer but does not provide HTTP/HTTPS routing rules, host-based routing, or TLS termination.

378
MCQhard

You have configured a ServiceAccount with an associated image pull secret. The Pod referencing this ServiceAccount still fails with ImagePullBackOff due to authentication errors. What is the most likely misconfiguration?

A.The secret is not in the same namespace as the Pod.
B.The secret type is wrong; it should be kubernetes.io/dockercfg.
C.The ServiceAccount does not have the imagePullSecrets field configured.
D.The Pod spec must set the secret in imagePullSecrets directly.
AnswerA

A Kubernetes Secret, including one used for image pull credentials, must reside in the same namespace as the Pod that attempts to consume it. While this is a fundamental requirement for secret access, the primary issue indicated by the correct answer is that the ServiceAccount itself isn't configured to *use* any image pull secret. Therefore, the error would not specifically point to a cross-namespace secret issue, but rather a lack of credentials being presented at all.

Why this answer

Secrets in Kubernetes are namespace-scoped. When you configure `imagePullSecrets` on a ServiceAccount, the ServiceAccount admission controller automatically injects these secrets into any Pod referencing that ServiceAccount. However, because Secrets are namespace-scoped, the secret must exist in the same namespace as the ServiceAccount and the Pod.

If the secret was created in a different namespace, the Pod will fail to pull the image with an authentication error (ImagePullBackOff).

Exam trap

Candidates often forget that Secrets are namespace-scoped. Even if a ServiceAccount correctly references an image pull secret by name, the secret must be created in the same namespace as the ServiceAccount and the Pod using it.

How to eliminate wrong answers

Option A is wrong because the secret must be in the same namespace as the Pod and ServiceAccount for the reference to work; if it were in a different namespace, the Pod would fail to mount it entirely, not just with an authentication error. Option B is wrong because the correct secret type for image pull secrets is `kubernetes.io/dockerconfigjson` (not `kubernetes.io/dockercfg`, which is legacy and less common), and using the wrong type would cause a different error (e.g., invalid format) rather than a pure authentication failure. Option D is wrong because while a Pod can directly specify imagePullSecrets in its spec, the question states the Pod references a ServiceAccount, so the expected behavior is that the ServiceAccount's imagePullSecrets are automatically injected; requiring direct Pod spec configuration would defeat the purpose of using a ServiceAccount.

379
MCQmedium

A developer runs 'kubectl port-forward service/my-service 8080:80'. What does this command do?

A.It creates a proxy that routes traffic from the service's ClusterIP to the local machine on port 8080.
B.It forwards incoming traffic on local port 8080 to port 80 on the service's ClusterIP.
C.It exposes the service as a NodePort on port 8080.
D.It creates a new service of type LoadBalancer on port 8080.
AnswerB

This is the correct behavior of the command. It binds to port 8080 on the local loopback interface and securely tunnels any connection made to localhost:8080 through the API server to port 80 of the specified Service, which then routes it to the backing Pods.

Why this answer

`kubectl port-forward` creates a tunnel from a local port on the client machine to a specified port on a Kubernetes resource, in this case a Service. It forwards traffic received on localhost:8080 to the Service's ClusterIP on port 80, allowing the developer to access the service without exposing it externally.

Exam trap

The trap here is that candidates confuse `kubectl port-forward` with `kubectl expose` or `kubectl proxy`, mistakenly thinking it creates a permanent Service or NodePort, when in fact it only creates a temporary, client-side tunnel.

How to eliminate wrong answers

Option A is wrong because `kubectl port-forward` does not create a proxy that routes traffic from the service's ClusterIP to the local machine; it does the opposite — it forwards from the local machine to the service. Option C is wrong because the command does not expose the service as a NodePort; NodePort is a Service type that opens a port on every node, not a local port-forward. Option D is wrong because `kubectl port-forward` does not create any Service object, let alone a LoadBalancer type; it only establishes a temporary tunnel for debugging.

380
MCQhard

You are managing a Kubernetes cluster that hosts a microservices application. One of the services, 'payment-processor', is critical and must always be available. It has a Deployment with 3 replicas, each requesting 1 CPU and 2Gi memory. Recently, the team added a new service 'data-analyzer' that runs as a DaemonSet on all nodes, consuming significant CPU and memory. After the addition, you notice that 'payment-processor' pods are occasionally being evicted, and new pods are slow to be scheduled. You check node resource usage and find that some nodes are overcommitted. You want to ensure that 'payment-processor' pods are never evicted and are scheduled before less critical workloads. Which action should you take?

A.Add a taint to nodes that have low resources and add tolerations only to 'payment-processor' pods
B.Increase the resource requests for 'payment-processor' pods to guarantee resources
C.Create a PriorityClass with a high value and assign it to the 'payment-processor' Deployment
D.Use node affinity to ensure 'payment-processor' pods run on dedicated nodes
AnswerC

Creating a PriorityClass with a high integer value and assigning it to the 'payment-processor' Deployment is the most effective solution. Pods with higher priority are preferentially scheduled by the kube-scheduler. Crucially, if a high-priority 'payment-processor' pod cannot be scheduled due to insufficient resources on any node, the scheduler will attempt to preempt (evict) lower-priority pods on suitable nodes to free up the necessary resources, thereby ensuring the critical workload runs.

Why this answer

PriorityClass with a high value ensures that 'payment-processor' pods are considered higher priority than other pods during scheduling and eviction. When nodes are overcommitted, the Kubernetes scheduler will preempt lower-priority pods to make room for higher-priority pods, and the kubelet will evict lower-priority pods first when resources are scarce. This directly addresses the requirement that 'payment-processor' pods are never evicted and are scheduled before less critical workloads.

Exam trap

The trap here is that candidates often confuse taints/tolerations or node affinity with priority and preemption, but those features only affect scheduling placement, not eviction ordering or preemption behavior.

How to eliminate wrong answers

Option A is wrong because taints and tolerations control which pods can be scheduled on a node, but they do not provide a mechanism for eviction priority or guarantee that 'payment-processor' pods will be scheduled before other pods on the same node; taints only repel pods without tolerations, and adding tolerations to 'payment-processor' would allow them to schedule on tainted nodes but not prevent eviction. Option B is wrong because increasing resource requests for 'payment-processor' pods would require more resources to schedule them, potentially making scheduling harder, and it does not affect eviction ordering; requests only affect scheduling decisions, not eviction priority. Option D is wrong because node affinity only influences scheduling placement, not eviction behavior; it can ensure pods run on specific nodes but does not prevent eviction when those nodes are overcommitted, nor does it prioritize scheduling over other workloads.

381
Multi-Selecthard

Which TWO statements about EndpointSlices are correct?

Select 2 answers
A.EndpointSlices improve scalability compared to Endpoints.
B.EndpointSlices include topology information like zone.
C.EndpointSlices are created manually by the user.
D.Each EndpointSlice can contain only one endpoint.
E.EndpointSlices are only used with ClusterIP services.
AnswersA, B

The legacy Endpoints API stores every IP address for a Service in a single object, which becomes extremely large and causes every node's kube-proxy to be notified on any change. EndpointSlices partition that data into multiple, smaller objects that default to a maximum of 100 endpoints each, so scaling to thousands of pods does not create a single massive, frequently updated resource. This dramatically reduces the update blast radius and improves overall cluster performance.

Why this answer

Option A is correct because EndpointSlices improve scalability over the legacy Endpoints object: instead of one large Endpoints resource per Service, the EndpointSlice controller splits endpoints across multiple EndpointSlice objects (default up to 100 endpoints per slice), reducing the size of updates propagated to kube-proxy and other watchers. Option B is correct because each EndpointSlice endpoint includes topology information such as the node's zone and hostname (under the topology field, e.g., kubernetes.io/hostname and topology.kubernetes.io/zone), which enables topology-aware routing and traffic distribution. Option C is incorrect because EndpointSlices are normally created and managed automatically by the EndpointSlice controller (and mirrored by kube-proxy), not manually by users.

Option D is incorrect because a single EndpointSlice can hold many endpoints (up to 100 by default), not just one. Option E is incorrect because EndpointSlices back all Service types that have endpoints, including ClusterIP, NodePort, LoadBalancer, and headless Services, not only ClusterIP.

Exam trap

The trap here is that candidates often assume EndpointSlices are a manual or optional feature, or that they only apply to ClusterIP Services, when in reality they are the default and automatically managed for all Services with selectors, and they support topology-aware routing.

382
Drag & Dropmedium

Drag and drop the steps to troubleshoot a Node that is in NotReady state into the correct order.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Start with kubectl to identify the node, then SSH, check kubelet and runtime, review logs, then restart.

383
MCQmedium

You are trying to debug a network connectivity issue between two pods. Pod A can reach the internet but cannot reach Pod B's IP address. Which command should you use to test connectivity from within Pod A to Pod B's service?

A.kubectl exec pod-a -- nslookup service-b
B.curl http://<node-ip>:<nodeport>
C.ssh node-ip 'curl http://<pod-b-ip>:80'
D.kubectl exec pod-a -- curl http://service-b:80
AnswerD

This is the most effective command because `kubectl exec` runs `curl` directly within the network namespace of `pod-a`, simulating the exact origin of the communication. By targeting `http://service-b:80`, it simultaneously tests DNS resolution of the service name, the ability to establish a TCP connection to the service's ClusterIP on port 80, and the application's responsiveness. This provides a comprehensive end-to-end test from the perspective of the source pod.

Why this answer

It uses `kubectl exec` to run a command inside Pod A, then uses `curl` to reach Pod B's service by its DNS name (`service-b`) and port 80. This tests connectivity from Pod A's network namespace to the ClusterIP service, which is the correct way to verify pod-to-service communication within the cluster. Using the service name leverages Kubernetes internal DNS (CoreDNS) to resolve to the service's virtual IP, and `curl` sends an HTTP request to confirm reachability.

Exam trap

The trap here is that candidates confuse testing pod-to-service connectivity (which requires using the service DNS name from within the pod) with testing node-to-pod or DNS-only checks, leading them to pick options that bypass the pod's network namespace or only test DNS resolution.

How to eliminate wrong answers

Option A is wrong because `nslookup` only tests DNS resolution of the service name, not actual network connectivity to the service IP or pod. Option B is wrong because it tests connectivity from the node to the NodePort, not from within Pod A to the service; this bypasses Pod A's network namespace and does not verify pod-to-service communication. Option C is wrong because it runs `curl` from the node (via SSH) to Pod B's IP, which tests node-to-pod connectivity, not pod-to-service connectivity from within Pod A.

384
MCQhard

You have a Deployment 'db' with 3 replicas. Each pod writes to a PersistentVolumeClaim (PVC). A StatefulSet is required for stable network identities and ordered pod management. Which of the following is a key characteristic that differentiates a StatefulSet from a Deployment?

A.StatefulSets support rolling updates but not canary deployments
B.StatefulSets automatically create a Service for each pod
C.StatefulSets cannot use PersistentVolumeClaims
D.StatefulSets maintain a sticky identity for each pod, including stable hostnames and persistent storage
AnswerD

StatefulSets are designed to provide a stable, unique identity to each pod they manage, which is crucial for stateful applications. This identity includes a stable network hostname, typically in the format `$(pod-name).$(headless-service-name)`, and persistent storage that remains associated with the pod's ordinal index even if the pod is rescheduled to a different node. This ensures data integrity and consistent application behavior across pod lifecycle events.

Why this answer

StatefulSets assign each pod a unique, stable network identity (e.g., a hostname derived from the StatefulSet name and ordinal index) and guarantee that each pod's PersistentVolumeClaim is bound to the same PersistentVolume across rescheduling. This ensures that each pod retains its identity and data, which is critical for stateful applications like databases. Deployments, in contrast, treat pods as interchangeable and do not guarantee stable hostnames or persistent storage binding.

Exam trap

The trap here is that candidates often confuse the automatic creation of a Headless Service (which is required but not automatically created) with the automatic creation of a Service for each pod, leading them to incorrectly select Option B.

How to eliminate wrong answers

Option A is wrong because StatefulSets do support canary deployments via the `partition` parameter in the rolling update strategy, allowing a subset of pods to be updated while others remain unchanged. Option B is wrong because StatefulSets do not automatically create a Service for each pod; they require a Headless Service (with `clusterIP: None`) to provide stable network identities, but the Service itself is not automatically created by the StatefulSet controller. Option C is wrong because StatefulSets can and commonly do use PersistentVolumeClaims, and the StatefulSet controller manages the creation and binding of PVCs for each pod based on a `volumeClaimTemplate`.

385
MCQmedium

An admin wants to view the current context in their kubeconfig. Which command should they use?

A.kubectl config get-contexts
B.kubectl cluster-info
C.kubectl config current-context
D.kubectl config view
AnswerC

kubectl config current-context is the dedicated subcommand that reads the kubeconfig file and prints the name of the currently active context to standard output. It returns exactly one line—the context name—with no additional formatting, making it ideal for scripting and automation. This directly satisfies the admin's need to view the current context, so it is the correct command.

Why this answer

`kubectl config current-context` is the exact command to display the currently active context from the kubeconfig file. The context includes the cluster, namespace, and user that `kubectl` will use by default. This is a direct query of the `current-context` field in the kubeconfig YAML/JSON structure.

Exam trap

The trap here is that candidates often confuse `get-contexts` (which lists all contexts) with `current-context` (which shows only the active one), or they mistakenly think `cluster-info` or `config view` will directly reveal the current context without additional parsing.

How to eliminate wrong answers

Option A is wrong because `kubectl config get-contexts` lists all available contexts from the kubeconfig file, not just the current one; it requires the user to visually identify the active context (marked with an asterisk). Option B is wrong because `kubectl cluster-info` displays information about the cluster endpoints (e.g., master and services), not the current context from the kubeconfig. Option D is wrong because `kubectl config view` outputs the entire kubeconfig file contents, which includes all contexts, clusters, and users, but does not specifically highlight or return only the current context.

386
Multi-Selectmedium

Which THREE statements about PersistentVolumeClaims (PVCs) are correct?

Select 3 answers
A.A PVC defines the reclaim policy for the underlying PersistentVolume.
B.A PVC binds to a PersistentVolume that satisfies its storage request and access modes.
C.A PVC can request storage expansion if the StorageClass allows it.
D.A PVC is a cluster-scoped resource.
E.A PVC can be mounted by multiple Pods if it is bound to a PV with ReadWriteMany access mode.
AnswersB, C, E

Kubernetes matches a PVC to a PV by comparing requested capacity and access modes; the selected PV must have at least the requested storage size and advertise access modes that satisfy the claim. The control plane performs this binding automatically, and when a match is found, the claim and volume are bound in a one-to-one relationship, meaning no other PVC can use that same PV until the bound is released. If no suitable PV exists, the claim stays in Pending, awaiting either an administrator-created PV or a dynamically provisioned volume from the named StorageClass.

Why this answer

Option B is correct because the PersistentVolume controller matches a PVC to a PV whose capacity meets or exceeds the PVC's spec.resources.requests.storage and whose access modes (e.g., ReadWriteOnce, ReadWriteMany) satisfy the PVC's spec.accessModes, then binds them. Option C is correct because a PVC can request a larger size by editing spec.resources.requests.storage, and the resize succeeds only if the bound StorageClass has allowVolumeExpansion: true and the underlying CSI driver supports expansion. Option E is correct because access modes are enforced by the PV/PVC binding: a PVC requesting ReadWriteMany that binds to a PV supporting ReadWriteMany can be mounted read-write by multiple Pods simultaneously (e.g., NFS or CephFS).

Option A is wrong because the reclaim policy (Retain, Delete, Recycle) is defined on the PersistentVolume or inherited from the StorageClass, not on the PVC. Option D is wrong because a PVC is a namespaced resource, unlike the cluster-scoped PersistentVolume.

Exam trap

The trap here is that candidates often confuse PVCs as cluster-scoped resources (like PVs) or assume PVCs control PV reclaim policies, when in fact PVCs are namespaced and only request storage characteristics.

387
MCQmedium

A DevOps team needs to provide persistent storage to a set of pods that all require read-write access to the same data simultaneously. Which volume type should they use?

A.PersistentVolumeClaim with ReadWriteMany
B.hostPath
C.emptyDir
D.PersistentVolumeClaim with ReadWriteOnce
AnswerA

A PersistentVolumeClaim configured with the ReadWriteMany (RWX) access mode allows a volume to be mounted as read-write by many nodes concurrently. This is the correct choice for enabling multiple pods distributed across different nodes in a cluster to simultaneously access and modify the same persistent storage backend.

Why this answer

A PersistentVolumeClaim with ReadWriteMany (RWX) is the correct choice because it allows multiple pods to mount the same volume simultaneously with read-write access. This access mode is supported by network-based storage backends like NFS, GlusterFS, or CephFS, which provide the necessary concurrency controls for shared access across pods.

Exam trap

The trap here is that candidates often confuse ReadWriteOnce (RWO) with multi-pod access, forgetting that RWO explicitly limits the volume to a single pod mount, while ReadWriteMany (RWX) is required for simultaneous shared access.

How to eliminate wrong answers

Option B (hostPath) is wrong because it mounts a directory from the host node's filesystem into the pod, which does not support simultaneous read-write access from pods running on different nodes; it is also not portable and poses security risks. Option C (emptyDir) is wrong because its lifecycle is tied to the pod — data is deleted when the pod is removed, and it cannot be shared across pods on different nodes. Option D (PersistentVolumeClaim with ReadWriteOnce) is wrong because ReadWriteOnce (RWO) restricts the volume to be mounted as read-write by a single pod on a single node, making it unsuitable for multi-pod shared access.

388
MCQeasy

Which command creates a ConfigMap named 'app-config' from the file 'config.properties'?

A.kubectl create configmap app-config --file=config.properties
B.kubectl create configmap app-config --from-env-file=config.properties
C.kubectl create configmap app-config --from-literal=config.properties
D.kubectl create configmap app-config --from-file=config.properties
AnswerD

This command correctly uses the `--from-file` flag, which instructs `kubectl` to read the entire content of the specified file, `config.properties`. It then creates a ConfigMap named `app-config` where the key for this entry defaults to the filename, `config.properties`, and its corresponding value is the complete textual content of that file. This is the standard and intended method for incorporating file contents directly into a ConfigMap.

Why this answer

`kubectl create configmap app-config --from-file=config.properties` creates a ConfigMap named 'app-config' using the content of the file 'config.properties'. The `--from-file` flag reads the file and stores its entire content as a single key-value pair, where the key defaults to the filename (config.properties) and the value is the file's content. This is the standard syntax for creating a ConfigMap from a file in Kubernetes.

Exam trap

The trap here is confusing `--from-file` with `--from-env-file`; candidates often mistakenly choose `--from-env-file` because they think it reads any configuration file, but it only works with files formatted as environment variable definitions (KEY=VALUE per line), not arbitrary files like config.properties.

How to eliminate wrong answers

Option A is wrong because `--file` is not a valid flag for `kubectl create configmap`; the correct flag is `--from-file`. Option B is wrong because `--from-env-file` is used to import a file containing key-value pairs in a line-by-line format (like a .env file), not to store the entire file content as a single key. Option C is wrong because `--from-literal` is used to specify key-value pairs directly on the command line (e.g., `--from-literal=key=value`), not to reference a file.

389
Multi-Selectmedium

Which TWO of the following are valid methods to authenticate to the Kubernetes API server?

Select 2 answers
A.Client certificate
B.ServiceAccount token
C.Secrets
D.RBAC
E.Node authorization
AnswersA, B

Kubernetes authenticates users via X.509 client certificates presented during the TLS handshake. The certificate's Common Name (CN) is mapped to the username, and organization fields become groups. This is a primary method for external users and components like the kubelet to authenticate to the API server.

Why this answer

Option A (Client certificate) is correct because the Kubernetes API server natively supports X.509 client certificate authentication via the --client-ca-file flag, where the certificate's CN becomes the username and O fields become group memberships. Option B (ServiceAccount token) is correct because pods authenticate to the API server using automatically mounted ServiceAccount tokens (JWTs) presented as Bearer tokens, validated by the API server against the service account signing key. Option C (Secrets) is not an authentication method itself — Secrets are objects that may store credentials such as tokens, but they do not authenticate a client to the API server.

Option D (RBAC) is an authorization mechanism that determines what an authenticated identity may do, not how it proves its identity. Option E (Node authorization) is an authorization mode (Node authorizer) that governs what kubelets may access, not an authentication method.

Exam trap

The trap here is confusing authorization (RBAC, Node authorization) with authentication, or thinking that Secrets are a credential type presented to the API server, when they are merely storage objects that can hold tokens for later use.

390
MCQmedium

You are debugging a DNS issue from within a pod. The pod is running 'busybox'. Which command would you use to test DNS resolution for 'kubernetes.default.svc.cluster.local'?

A.kubectl describe svc kubernetes -n default
B.kubectl exec -it my-pod -- curl kubernetes.default.svc.cluster.local
C.kubectl run test --image=busybox -- nslookup kubernetes.default.svc.cluster.local
D.kubectl exec -it my-pod -- nslookup kubernetes.default.svc.cluster.local
AnswerD

Executing `kubectl exec -it my-pod -- nslookup kubernetes.default.svc.cluster.local` is the most direct and effective method for debugging DNS resolution issues from within a specific pod. This command leverages `kubectl exec` to run `nslookup` directly inside `my-pod`, utilizing that pod's `/etc/resolv.conf` and its configured DNS server. It precisely tests whether the pod itself can successfully resolve the fully qualified domain name (FQDN) of the `kubernetes` service, providing immediate insight into its DNS capabilities.

Why this answer

`kubectl exec -it my-pod -- nslookup kubernetes.default.svc.cluster.local` runs the `nslookup` command directly inside the running pod, which uses the pod's configured DNS resolver (typically CoreDNS) to resolve the Kubernetes service FQDN. This is the standard method to test DNS resolution from within a pod, as it bypasses any external DNS and validates the cluster's internal DNS chain.

Exam trap

The trap here is that candidates often choose Option B (curl) thinking it tests DNS, but curl tests HTTP connectivity, not resolution; or they choose Option C (kubectl run) which creates a new pod with default DNS settings, missing the specific pod's DNS configuration that may be the root cause of the issue.

How to eliminate wrong answers

Option A is wrong because `kubectl describe svc kubernetes -n default` only shows the service's metadata and endpoints, not DNS resolution; it does not test the pod's ability to resolve the name. Option B is wrong because `curl` tests HTTP connectivity, not DNS resolution; a successful curl could still hide a DNS failure if the IP is cached or resolved via other means, and busybox may not include curl by default. Option C is wrong because `kubectl run test --image=busybox -- nslookup ...` creates a new ephemeral pod, which is unnecessary and slower; it also does not test DNS from the existing pod that is experiencing the issue, missing the specific pod's DNS configuration (e.g., dnsPolicy, resolv.conf).

391
MCQhard

You have a kube-proxy running in ipvs mode. Which of the following is true about IPVS?

A.IPVS supports multiple load balancing algorithms.
B.IPVS uses iptables rules for service discovery.
C.IPVS is the default kube-proxy mode since Kubernetes 1.0.
D.IPVS cannot handle large numbers of services.
AnswerA

IPVS (IP Virtual Server) is a kernel-level transport-layer load balancer that exposes multiple scheduling algorithms, including round-robin (rr), least-connections (lc), destination hashing (dh), and source hashing (sh). kube-proxy in IPVS mode programs these algorithms into the kernel, allowing operators to select a traffic distribution strategy that best fits their workload instead of being limited to iptables' simple random or default behavior.

Why this answer

IPVS (IP Virtual Server) supports multiple load balancing algorithms, such as round-robin, least-connection, source-hashing, and others, which is a key advantage over iptables mode. This allows kube-proxy to distribute traffic across pods more flexibly and efficiently, especially in high-traffic environments.

Exam trap

The trap here is that candidates often confuse IPVS with iptables, assuming IPVS still relies on iptables rules for service discovery, when in fact IPVS uses a separate kernel-level mechanism with its own scheduling algorithms.

How to eliminate wrong answers

Option B is wrong because IPVS uses a hash table and kernel-level load balancing, not iptables rules, for service discovery and packet forwarding; iptables mode is a separate kube-proxy mode. Option C is wrong because IPVS is not the default mode since Kubernetes 1.0; iptables mode was the default for many years, and IPVS became an optional mode later (introduced as alpha in 1.8 and stable in 1.11). Option D is wrong because IPVS is specifically designed to handle large numbers of services efficiently, using a hash table that scales better than iptables linear rule processing.

392
MCQmedium

You run `kubectl expose deployment web --port=80 --target-port=8080 --type=NodePort` and the Service is created. What is the effect of this command?

A.It creates a NodePort Service, making the deployment accessible on each node's IP on a high port.
B.It creates a LoadBalancer Service and provisions a cloud load balancer.
C.It creates a ClusterIP Service that is only accessible within the cluster.
D.It creates an ExternalName Service that maps to an external DNS name.
AnswerA

The `kubectl expose deployment web --port=80 --target-port=8080 --type=NodePort` command creates a Service of type NodePort, which allocates a high port (30000–32767) on every cluster node and forwards traffic from that port to port 8080 on the pods selected by the `web` deployment. This satisfies the requirement to expose the deployment externally without a cloud load balancer, using each node’s IP address as the access point.

Why this answer

The `kubectl expose deployment web --port=80 --target-port=8080 --type=NodePort` command creates a NodePort Service. This Service exposes the deployment on each node's IP address on a static port (in the range 30000-32767 by default), making it accessible from outside the cluster via `<NodeIP>:<NodePort>`. The `--type=NodePort` flag explicitly overrides the default ClusterIP type, and the Service will also automatically allocate a ClusterIP for internal routing.

Exam trap

The trap here is that candidates often confuse `--type=NodePort` with `--type=LoadBalancer`, assuming that exposing a Service on a node port automatically provisions a cloud load balancer, or they forget that NodePort Services also include a ClusterIP and are not purely external.

How to eliminate wrong answers

Option B is wrong because `--type=NodePort` does not create a LoadBalancer Service; a LoadBalancer Service requires `--type=LoadBalancer` and typically provisions a cloud load balancer via the cloud provider's integration. Option C is wrong because while a NodePort Service does include a ClusterIP for internal access, the explicit `--type=NodePort` flag creates a NodePort Service, not a pure ClusterIP Service; a ClusterIP Service would be created with `--type=ClusterIP` or by omitting the type flag. Option D is wrong because an ExternalName Service maps a Service to an external DNS name using the `externalName` field, which is not set by this command; `kubectl expose` does not support creating ExternalName Services directly.

393
MCQmedium

Based on the exhibit, the pod is in CrashLoopBackOff. Which command should you run NEXT to identify the root cause?

A.kubectl describe node node-1
B.kubectl top pod api-6f4d7b9d4c-abcde -n production
C.kubectl get deployment api -n production -o yaml
D.kubectl logs api-6f4d7b9d4c-abcde -n production --previous
AnswerD

kubectl logs api-6f4d7b9d4c-abcde -n production --previous is the correct command because it fetches the stdout/stderr from the previous, now-terminated container instance in the pod. In a CrashLoopBackOff, the currently restarted container usually has no useful logs — it may not have started, or it immediately restarted before writing anything — while the last crashed instance carries the actual error that triggered the restart. This gives you the application-level failure message (e.g., uncaught exception, missing config, listen EADDRINUSE) needed to fix the root cause; pair it with kubectl describe pod to see the last exit code and restart count.

Why this answer

The pod is in CrashLoopBackOff, which means the container starts, crashes, and restarts repeatedly. The `kubectl logs --previous` command retrieves the logs from the previous (crashed) container instance, which is the fastest way to see the error that caused the crash. This directly reveals the root cause, such as a missing dependency, configuration error, or application panic.

Exam trap

The trap here is that candidates may think `kubectl describe pod` or `kubectl get deployment` is needed to check the pod's status or configuration, but the fastest way to see the crash reason is the previous container's logs, not the current (restarted) container's logs which may be empty.

How to eliminate wrong answers

Option A is wrong because `kubectl describe node` shows node-level conditions and resource usage, not the application error causing the container to crash. Option B is wrong because `kubectl top pod` shows current CPU/memory metrics, which are irrelevant to a crash loop caused by an application error. Option C is wrong because `kubectl get deployment -o yaml` shows the desired state and pod template, but not the runtime logs or crash reason from the container.

394
Multi-Selecthard

You are troubleshooting a pod that is in 'Pending' state. 'kubectl describe pod' shows '0/1 nodes are available: 1 Insufficient memory, 1 node(s) had taint {node-role.kubernetes.io/control-plane: }, that the pod didn't tolerate'. Which TWO actions can resolve the issue?

Select 2 answers
A.Reduce the memory request in the container spec to fit available memory
B.Add a node selector to the pod spec to target a specific node
C.Increase the memory request to prioritize scheduling
D.Add resource limits without changing requests
E.Add a toleration for the control-plane taint to the pod spec
AnswersA, E

The scheduler reports Insufficient memory, meaning no node has enough allocatable memory for the pod's request. Lowering the container's memory request brings it within available capacity, allowing the scheduler to bind the pod to a suitable node.

Why this answer

The pod is pending because the single node in the cluster (0/1 nodes available) has two blocking issues: 1) Insufficient memory to satisfy the pod's request, and 2) a control-plane taint that the pod does not tolerate. To resolve this and allow the pod to schedule on this node, both issues must be addressed: you must reduce the memory request in the container spec to fit the available memory (Option A) AND add a toleration for the control-plane taint to the pod spec (Option E).

Exam trap

In a single-node cluster (indicated by '0/1 nodes are available'), any scheduling failure message lists all reasons why that single node failed. You must resolve all listed constraints (both the taint and the resource insufficiency) for the pod to schedule.

395
MCQhard

An ingress resource is defined with the following snippet: ```yaml spec: tls: - hosts: - app.example.com secretName: app-tls rules: - host: app.example.com http: paths: - path: / pathType: Prefix backend: service: name: app-service port: number: 80 ``` The secret 'app-tls' exists and contains a valid certificate. However, accessing https://app.example.com returns a certificate warning in the browser. What is the most likely cause?

A.The TLS secret is in a different namespace than the ingress resource
B.The ingress controller does not support TLS termination
C.The path type is Prefix but should be Exact
D.The secret name does not match the TLS section host
AnswerA

In Kubernetes, Ingress resources can only reference TLS Secret objects that reside within the exact same namespace. If the Secret containing the TLS certificate and private key is deployed in a different namespace, the Ingress controller will fail to locate it, resulting in TLS handshake failures or fallback to a default self-signed certificate.

Why this answer

The TLS secret must reside in the same namespace as the Ingress resource because the Ingress controller reads the secret from the Ingress's namespace. If the secret is in a different namespace, the controller cannot access it, causing it to fall back to its default (untrusted) certificate or fail to serve the correct certificate, which results in a browser certificate warning.

Exam trap

A common pitfall is assuming the TLS secret can be in any namespace; Kubernetes requires the secret to be in the same namespace as the Ingress resource. If not, the Ingress controller cannot access it, leading to a certificate warning.

How to eliminate wrong answers

Option B is wrong because most ingress controllers (e.g., NGINX, Traefik) support TLS termination; if they didn't, HTTPS would not work at all, not just show a warning. Option C is wrong because the path type Prefix with path '/' matches all paths, which is correct for serving the application; changing to Exact would only match the root path and break routing. Option D is wrong because the secret name in the TLS section does not need to match the host; the secret is referenced by name, and the host list in the TLS section indicates which hosts use that secret, so a mismatch would not cause a certificate warning if the secret exists and is valid.

396
Multi-Selecteasy

Which TWO of the following are valid reasons a pod might be stuck in 'Pending' state?

Select 2 answers
A.Container is killed due to OOM
B.Container image pull fails because of authentication error
C.Not enough CPU or memory available on any node
D.Node is rebooted
E.Node has a taint that the pod does not tolerate
AnswersC, E

The scheduler cannot bind the pod to any node because every candidate lacks sufficient allocatable CPU or memory. Unschedulable resource requests leave the pod without a node assignment, so it remains Pending until capacity frees up or the pod's requests are reduced.

Why this answer

Option C is correct because the Kubernetes scheduler cannot bind a pod to any node when no node has sufficient allocatable CPU or memory to satisfy the pod's resource requests, leaving the pod in Pending with a FailedScheduling event. Option E is correct because taints on nodes repel pods that lack a matching toleration, so the scheduler finds no feasible node and the pod remains Pending. Option A is wrong because OOM-killed containers occur after scheduling, producing CrashLoopBackOff or OOMKilled statuses on a running pod, not Pending.

Option B is wrong because an image pull authentication failure happens on a node after the pod is already scheduled, resulting in ImagePullBackOff or ErrImagePull. Option D is wrong because rebooting a node affects already-running pods (e.g., eviction/rescheduling), not a pod that has never been scheduled.

Exam trap

The CKA exam often tests the distinction between pod scheduling failures (Pending) and runtime failures (CrashLoopBackOff, ImagePullBackOff) — candidates mistakenly associate any container startup issue with 'Pending', but 'Pending' strictly means the pod has not been assigned to a node yet.

397
MCQhard

A cluster has a CSI driver installed. A pod using a CSI volume is in CrashLoopBackOff. 'kubectl describe pod' shows: 'failed to mount volume: rpc error: code = DeadlineExceeded desc = context deadline exceeded'. What is the MOST likely cause?

A.The CSI driver is failing to respond in time.
B.The PVC is not bound.
C.The CSI driver is not installed.
D.The volume mode is Block but the pod expects Filesystem.
AnswerA

When the kubelet or volume manager attempts to attach or mount a CSI volume, it communicates with the CSI driver via gRPC. If the driver fails to respond within the designated timeout period, the operation fails with a timeout error in the pod events, indicating the driver is unresponsive or overloaded.

Why this answer

The error 'context deadline exceeded' indicates that the CSI driver's gRPC call to mount the volume did not complete within the default timeout (typically 30 seconds). This is most commonly caused by the CSI driver being unresponsive due to resource starvation, network issues, or a bug in the driver itself. Since the CSI driver is installed and the pod is attempting to mount, the failure is in the driver's response time, not in the PVC binding or volume mode.

Exam trap

The trap here is that candidates may think 'context deadline exceeded' is a generic network timeout or PVC issue, but in the CSI context it specifically points to the driver's gRPC response timeout, not a binding or installation problem.

How to eliminate wrong answers

Option B is wrong because if the PVC were not bound, the pod would remain in 'ContainerCreating' with an error like 'persistentvolumeclaim not found' or 'waiting for a volume to be created', not a 'context deadline exceeded' from the CSI driver. Option C is wrong because if the CSI driver were not installed, the pod would fail with 'no volume plugin matched' or 'failed to get CSI driver' errors, not a timeout from an existing driver. Option D is wrong because a volume mode mismatch (Block vs Filesystem) would produce an error like 'wrong volume mode' or 'block volume not supported', not a gRPC deadline exceeded.

398
MCQeasy

A pod is stuck in 'Pending' state. You run 'kubectl describe pod my-pod' and see the event: '0/4 nodes are available: 4 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate'. What is the likely cause?

A.The pod's container image is not found
B.The pod has a resource request that cannot be met by any node
C.The nodes are unreachable or have network issues
D.The PersistentVolumeClaim is not bound
AnswerC

When a node becomes unreachable or experiences network partition issues, the node controller automatically applies the node.kubernetes.io/unreachable taint to it. Because the pending pod does not possess a matching toleration for this specific taint, the Kubernetes scheduler cannot assign the pod to any of these affected nodes, leaving it stuck in the Pending state.

Why this answer

The event '0/4 nodes are available: 4 node(s) had taint {node.kubernetes.io/unreachable: }' indicates that all nodes in the cluster have the 'node.kubernetes.io/unreachable' taint, which is automatically applied by the node controller when a node becomes unreachable (e.g., due to network partition, node failure, or kubelet not reporting). Since the pod does not have a toleration for this taint, it cannot be scheduled on any node, resulting in a 'Pending' state. This is a classic scheduling failure caused by node unreachability, not by resource constraints or image issues.

Exam trap

The CKA exam tests the distinction between taint-based scheduling failures and resource-based failures; the trap here is that candidates may confuse the 'unreachable' taint with resource constraints or PVC issues, but the event message explicitly names the taint key, which directly points to node reachability problems.

How to eliminate wrong answers

Option A is wrong because an image-not-found error would produce a different event, such as 'Failed to pull image' or 'ErrImageNeverPull', and would not cause a taint-based scheduling failure. Option B is wrong because resource request issues would generate events like 'Insufficient cpu' or 'Insufficient memory', not a taint-based message referencing 'node.kubernetes.io/unreachable'. Option D is wrong because an unbound PersistentVolumeClaim would produce an event like 'persistentvolumeclaim not found' or 'failed to mount volume', and would not result in a taint-based scheduling failure.

399
MCQmedium

You are using kubeadm to initialize a cluster. After running 'kubeadm init', you follow the instructions to set up the kubeconfig for the regular user. Which of the following commands should you run to allow kubectl to communicate with the cluster?

A.sudo cp /etc/kubernetes/controller-manager.conf $HOME/.kube/config
B.sudo cp /etc/kubernetes/scheduler.conf $HOME/.kube/config
C.sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config
D.sudo cp /etc/kubernetes/kubelet.conf $HOME/.kube/config
AnswerC

The admin.conf file holds the cluster's certificate authority data and admin credentials, so copying it into the regular user's $HOME/.kube/config gives kubectl the endpoint and authentication it needs. This satisfies the requirement to let kubectl communicate with the freshly initialised cluster.

Why this answer

After running 'kubeadm init', the admin.conf file is generated in /etc/kubernetes/ and contains the cluster CA certificate, client certificate, and API server endpoint. This is the only kubeconfig file that grants full administrative access to the cluster, making it the correct file to copy to the user's $HOME/.kube/config for kubectl to communicate with the cluster.

Exam trap

The trap here is that candidates confuse the various kubeconfig files generated by kubeadm (each tied to a specific control plane component) and mistakenly copy a component-specific config (like controller-manager.conf or kubelet.conf) instead of the admin.conf, which is the only one designed for administrative kubectl access.

How to eliminate wrong answers

Option A is wrong because /etc/kubernetes/controller-manager.conf is the kubeconfig used by the kube-controller-manager component, not for regular user kubectl access. Option B is wrong because /etc/kubernetes/scheduler.conf is the kubeconfig used by the kube-scheduler component, not for regular user kubectl access. Option D is wrong because /etc/kubernetes/kubelet.conf is the kubeconfig used by the kubelet on the node, not for regular user kubectl access.

400
MCQmedium

You need to expose a service named 'my-svc' on a static port 30080 on every node. Which service type should you use?

A.LoadBalancer
B.NodePort
C.ExternalName
D.ClusterIP
AnswerB

NodePort is the correct service type because it reserves a static port from a default range (30000-32767) across all cluster nodes. This allows external clients to access the service by targeting any node's IP address combined with the designated static port, satisfying the requirement directly without external dependencies.

Why this answer

NodePort is the correct service type because it exposes the service on a static port (30080) on every node's IP address. When you create a NodePort service, Kubernetes allocates a port from the range 30000-32767 (by default) and opens that port on all nodes, forwarding traffic to the service's ClusterIP and then to the pods. This allows external access to the service via any node's IP and the specified NodePort.

Exam trap

The trap here is that candidates often confuse NodePort with LoadBalancer, thinking LoadBalancer is required for external access, but NodePort alone suffices for exposing a static port on every node without cloud dependencies.

How to eliminate wrong answers

Option A is wrong because LoadBalancer creates an external load balancer (e.g., from a cloud provider) and does not directly expose a static port on every node; it typically relies on NodePort underneath but adds a cloud-specific LB. Option C is wrong because ExternalName maps a service to a DNS name (CNAME) and does not expose any port or provide network connectivity to pods. Option D is wrong because ClusterIP exposes the service only on a cluster-internal IP, making it unreachable from outside the cluster without additional components like an ingress or proxy.

401
MCQeasy

Which command shows resource usage (CPU and memory) for nodes in a cluster?

A.kubectl describe nodes
B.kubectl logs nodes
C.kubectl get nodes -o wide
D.kubectl top nodes
AnswerD

The `kubectl top nodes` command retrieves resource usage data from the Metrics API, which is typically backed by a metrics-server that collects node-level metrics from kubelets. It reports current CPU and memory consumption in both absolute units (e.g., millicores and MiB) and as percentages of node allocatable resources. This is exactly the command needed to answer the question about node resource usage.

Why this answer

kubectl top nodes displays resource usage if metrics-server is installed.

402
MCQhard

You need to renew all certificates on a kubeadm-managed cluster. Which command accomplishes this?

A.kubeadm certs renew apiserver
B.kubeadm certs check-expiration
C.kubeadm certs renew all
D.kubeadm upgrade apply
AnswerC

This is the correct command to renew all control plane certificates managed by kubeadm at once. It automatically regenerates the certificates under the PKI directory and updates the embedded client certificates within the administrative kubeconfig files.

Why this answer

`kubeadm certs renew all` is the dedicated command to renew all PKI certificates in a kubeadm-managed cluster. It regenerates each certificate using the existing CA key, updating the certificate files in `/etc/kubernetes/pki/` without restarting control plane components; a manual restart or kubelet reload is required afterward.

Exam trap

The trap here is that candidates confuse `kubeadm certs renew all` with `kubeadm upgrade apply`, thinking an upgrade is required to renew certificates, when in fact the dedicated renew command exists and is the correct tool for certificate-only renewal without changing cluster version.

How to eliminate wrong answers

Option A is wrong because `kubeadm certs renew apiserver` only renews the API server certificate, not all certificates (e.g., etcd, kubelet, controller-manager). Option B is wrong because `kubeadm certs check-expiration` only displays expiration dates and does not perform any renewal. Option D is wrong because `kubeadm upgrade apply` upgrades the cluster version and may renew certificates as a side effect, but it is not the dedicated command for certificate renewal and may introduce version changes or fail if only renewal is needed.

403
Multi-Selecthard

You have taken an etcd snapshot using 'ETCDCTL_API=3 etcdctl snapshot save snapshot.db'. Which TWO commands are needed to restore this snapshot to a new etcd member? (Choose TWO.)

Select 2 answers
A.etcdctl endpoint health
B.etcdctl snapshot save backup.db
C.Update the etcd configuration (e.g., --data-dir) and restart the etcd service
D.etcdctl snapshot restore snapshot.db --data-dir=/var/lib/etcd-restore
E.etcdctl snapshot status snapshot.db
AnswersC, D

After restoring a snapshot to a new directory, you must point etcd at that directory by modifying the --data-dir flag or the corresponding etcd manifest environment variable. If you omit this step, etcd will start using its original data directory and the restored data will be ignored. Additionally, you may need to update the --initial-cluster and --initial-cluster-token to match the restore's --name and new cluster ID to avoid conflicts.

Why this answer

Option D is correct because 'etcdctl snapshot restore snapshot.db --data-dir=/var/lib/etcd-restore' is the actual command that rebuilds the etcd data directory from the saved snapshot, writing a fresh member's data into the specified --data-dir. Option C is correct because after restoring the snapshot to a new data directory, the etcd member's configuration (for example the --data-dir flag in the etcd unit file or manifest) must be pointed at that restored directory and the etcd service restarted so the new member starts from the restored state. Option A ('etcdctl endpoint health') only checks cluster endpoint health and does not perform any restore action.

Option B ('etcdctl snapshot save backup.db') creates a new snapshot rather than restoring one. Option E ('etcdctl snapshot status snapshot.db') only reports metadata such as hash, revision, and total keys in the snapshot file and does not restore it.

Exam trap

The trap here is that candidates often confuse snapshot status or health checks with actual restoration steps, forgetting that `snapshot restore` must be followed by updating the etcd configuration and restarting the service to make the restored data active.

404
MCQmedium

You have a service 'my-svc' of type ClusterIP with no selector defined. You manually create an Endpoints object with the same name. Which statement is true?

A.The service will automatically create an Endpoints object based on the service ports.
B.The Endpoints object must have the same labels as the service.
C.The service will route traffic to the IPs defined in the Endpoints object.
D.The service must be of type ExternalName to use manually created Endpoints.
AnswerC

For a ClusterIP service without a selector, Kubernetes relies on a manually created Endpoints resource sharing the same name. kube-proxy will configure the data plane (such as iptables or IPVS) to intercept traffic sent to the Service's ClusterIP and route it directly to the target IP addresses and ports defined in that Endpoints object.

Why this answer

A Kubernetes Service without a selector relies on a manually created Endpoints object to define the backend targets. The Service's ClusterIP will route traffic to the IP addresses and ports specified in the Endpoints object, as long as the Endpoints object has the same name as the Service and the Service's ports match the Endpoints' ports. This is a common pattern for routing traffic to external resources or services not managed by Kubernetes.

Exam trap

The trap here is that candidates assume a Service always auto-creates an Endpoints object, but the CKA exam tests the specific case where a Service has no selector, requiring manual Endpoints creation.

How to eliminate wrong answers

Option A is wrong because a Service without a selector does not automatically create an Endpoints object; the Endpoints object must be created manually. Option B is wrong because Endpoints objects do not require labels to match the Service; they are linked by name, not labels. Option D is wrong because a Service of type ExternalName is used for DNS-based redirection, not for routing traffic to manually created Endpoints; manually created Endpoints work with ClusterIP, NodePort, or LoadBalancer Services.

405
MCQmedium

A pod in namespace 'ns1' cannot resolve the DNS name 'svc.ns2.svc.cluster.local'. What is the most likely cause?

A.The pod's DNS policy is set to None.
B.The service 'svc' does not exist in namespace 'ns2'.
C.The pod is trying to resolve using only the short service name 'svc' without the namespace.
D.The pod's DNS policy is set to Default.
AnswerB

DNS resolution of svc.ns2.svc.cluster.local requires a Service named svc in namespace ns2; CoreDNS returns NXDOMAIN when that Service is absent. Since the pod's own namespace is irrelevant to a fully qualified cross-namespace lookup, a missing Service in ns2 is the most likely cause.

Why this answer

In Kubernetes, CoreDNS dynamically creates DNS records for Services using the format '<service-name>.<namespace>.svc.<cluster-domain>'. If a pod attempts to resolve the fully qualified domain name (FQDN) 'svc.ns2.svc.cluster.local' and fails, the most likely cause is that the Service named 'svc' does not exist in the namespace 'ns2', meaning no DNS record exists for it.

Exam trap

Candidates often confuse cross-namespace resolution issues. While it is true that a pod in 'ns1' cannot resolve a service in 'ns2' using only the short name 'svc', the stem specifies that the FQDN 'svc.ns2.svc.cluster.local' itself is failing to resolve. If the FQDN fails, the issue is that the target Service does not exist, not that the pod is using a short name.

How to eliminate wrong answers

Option A is wrong because setting the pod's DNS policy to 'None' means the pod uses no DNS configuration from the cluster, but the question states the pod is trying to resolve a specific DNS name, implying it has some DNS configuration; a 'None' policy would prevent any resolution, not just cross-namespace resolution. Option B is wrong because if the service 'svc' did not exist in namespace 'ns2', the DNS query for 'svc.ns2.svc.cluster.local' would return NXDOMAIN, but the question implies the issue is with the resolution attempt itself, not the existence of the service. Option D is wrong because the 'Default' DNS policy inherits the node's DNS resolution, which typically includes the cluster DNS server; this would allow resolution of FQDNs, so it would not cause a failure to resolve 'svc.ns2.svc.cluster.local'.

406
Multi-Selectmedium

Which TWO actions can help troubleshoot a service that is not reachable from within a pod?

Select 2 answers
A.Use kubectl delete svc and recreate
B.Use kubectl exec to curl the service IP from a pod
C.Use kubectl logs on the service pod to see application logs
D.Use kubectl top nodes to check resource usage
E.Use kubectl describe svc to check endpoints
AnswersB, E

Running `kubectl exec` into a pod and curling the Service's ClusterIP directly tests the Service's virtual IP from inside the cluster network namespace. This validates the entire data path: the pod's routing, kube-proxy or iptables/ipvs rules, and backend endpoint selection. It is especially useful because the ClusterIP is only reachable from within the cluster, so a successful curl proves the kube-proxy rules are installing correctly and that at least one healthy backend is receiving traffic. A failed curl with a timeout, rather than a connection refused, also gives a specific hint about whether packets are being silently dropped.

Why this answer

Checking endpoints and using curl from a pod are direct troubleshooting steps.

407
MCQmedium

A pod is in 'ImagePullBackOff' state. Which of the following is NOT a common cause?

A.The image registry requires authentication and no imagePullSecrets are configured
B.The image tag does not exist
C.The image name is misspelled
D.The container requires more memory than the limit allows
AnswerD

If a container demands more memory than its limit allows, the image has already been successfully pulled and the container has started, so the failure mode is OOMKilled or an overloaded kubelet eviction, not ImagePullBackOff. ImagePullBackOff is exclusively a pre-start image acquisition failure, making this the one option that could never produce that state.

Why this answer

ImagePullBackOff means the kubelet repeatedly failed to pull the container image and is backing off before retrying. Memory limits are enforced at container runtime after the image is pulled and the container starts, so an insufficient memory limit would cause OOMKilled or scheduling failures — not an image pull error. Therefore, 'requires more memory than the limit allows' is NOT a common cause of ImagePullBackOff.

Exam trap

The trap is conflating image-pull failures with runtime resource failures; candidates see 'memory' and think of pod failures generally, but ImagePullBackOff is strictly about fetching the image, not running it.

How to eliminate wrong answers

Option A is a genuine cause: if the registry requires authentication and no `imagePullSecrets` are configured on the pod or service account, the kubelet receives a 401/403 and enters ImagePullBackOff. Option B is a genuine cause: a non-existent tag causes the registry to return a manifest-unknown error, which the kubelet surfaces as ImagePullBackOff. Option C is a genuine cause: a misspelled image name results in a repository-not-found error, again producing ImagePullBackOff.

Only option D describes a runtime resource issue that manifests as OOMKilled or Pending scheduling, not an image pull failure.

408
MCQeasy

A pod is in ImagePullBackOff state. Which command would give you the most information about why the image pull failed?

A.kubectl get pod
B.kubectl logs <pod-name>
C.kubectl edit pod <pod-name>
D.kubectl describe pod <pod-name>
AnswerD

The `kubectl describe pod` command is the correct diagnostic because it aggregates the pod's status conditions, container states, and, crucially, the recent Events list from the kubelet and the image puller. For an `ImagePullBackOff`, the events will contain a specific reason such as `ErrImagePull`, `ImagePullBackOff`, `Failed to pull image`, or a registry authentication/not found error with the exact HTTP status. This detailed output is exactly what you need to pinpoint whether the problem is a typo in the image tag, missing credentials, or network connectivity to the registry.

Why this answer

`kubectl describe pod <pod-name>` provides detailed event logs, including the exact error message from the kubelet when it failed to pull the container image. This output includes the reason for the ImagePullBackOff state, such as authentication failures, image not found, or network issues, which is the most comprehensive information for troubleshooting.

Exam trap

The trap here is that candidates often think `kubectl logs` will show the error, but since the container never started, there are no logs; the real diagnostic data is in the pod's events and status conditions, which only `kubectl describe` reveals.

How to eliminate wrong answers

Option A is wrong because `kubectl get pod` only shows the current status (e.g., ImagePullBackOff) without any details about why the pull failed. Option B is wrong because `kubectl logs <pod-name>` retrieves container logs, but if the container never started due to an image pull failure, there are no logs to display. Option C is wrong because `kubectl edit pod <pod-name>` opens the pod specification for editing, which does not show the pull failure reason; it only allows you to modify the pod definition, which is not diagnostic.

409
MCQhard

Based on the exhibit, what is the most likely cause of the pod not running?

A.The volume driver is not installed on node-1.
B.The pod has exceeded its resource limits.
C.The node 'node-1' is experiencing disk pressure.
D.The Secret 'my-secret' does not exist in the namespace.
AnswerD

The exhibit's event message contains the exact Kubernetes error string: the secret `my-secret` could not be found in the pod's namespace, so the kubelet is unable to inject the environment variable or volume content required by the container spec. Every Secret reference is namespaced, and the kubelet queries the API server for the secret exactly as it appears in the pod manifest; any typo, wrong namespace, or omitted resource will immediately produce this failure. Because the error is explicit and points to a missing API object, the most likely cause is that `my-secret` simply does not exist in the namespace where the Pod is running.

Why this answer

The pod's status indicates it is waiting for a secret to be mounted, and the error message 'secret "my-secret" not found' directly points to the missing Secret resource. Without the Secret existing in the same namespace as the pod, the volume mount fails, preventing the pod from starting.

Exam trap

The trap here is that candidates may assume the issue is node-level (disk pressure or driver) or resource-related, overlooking the specific error message about the missing Secret, which is a common misdirection in CKA troubleshooting questions.

How to eliminate wrong answers

Option A is wrong because a missing volume driver would typically result in a different error, such as 'failed to mount volume' or 'driver not supported', not a secret not found error. Option B is wrong because exceeding resource limits would cause the pod to be in a CrashLoopBackOff or OOMKilled state, not a waiting state for a secret. Option C is wrong because disk pressure on node-1 would manifest as pod eviction or scheduling failures, not a secret mount error.

410
MCQeasy

A pod is unable to start because the PersistentVolumeClaim it references is still in 'Pending' state. What is the most likely cause?

A.The PersistentVolumeClaim's storage class does not exist or cannot provision a volume
B.The pod's YAML has a syntax error
C.The pod is using a hostPath volume
D.The node has insufficient CPU resources
AnswerA

When a PersistentVolumeClaim references a non-existent or misconfigured StorageClass, the dynamic volume provisioner cannot fulfill the request. Consequently, the PVC remains stuck in a Pending state indefinitely. Because the Pod's volume mount depends on a successfully bound PVC, the Kubernetes scheduler cannot assign the Pod to a node, preventing it from starting.

Why this answer

A PersistentVolumeClaim (PVC) remains in 'Pending' state when it cannot find a suitable PersistentVolume (PV) to bind to or when its storage class cannot dynamically provision one. The most common cause is that the referenced storage class does not exist, is misspelled, or lacks a provisioner that can create the volume, leaving the PVC unbound and the pod unable to start.

Exam trap

The trap here is that candidates often confuse 'Pending' state for a PVC with pod scheduling issues, thinking it is a resource constraint on the node, rather than recognizing it as a storage binding or provisioning failure.

How to eliminate wrong answers

Option B is wrong because a YAML syntax error would typically prevent the pod from being created at all, not cause the PVC to remain in 'Pending' state; the pod would fail with a validation error. Option C is wrong because using a hostPath volume does not involve a PVC, so it would not cause a PVC to be stuck in 'Pending'; the pod would start directly if the host path exists. Option D is wrong because insufficient CPU resources on a node would result in the pod being in 'Pending' state due to resource scheduling issues, not because of a PVC being in 'Pending'; the pod would show a different reason such as 'Unschedulable'.

411
Multi-Selecthard

Which TWO of the following are valid ways to specify resource requests and limits for a container in a pod? (Select 2)

Select 2 answers
A.spec: containers: - name: app cpu: 0.5 memory: 512Mi
B.spec: containers: - name: app resource: request: cpu: 1 memory: 1Gi limit: cpu: 2 memory: 2Gi
C.spec: containers: - name: app resources: requests: cpu: "500m" memory: "512Mi" limits: cpu: "1" memory: "1Gi"
D.spec: containers: - name: app resources: limits: cpu: "1" memory: "1Gi"
E.spec: containers: - name: app resources: requests: cpu: "500 millicores" memory: "512 MB"
AnswersC, D

This is the canonical way to specify resource requirements in Kubernetes: each container has a `resources` field containing `requests` and `limits`. The `cpu` value `"500m"` means 500 milliCPUs (half a core), and `"1"` means one full core; memory uses binary suffixes, with `"512Mi"` and `"1Gi"` being valid mebibyte units. These strings are parsed by Kubernetes quantity format, and this structure is accepted by the API server while satisfying both scheduling and kubelet constraints.

Why this answer

Options C and D are both correct. Option C uses the correct YAML structure with a `resources` block containing both `requests` and `limits`, and specifies CPU as a string (e.g., "500m") and memory as a string (e.g., "512Mi"). Option D is also valid because Kubernetes allows specifying only `limits` without `requests`; the request defaults to the limit if omitted.

Both options conform to the Kubernetes API specification for resource management in Pod containers. Options A, B, and E contain invalid syntax: A uses CPU and memory directly under the container without a resources block; B uses the singular `resource` instead of the plural `resources`; E uses invalid units ('millicores' and 'MB').

Exam trap

The trap here is that candidates often confuse the singular `resource` with the correct plural `resources`, or they incorrectly place CPU/memory fields directly under the container spec without the proper nesting, mimicking the syntax of Docker Compose or older Kubernetes versions.

412
MCQeasy

Which command allows you to view the current context in a kubeconfig file?

A.kubectl config get-contexts
B.kubectl cluster-info
C.kubectl config view
D.kubectl config current-context
AnswerD

kubectl config current-context is the dedicated kubectl subcommand that prints exactly the name of the context currently selected for use, reading the current-context field from your kubeconfig. It is the most direct, script-friendly way to determine which cluster and user your kubectl commands will target, and it returns a nonzero exit status if no current context is set.

Why this answer

`kubectl config current-context` is the dedicated kubectl command that displays the currently active context from the kubeconfig file. It reads the `current-context` field from the kubeconfig (typically `~/.kube/config`) and outputs its name, making it the most direct way to view the current context.

Exam trap

The trap here is that candidates often confuse `kubectl config get-contexts` (which lists all contexts) with `kubectl config current-context` (which shows only the active one), leading them to choose A because they see the current context listed with an asterisk, but the question specifically asks for the command that 'allows you to view the current context' — not all contexts.

How to eliminate wrong answers

Option A is wrong because `kubectl config get-contexts` lists all available contexts in the kubeconfig file, but it does not specifically isolate or highlight the current context; it requires visual inspection to identify the one marked with an asterisk. Option B is wrong because `kubectl cluster-info` displays information about the cluster endpoints (e.g., Kubernetes master and services), not the current context from the kubeconfig. Option C is wrong because `kubectl config view` outputs the entire kubeconfig file contents (including contexts, clusters, users, and current-context), which is more verbose and not a targeted way to view just the current context.

413
Multi-Selectmedium

Which TWO of the following are valid ways to expose a Service externally in a Kubernetes cluster running on-premises (no cloud provider)?

Select 2 answers
A.LoadBalancer
B.NodePort
C.Ingress
D.ClusterIP
E.ExternalName
AnswersB, C

NodePort is a highly reliable, built-in method that allocates a static port (typically in the 30000-32767 range) across all cluster nodes. External traffic hitting any node's IP address on this designated port is automatically routed to the underlying target pods, making it a universally supported way to expose services.

Why this answer

NodePort (B) is correct because it exposes a Service on each node's IP at a static port in the 30000-32767 range, which works on any on-premises cluster without a cloud provider's load-balancer integration. Ingress (C) is correct because an Ingress resource plus an Ingress controller (e.g., NGINX, Traefik) provides HTTP/HTTPS routing from outside the cluster to internal Services, and it functions on-premises as long as the controller is deployed and reachable. LoadBalancer (A) is not valid here because it relies on a cloud provider's load-balancer implementation (or a bare-metal solution like MetalLB) to allocate an external IP, which is absent in a plain on-premises cluster.

ClusterIP (D) only provides an internal virtual IP reachable within the cluster, so it does not expose the Service externally. ExternalName (E) merely returns a CNAME DNS record pointing to an external hostname and does not expose a Service running in the cluster.

Exam trap

The trap here is that candidates often assume Ingress is not a valid external exposure method because it is not a Service type, but the question asks for 'valid ways to expose a Service externally,' and Ingress achieves this by routing external traffic to internal Services, making it a correct answer alongside NodePort.

414
MCQeasy

Which command is used to backup etcd data using etcdctl?

A.etcdctl backup
B.etcdctl export
C.etcdctl snapshot save
D.etcdctl dump
AnswerC

etcdctl snapshot save <filename> is the canonical etcd backup operation: it connects to the etcd endpoint (default https://127.0.0.1:2379), takes a consistent point-in-time snapshot of the keyspace, and writes it to the specified file. The resulting snapshot is the input used by etcdctl snapshot restore to rebuild a cluster, and it should be created with endpoint, CA, cert, and key flags when TLS is enabled.

Why this answer

`etcdctl snapshot save` is the official command in etcdctl v3 to create a point-in-time backup of the etcd data store. This command captures the entire key-value store and metadata into a snapshot file, which can later be restored using `etcdctl snapshot restore` to recover the cluster state.

Exam trap

The trap here is that candidates confuse the deprecated v2 `etcdctl backup` command with the correct v3 `etcdctl snapshot save` command, or they assume any 'export' or 'dump' verb is sufficient for a full backup.

How to eliminate wrong answers

Option A is wrong because `etcdctl backup` is not a valid command in etcdctl v3; it was used in the deprecated v2 API but is no longer supported. Option B is wrong because `etcdctl export` dumps key-value pairs in JSON format but does not create a consistent, restorable snapshot of the entire etcd data store. Option D is wrong because `etcdctl dump` is not a valid etcdctl command; it may be confused with `etcdctl snapshot save` or other dump utilities but does not exist in the etcdctl CLI.

415
Multi-Selectmedium

Which two of the following are correct statements about EndpointSlices?

Select 2 answers
A.EndpointSlices are only used for services of type LoadBalancer.
B.EndpointSlices replace the Endpoints resource entirely.
C.EndpointSlices are automatically created by the EndpointSlice controller.
D.EndpointSlices are an alpha feature and must be enabled via feature gate.
E.EndpointSlices can contain up to 100 endpoints per slice by default.
AnswersC, E

This is correct. The EndpointSlice controller runs inside the kube-controller-manager and automatically watches Services with selectors and the Pods that match those selectors. Whenever a matching Pod is created, updated, or removed, the controller creates, updates, or deletes the appropriate EndpointSlice objects. This automation means administrators never manually create EndpointSlices; they are entirely controller-managed.

Why this answer

Option C is correct because the EndpointSlice controller in the Kubernetes control plane (kube-controller-manager) automatically creates and manages EndpointSlice objects for Services that have a selector, keeping them in sync with the matching Pods. Option E is correct because each EndpointSlice is limited to a default maximum of 100 endpoints, a value controlled by the --max-endpoints-per-slice flag on the kube-controller-manager, which improves scalability and reduces update churn compared to the single Endpoints object. Option A is wrong because EndpointSlices back Services of all types with selectors (ClusterIP, NodePort, LoadBalancer, and headless), not only LoadBalancer.

Option B is wrong because EndpointSlices do not entirely replace the Endpoints resource; the legacy Endpoints API still exists and is maintained for compatibility, with EndpointSlices serving as the more scalable alternative. Option D is wrong because EndpointSlices graduated to stable (GA) in Kubernetes 1.21, so they are no longer an alpha feature requiring a feature gate.

Exam trap

The trap here is that candidates often confuse the deprecated Endpoints resource with EndpointSlices, assuming EndpointSlices are still alpha or require feature gates, when in fact they are GA and automatically managed by the controller since Kubernetes v1.21.

416
Multi-Selectmedium

You run 'kubectl logs pod-name' and get no output. Which TWO steps should you take to troubleshoot further?

Select 2 answers
A.Run 'kubectl get events --all-namespaces'
B.Run 'kubectl top pod pod-name' to check resource usage
C.Run 'kubectl describe pod pod-name' to check container state and events
D.Run 'kubectl logs --previous pod-name'
E.Run 'kubectl exec pod-name -- cat /var/log/container.log'
AnswersC, D

`kubectl describe pod pod-name` is a correct first step because it shows container states (Waiting, Running, Terminated) with detailed reason and message fields—for example, `CrashLoopBackOff`, `ImagePullBackOff`, or `OOMKilled`. It also lists recent events specific to that pod, such as failed volume mounts or failed liveness probes, which directly explain why a container may have never produced logs or why its log stream was cut short. When `kubectl logs` returns nothing, this command reveals whether the container even started, and if it did, what caused it to terminate or restart, making it an essential troubleshooting action.

Why this answer

Option C is correct because 'kubectl describe pod pod-name' surfaces the pod's container states (Waiting, Running, Terminated), restart counts, and the recent event stream, which reveals whether the container is crash-looping, stuck in ImagePullBackOff, or never started — all reasons 'kubectl logs' would return nothing. Option D is correct because 'kubectl logs --previous pod-name' retrieves the logs from the prior container instance, which is essential when the current container has restarted and its fresh instance has not yet produced output. Option A is not the right step because cluster-wide events are noisy and not scoped to the specific pod, making it far less targeted than 'kubectl describe pod'.

Option B is incorrect because 'kubectl top pod' only reports CPU/memory metrics and does not explain why logs are empty. Option E is incorrect because it assumes an in-container log file path that may not exist and bypasses the standard container log stream that kubectl already exposes.

Exam trap

CKA often tests whether candidates know the difference between current and previous container logs — the trap is running 'kubectl logs' repeatedly on a restarted container and missing that '--previous' is needed to see the crash output.

417
MCQhard

You have an Ingress resource with a TLS section specifying a secret named 'tls-secret'. The certificate in 'tls-secret' is expired. What happens when a client connects via HTTPS to the Ingress host?

A.TLS handshake succeeds but the client receives a warning about the expired certificate
B.The Ingress controller returns an error and refuses to terminate TLS
C.The Ingress controller automatically renews the certificate
D.The secret is ignored and HTTP is used instead
AnswerA

When an Ingress controller loads a TLS secret, it does not validate the expiration date of the certificate during the configuration phase. It will successfully bind the certificate to the listener and complete the TLS handshake with clients. However, because the certificate's validity period has passed, the client's browser or TLS library will flag it as untrusted and display an expiration warning.

Why this answer

When a client connects via HTTPS to an Ingress host with an expired TLS certificate, the Ingress controller (e.g., NGINX) still terminates the TLS handshake successfully because TLS termination does not validate certificate expiration at the server side. The expired certificate is presented to the client, and the client's browser or tool (e.g., curl) will show a warning about the expired certificate but the connection proceeds unless the client is configured to reject expired certificates. The Ingress controller does not enforce certificate validity; it only serves the configured secret.

Exam trap

The trap here is that candidates assume the Ingress controller validates certificate expiration and would refuse the connection, but in reality, TLS certificate expiration is only enforced by the client, not the server.

How to eliminate wrong answers

Option B is wrong because the Ingress controller does not validate certificate expiration; it terminates TLS regardless of the certificate's validity, so it does not return an error or refuse the handshake. Option C is wrong because the Ingress controller has no built-in mechanism to automatically renew certificates; renewal must be handled externally (e.g., cert-manager or manual update). Option D is wrong because the TLS secret is not ignored; the Ingress controller uses the configured secret for TLS termination, and the connection uses HTTPS, not HTTP, even if the certificate is expired.

418
MCQhard

An operations team must guarantee that exactly one copy of a log-shipping Pod runs on every worker node, including nodes added to the cluster later, and that each node gets at most one such Pod. Some nodes carry the taint 'dedicated=batch:NoSchedule'. Which resource and configuration should the team use?

A.A DaemonSet whose Pod template includes a toleration for the 'dedicated=batch:NoSchedule' taint.
B.A StatefulSet with a headless Service and podAntiAffinity across hostnames.
C.A Job with completions set to the number of nodes and parallelism equal to one.
D.A Deployment with replicas equal to the number of nodes, plus a podAntiAffinity rule.
AnswerA

A DaemonSet creates exactly one Pod on each eligible node and automatically adds Pods when new nodes join the cluster, which matches the every-node requirement. Because tainted nodes would otherwise be skipped, the Pod template must include a matching toleration so the DaemonSet controller schedules onto those nodes as well. This combination satisfies both the coverage and the one-per-node constraints.

Why this answer

A DaemonSet is the only workload controller designed to place exactly one Pod on every eligible node and to extend that coverage automatically as nodes join. Since the dedicated batch taint would otherwise repel the Pods, the Pod template must carry a matching toleration so those nodes are included in the rollout.

Exam trap

The trap here is believing that a toleration alone attracts Pods to tainted nodes, when a DaemonSet is what provides the one-per-node coverage and the toleration merely removes the repulsion.

419
Multi-Selecthard

You are troubleshooting a scenario where a pod cannot communicate with another pod in the same namespace via service name. Which THREE steps would you take to diagnose the issue? (Select 3)

Select 3 answers
A.Run 'kubectl get nodes' to check node status
B.Run 'kubectl get endpoints' to verify the service has healthy endpoints
C.Exec into the pod and use curl to test connectivity to the service's cluster IP
D.Run 'kubectl logs' on the target pod to check application logs
E.Exec into the pod and run nslookup to verify DNS resolution of the service name
AnswersB, C, E

A Kubernetes Service only forwards traffic to Pod IPs listed in its Endpoints object, which are populated by the controller based on matching selectors and the readiness status of pods. If the selector matches no pods, or the pods are not Ready (e.g., failing readiness probes or CrashLoopBackOff), the Endpoints object is empty, so connections to the Service's ClusterIP are dropped or refused. Running 'kubectl get endpoints' is the quickest way to confirm whether the Service actually has healthy, Ready backends, directly exposing the most common cause of communication failure.

Why this answer

Options B, C, and E are correct. Checking endpoints (B) verifies the service has healthy pods. Exec into the pod and using curl (C) tests connectivity to the service's cluster IP.

Exec into the pod and running nslookup (E) checks DNS resolution of the service name. Option A checks node status, which is not directly related to pod-to-pod communication via service name. Option D checks logs of the target pod, which may not reveal network issues.

420
MCQeasy

Which component is responsible for maintaining the desired state of the cluster, such as ensuring the correct number of replicas for a Deployment?

A.kube-apiserver
B.kubelet
C.kube-controller-manager
D.kube-scheduler
AnswerC

The kube-controller-manager runs core control loops, such as the Deployment and ReplicaSet controllers, which continuously monitor the cluster's actual state against the desired state declared in etcd. When discrepancies are detected, these controllers issue commands to make corrective changes, ensuring the cluster converges on the target configuration.

Why this answer

The kube-controller-manager is responsible for running controller processes that regulate the state of the cluster. It includes the Deployment controller, which watches the API server for changes to Deployment objects and ensures the actual number of replicas matches the desired state by creating or deleting Pods via the ReplicaSet controller.

Exam trap

The trap here is that candidates often confuse the kubelet's role in maintaining Pod health on a node with the controller-manager's cluster-wide reconciliation of desired state, especially since both involve 'ensuring' something is running.

How to eliminate wrong answers

Option A is wrong because kube-apiserver is the front-end for the Kubernetes control plane, exposing the Kubernetes API; it does not actively reconcile desired state but rather validates and processes requests. Option B is wrong because kubelet is an agent running on each worker node that ensures containers are running in a Pod as specified by the PodSpec, but it does not manage cluster-level desired state like replica counts. Option D is wrong because kube-scheduler is responsible for assigning Pods to nodes based on resource availability and constraints, not for maintaining the desired number of replicas.

421
MCQeasy

A pod is stuck in Pending state. You run 'kubectl describe pod my-pod' and see the event '0/1 nodes are available: 1 Insufficient cpu'. What is the most likely cause?

A.The pod's memory limit is too low
B.The pod is trying to use a GPU that is not available
C.The pod's CPU request exceeds available node CPU
D.The kubelet on the node is not running
AnswerC

When a pod requests more CPU than any node can allocate, the kube-scheduler cannot find a feasible host and sets the pod to Pending, recording an event such as `Insufficient cpu`. CPU requests are guaranteed amounts that the scheduler sums across all existing pods and compares against a node's `allocatable` CPU (node capacity minus reserved system components). Until some running pods are terminated or a node with more free CPU joins the cluster, the pod will remain Pending, which exactly matches the given event.

Why this answer

The event indicates that no node has enough free CPU to satisfy the pod's CPU request.

422
MCQhard

A Kubernetes cluster uses kube-proxy in iptables mode. A Service named 'web-svc' of type ClusterIP has three endpoints: pod A (10.244.1.5:8080), pod B (10.244.2.6:8080), and pod C (10.244.3.7:8080). A client pod repeatedly sends requests to the Service's ClusterIP. The administrator observes that all requests from a single client pod are being routed to pod A, even though pod B and pod C are healthy. Which of the following is the most likely explanation?

A.kube-proxy in iptables mode uses random selection for each packet, so the client should see distribution across all endpoints; the observed behavior indicates a bug in kube-proxy.
B.The client pod is using a persistent HTTP connection, and the Service is using IPVS mode with a least-connections algorithm, which sticks to one backend.
C.The endpoints for pod B and pod C are not ready, so kube-proxy only routes to pod A; the administrator should check readiness probes.
D.The Service has sessionAffinity set to ClientIP, which causes kube-proxy to route all requests from the same client IP to the same endpoint for the duration of the session affinity timeout.
AnswerD

When sessionAffinity is set to ClientIP, kube-proxy implements client IP-based session affinity, directing all requests from a given client IP to the same backend pod for the configured timeout (default 3 hours). This exactly matches the scenario where a single client pod's requests all go to pod A. It is a common configuration for stateful applications.

Why this answer

The most likely explanation is that the Service has sessionAffinity set to ClientIP. This setting makes kube-proxy route all requests from a particular client IP to the same backend pod for a configurable duration. Since the client pod's IP is constant, all its requests go to pod A.

This is a deliberate feature for session persistence, not a load-balancing bug.

Exam trap

The trap here is assuming that iptables mode always distributes evenly across endpoints, overlooking the possibility of session affinity being enabled.

423
MCQmedium

A pod is in ImagePullBackOff. Which command would help determine the exact reason?

A.kubectl logs <pod>
B.kubectl describe pod <pod>
C.kubectl get events
D.kubectl exec -it <pod> -- sh
AnswerB

kubectl describe pod <pod> is correct because it renders the pod's full status section, including each container's current state (Waiting, reason, message), and appends pod Events. For an ImagePullBackOff, the Events show the exact registry error (e.g., unauthorized, manifest unknown, network timeout), and the container status shows the backoff reason, giving you the diagnostic detail needed to fix the image pull failure.

Why this answer

The `kubectl describe pod <pod>` command provides detailed information about the pod, including the container state, the exact error message from the image pull (e.g., 'ImagePullBackOff'), and the underlying reason (e.g., 'Back-off pulling image', 'manifest for image not found', or 'unauthorized: authentication required'). This is the most direct way to see the specific error without needing to access the container or parse raw events.

Exam trap

CNCF often tests the misconception that `kubectl logs` can diagnose startup failures, but logs are only available after the container has started, making `kubectl describe pod` the correct tool for pre-start errors like ImagePullBackOff.

Why the other options are wrong

A

Container hasn't started; no logs.

C

Shows all events, not specific to pod.

D

Pod not running.

424
MCQmedium

You have a Service named 'my-service' in namespace 'ns1'. Another pod in namespace 'ns2' needs to resolve 'my-service' using DNS. What FQDN should the pod use?

A.my-service.svc.cluster.local
B.my-service.cluster.local
C.my-service.ns1.svc.cluster.local
D.my-service.ns2.svc.cluster.local
AnswerC

This is the correct Fully Qualified Domain Name (FQDN) for a Kubernetes service. It adheres to the standard format: `<service-name>.<namespace-name>.svc.<cluster-domain>`. Here, `my-service` is the service name, `ns1` is its namespace, `svc` denotes it as a service, and `cluster.local` is the default cluster domain. This FQDN provides an unambiguous and universally resolvable address for the service from any pod within the cluster, regardless of the querying pod's own namespace.

Why this answer

Kubernetes DNS resolves services using the FQDN format `<service>.<namespace>.svc.cluster.local`. Since the pod in namespace 'ns2' needs to resolve 'my-service' which resides in namespace 'ns1', the FQDN must include the target namespace 'ns1' to perform a cross-namespace DNS lookup. Omitting the namespace would default to the pod's own namespace, which would fail to resolve the service.

Exam trap

The trap here is that candidates often forget to include the namespace in the FQDN for cross-namespace service resolution, assuming that the default search path will find the service, but it only searches the pod's own namespace first and will not resolve a service in a different namespace without the explicit namespace qualifier.

How to eliminate wrong answers

Option A is wrong because it omits the namespace, so the DNS query would default to the pod's own namespace (ns2), not ns1, and would not resolve the service. Option B is wrong because it uses the incorrect domain suffix 'cluster.local' without the 'svc' subdomain; Kubernetes DNS records for services are always under 'svc.cluster.local', not directly under 'cluster.local'. Option D is wrong because it specifies namespace 'ns2', which is the pod's own namespace, not the namespace where the service actually exists (ns1); this would only work if the service were in ns2.

425
Multi-Selecteasy

Which TWO commands show cluster events that can help in troubleshooting?

Select 2 answers
A.kubectl cluster-info
B.kubectl logs <pod-name>
C.kubectl top pods
D.kubectl describe pod <pod-name>
E.kubectl get events
AnswersD, E

kubectl describe pod <pod-name> outputs a comprehensive summary of the pod's configuration and status, culminating in an Events section that chronologically lists recent events for that specific pod (e.g., successful pull, failed schedule, container started). These events often contain the direct cause of a pod problem, making this command one of the two candidates that actually surface events. However, it only shows events for the named pod, so its scope is limited to that Pod object.

Why this answer

Option E, `kubectl get events`, is correct because it directly lists the cluster's event stream (backed by the Events API), showing scheduling failures, image pull errors, probe failures, and other warnings tied to specific resources. Option D, `kubectl describe pod <pod-name>`, is correct because its output includes an Events section at the bottom that surfaces the same per-pod events with timestamps, reasons, and messages, which is essential for troubleshooting a specific pod. Option A, `kubectl cluster-info`, only prints the addresses of the control plane and core add-ons, providing no event data.

Option B, `kubectl logs <pod-name>`, shows application/container stdout and stderr, not Kubernetes cluster events. Option C, `kubectl top pods`, reports CPU and memory usage metrics from the metrics server, which is resource data rather than events.

Exam trap

The trap here is that candidates often confuse `kubectl logs` (which shows container output) with event viewing, or assume `kubectl cluster-info` provides troubleshooting events, when in fact only `kubectl describe` and `kubectl get events` surface the cluster's event history.

426
MCQmedium

Which command is used to check the expiration of certificates managed by kubeadm?

A.kubeadm certs status
B.kubeadm certs check-expiration
C.kubeadm certs list
D.kubeadm certs renew
AnswerB

`kubeadm certs check-expiration` is the dedicated subcommand that inspects certificates under /etc/kubernetes/pki and prints a table with each certificate's expiration date and time remaining before it expires. It also flags certificates that are externally managed and warns when renewal should happen. This read-only command is the standard way to verify certificate validity on a kubeadm-created cluster.

Why this answer

The correct command to check the expiration of certificates managed by kubeadm is `kubeadm certs check-expiration`. This command reads the certificate files located in `/etc/kubernetes/pki/` and displays their remaining validity period, allowing administrators to proactively renew certificates before they expire.

Exam trap

The trap here is that candidates may confuse `kubeadm certs check-expiration` with `kubeadm certs renew`, thinking the latter also shows expiration status, but `renew` only performs the renewal action without displaying current expiration data.

How to eliminate wrong answers

Option A is wrong because `kubeadm certs status` is not a valid kubeadm subcommand; the correct subcommand for checking expiration is `check-expiration`. Option C is wrong because `kubeadm certs list` does not exist; kubeadm does not provide a `list` subcommand for certificates. Option D is wrong because `kubeadm certs renew` is used to renew certificates, not to check their expiration status, and it requires prior verification of expiration to avoid unnecessary renewals.

427
MCQhard

You have an etcd cluster with three members. You need to take a snapshot for disaster recovery. Which command correctly creates a snapshot?

A.etcdctl snapshot restore /backup/snapshot.db
B.ETCDCTL_API=2 etcdctl backup --data-dir /var/lib/etcd
C.ETCDCTL_API=3 etcdctl snapshot save /backup/snapshot.db --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key
D.etcdctl snapshot save /backup/snapshot.db
AnswerC

This is the correct command because it explicitly sets the environment variable to use the v3 API and specifies the snapshot save subcommand. It also correctly provides the secure loopback endpoint along with the mandatory CA certificate, client certificate, and private key required to authenticate against a TLS-secured etcd cluster.

Why this answer

It uses the etcdctl v3 API with the `snapshot save` command, which is the proper method for creating a consistent point-in-time backup of an etcd cluster. The command includes mandatory TLS authentication flags (`--cacert`, `--cert`, `--key`) and the `--endpoints` flag to target a specific etcd member, ensuring a secure and successful snapshot operation.

Exam trap

The trap here is that candidates often forget to include TLS flags or the `--endpoints` flag, assuming a local default connection works, or they confuse `snapshot save` with `snapshot restore` or the deprecated v2 API backup command.

How to eliminate wrong answers

Option A is wrong because `etcdctl snapshot restore` is used to restore a snapshot, not to create one. Option B is wrong because `ETCDCTL_API=2 etcdctl backup` uses the deprecated v2 API, which does not support snapshotting the v3 data store and is not recommended for disaster recovery in modern etcd clusters. Option D is wrong because it omits the required `--endpoints` and TLS flags; without these, the command will fail to connect to the etcd server (which listens on a secure port by default) or will default to localhost without authentication, resulting in a permission error or connection refusal.

428
MCQeasy

Which access mode allows multiple pods to read and write to a PersistentVolume simultaneously when all pods are on the same node?

A.ReadWriteOnce
B.ReadOnlyMany
C.ReadWriteMany
D.ReadWriteOncePod
AnswerA

The ReadWriteOnce (RWO) access mode permits a PersistentVolume to be mounted as read-write by a single node at any given time. Crucially, once mounted by that node, any number of pods scheduled onto that specific node can concurrently access the volume for both reading and writing operations. This perfectly satisfies the question's requirement for multiple pods to read and write, provided they are co-located on the same host.

Why this answer

ReadWriteOnce (RWO) allows a PersistentVolume to be mounted as read-write by a single node, but multiple pods on that same node can all access the volume simultaneously. This is because the access mode restriction is per node, not per pod, so all pods scheduled on the same node share the same mount and can read and write concurrently.

Exam trap

The trap here is that candidates often confuse 'node-level' access with 'pod-level' access, mistakenly thinking ReadWriteOnce means only one pod can use the volume, when in fact it allows multiple pods on the same node to read and write concurrently.

How to eliminate wrong answers

Option B (ReadOnlyMany) is wrong because it only permits read-only access, not read-write, and the question explicitly requires both reading and writing. Option C (ReadWriteMany) is wrong because it allows read-write access from multiple nodes, not just multiple pods on the same node, and it requires a distributed filesystem (e.g., NFS, GlusterFS) that supports concurrent node access, which is broader than the scenario described. Option D (ReadWriteOncePod) is wrong because it restricts the volume to a single pod on a single node, preventing multiple pods from accessing it simultaneously even on the same node.

429
MCQhard

A pod is in CrashLoopBackOff. 'kubectl logs my-pod --previous' shows: 'Error: failed to start: exec: "/app/start.sh": stat /app/start.sh: no such file or directory'. What is the most likely cause?

A.The pod's service account lacks permissions.
B.The container image is missing the startup script.
C.The pod's liveness probe is misconfigured.
D.The pod has run out of memory.
AnswerB

The error 'no such file or directory' for /app/start.sh in the container logs directly indicates that the command or entrypoint defined in the pod spec references a script that does not exist within the container image. This typically happens when a Dockerfile fails to COPY the script into the image, or the image tag points to an older build without the file. Because the process cannot start, the container exits non-zero and Kubernetes enters CrashLoopBackOff.

Why this answer

The error indicates the specified entrypoint script is missing. This is often due to the container image not containing the script at the expected path, or the command/args in the pod spec referencing a non-existent file.

430
MCQeasy

Which component on a worker node is responsible for maintaining network rules and forwarding traffic to the correct pod?

A.Container runtime
B.kubelet
C.kube-proxy
D.kube-scheduler
AnswerC

The kube-proxy is the essential component on each worker node responsible for implementing the Kubernetes Service abstraction. It continuously watches the Kubernetes API server for Service and EndpointSlice objects and translates them into network rules, typically using iptables or IPVS, within the node's kernel. This ensures that requests directed to a Service IP are correctly routed and load-balanced to the healthy Pods backing that Service, effectively maintaining the data plane for cluster networking.

Why this answer

kube-proxy is the correct component because it runs on each worker node and is responsible for implementing Kubernetes Service concepts by maintaining network rules (iptables or IPVS) that allow network communication to Pods from inside or outside the cluster. It forwards traffic to the correct Pod by load-balancing across the endpoints of a Service, using the cluster IP and port.

Exam trap

The trap here is that candidates often confuse kube-proxy with kubelet, thinking the node agent manages networking, but kubelet only ensures Pods are running while kube-proxy specifically handles Service-to-Pod traffic rules.

How to eliminate wrong answers

Option A is wrong because the container runtime (e.g., containerd, CRI-O) is responsible for pulling images and running containers, not for managing network rules or traffic forwarding. Option B is wrong because kubelet is the primary node agent that registers the node, manages Pod lifecycle, and reports node status, but it does not handle network rule maintenance or packet forwarding. Option D is wrong because kube-scheduler is a control plane component that assigns Pods to nodes based on resource availability and constraints; it has no role in network traffic forwarding on worker nodes.

431
MCQmedium

An admin wants to check the expiration date of all certificates used by kubeadm components. Which command should be used?

A.kubeadm certs check-expiration
B.kubeadm upgrade plan
C.kubeadm certs renew
D.kubectl get certificates
AnswerA

The kubeadm certs check-expiration command is specifically designed to scan the /etc/kubernetes/pki directory and the kubeconfig files in /etc/kubernetes to determine the validity and expiration dates of all control plane certificates. It displays a clear, tabular summary showing the residual lifetime, expiration date, and authority of each certificate. This is the standard, built-in tool for administrators to proactively manage cluster certificate lifecycles.

Why this answer

The `kubeadm certs check-expiration` command is the correct tool to inspect the expiration dates of all certificates generated by kubeadm for cluster components, such as the API server, controller-manager, scheduler, and etcd. It reads the certificate files from the default kubeadm certificate directory (`/etc/kubernetes/pki`) and displays their remaining validity period in a human-readable table. This command is part of the kubeadm certificate management suite and is specifically designed for this purpose.

Exam trap

The trap here is that candidates confuse `kubeadm certs check-expiration` with `kubeadm upgrade plan` or `kubectl get certificates`, mistakenly thinking that upgrade planning or a generic kubectl command can reveal certificate expiry, when in fact only the kubeadm-specific subcommand provides this information.

How to eliminate wrong answers

Option B is wrong because `kubeadm upgrade plan` checks the feasibility of upgrading the cluster to a newer Kubernetes version and lists available versions, but it does not display certificate expiration dates. Option C is wrong because `kubeadm certs renew` is used to renew all or specific certificates, not to check their expiration status; running it without prior inspection could lead to unnecessary renewals. Option D is wrong because `kubectl get certificates` is not a valid command; Kubernetes does not have a built-in `certificates` resource type in the core API, and this command would return an error or no relevant output.

432
MCQeasy

Which volume type in Kubernetes allows a Pod to share data between its containers, with the data being deleted when the Pod is removed?

A.hostPath
B.emptyDir
C.configMap
D.secret
AnswerB

emptyDir is created when the Pod is assigned to a node and exists as long as that Pod is running. It is used for sharing data between containers and is deleted when the Pod is removed.

Why this answer

The emptyDir volume type is created when a Pod is assigned to a node and exists as long as the Pod is running. It provides a shared writable directory for all containers within the same Pod, and its contents are deleted when the Pod is removed from the node. This makes it the correct choice for ephemeral data sharing between containers.

Exam trap

The trap here is that candidates often confuse emptyDir with hostPath, thinking hostPath also provides ephemeral storage, but hostPath data persists on the node even after the Pod is deleted, which violates the requirement of data deletion upon Pod removal.

How to eliminate wrong answers

Option A is wrong because hostPath mounts a file or directory from the host node's filesystem into the Pod, and the data persists on the node even after the Pod is deleted, which does not match the requirement of data being deleted with the Pod. Option C is wrong because configMap is used to inject configuration data into Pods as files or environment variables, and it is not designed for sharing writable data between containers; its data is read-only by default and persists independently of the Pod lifecycle. Option D is wrong because secret is used to store sensitive information like passwords or tokens, and while it can be mounted into containers, it is read-only and not intended for ephemeral data sharing between containers.

433
MCQhard

You have a PriorityClass named 'high-priority' with value 1000 and 'low-priority' with value 100. A Pod with 'high-priority' is pending because no node has enough resources. Another Pod with 'low-priority' is running on a node. Will the high-priority Pod preempt the low-priority Pod?

A.No, because preemption only works on nodes with taints
B.No, because preemption is disabled by default
C.Yes, but only if the high-priority Pod has tolerations for the node's taints
D.Yes, because the high-priority Pod has a higher priority value and the scheduler will try to preempt lower-priority pods
AnswerD

This is correct because when a high-priority Pod cannot be scheduled due to insufficient resources, the scheduler actively looks for nodes where evicting lower-priority pods can free up enough capacity. The scheduler will then preempt those lower-priority pods, allowing the high-priority Pod to be scheduled and run.

Why this answer

Kubernetes Pod priority-based preemption is a built-in scheduler feature. When a high-priority Pod (value 1000) cannot be scheduled due to insufficient resources, the scheduler identifies and preempts (evicts) lower-priority Pods (value 100) to free up resources, regardless of taints or tolerations. This behavior is controlled by the `Priority` and `PriorityClass` objects, and preemption is enabled by default in the scheduler.

Exam trap

The trap here is that candidates often confuse preemption with taints/tolerations or assume preemption is disabled by default, but the CKA exam expects you to know that preemption is enabled by default and triggered solely by priority value differences, not by node conditions.

How to eliminate wrong answers

Option A is wrong because preemption is not tied to taints; it is a resource-based scheduling decision that can occur on any node, and taints/tolerations are separate mechanisms for node selection. Option B is wrong because preemption is enabled by default in the Kubernetes scheduler (controlled by the `enablePreemption` flag in the scheduler configuration, which defaults to true). Option C is wrong because preemption does not require the high-priority Pod to have tolerations for the node's taints; preemption evicts lower-priority Pods to make room, and tolerations are only needed if the high-priority Pod needs to tolerate node taints after preemption.

434
MCQhard

An administrator runs 'kubectl get pods' and sees a pod stuck in 'Pending' state. Which of the following is NOT a typical cause?

A.Insufficient CPU or memory resources on any node
B.PersistentVolumeClaim is pending and not bound
C.A required ConfigMap does not exist
D.Node selector labels do not match any node
AnswerC

A required ConfigMap that does not exist causes the kubelet to fail when it tries to start the container, because it cannot retrieve the referenced keys for environment variables or volume mounts. The typical event is: "Error: configmap \"<name>\" not found" and the Pod status may be CreateContainerConfigError or ContainerCreating. This is exactly the scenario described: the Pod appears stuck, yet the underlying cause is a configuration object that is missing, not a scheduling or resource issue. Therefore, this is the correct answer.

Why this answer

A missing ConfigMap does not prevent a pod from being scheduled; it only causes the pod to fail at runtime when it tries to mount or use the ConfigMap. The 'Pending' state specifically indicates that the pod has not been scheduled to a node, which is a scheduling issue, not a runtime configuration issue. Therefore, a missing ConfigMap is not a typical cause of a pod stuck in 'Pending'.

Exam trap

The trap here is that candidates confuse scheduling failures (which cause 'Pending') with runtime configuration errors (which cause 'CrashLoopBackOff' or 'Error'), leading them to incorrectly think a missing ConfigMap could prevent scheduling.

How to eliminate wrong answers

Option A is wrong because insufficient CPU or memory resources on any node is a classic cause of 'Pending' — the scheduler cannot find a node with enough allocatable resources to satisfy the pod's resource requests. Option B is wrong because if a pod references a PersistentVolumeClaim that is pending (not bound to a PV), the scheduler will not schedule the pod until the PVC is bound, as the pod's volume requirements cannot be satisfied. Option D is wrong because if a pod uses a nodeSelector that does not match any node's labels, the scheduler will leave the pod in 'Pending' as no node meets the selection criteria.

435
MCQeasy

You suspect the kubelet on a worker node is not functioning correctly. Which command should you use to check the kubelet service status?

A.kubectl get nodes
B.systemctl status kubelet
C.kubectl describe node <node-name>
D.journalctl -u kubelet
AnswerB

systemctl status kubelet is the definitive, node-local command for inspecting the kubelet's systemd service state. It directly queries systemd's unit properties, showing whether the unit is active (running), failed, activating, or inactive, along with the main process ID (MainPID) and recent journal entries. This is the first step when the kubelet is suspected of malfunctioning because it immediately confirms whether the process is alive and healthy from the init system's perspective, without relying on the Kubernetes API or network latency. It also reveals the exit code or last status change, which is essential for diagnosing crashes or manual stops on the node itself.

Why this answer

The kubelet is a systemd service on worker nodes, so `systemctl status kubelet` is the correct command to check its current state, whether it is active (running), inactive, or failed. This command directly queries the service manager for the kubelet's status, which is the first step in troubleshooting a suspected malfunction.

Exam trap

The trap here is that candidates confuse cluster-level commands like `kubectl get nodes` with node-level service management, assuming a node showing NotReady means the kubelet service is definitely down, when in fact the service could be running but failing to communicate with the API server.

How to eliminate wrong answers

Option A is wrong because `kubectl get nodes` only shows the cluster's view of node readiness, not the actual kubelet service status on the node; a node can appear NotReady even if the kubelet is running but misconfigured. Option C is wrong because `kubectl describe node <node-name>` provides detailed node conditions and events from the control plane's perspective, but it does not check the kubelet systemd service status directly. Option D is wrong because `journalctl -u kubelet` shows the kubelet's logs, which is useful for deeper investigation after confirming the service status, but it does not show whether the service is currently active or failed.

436
MCQmedium

A pod is using a PersistentVolumeClaim (PVC) named 'mypvc' which is bound to a PersistentVolume (PV) with reclaim policy 'Retain'. The pod is deleted and then the PVC is deleted. What happens to the PV?

A.The PV remains but is in 'Released' state.
B.The PV is automatically deleted.
C.The PV is immediately bound to another PVC.
D.The PV is recycled for reuse.
AnswerA

When a PVC bound to a PV with a Retain reclaim policy is deleted, the PV is preserved to prevent data loss. Its status transitions to Released, indicating that the claim has been deleted but the volume still contains data and requires manual intervention by an administrator to be reclaimed or reused.

Why this answer

When a PVC is deleted, the associated PV with a 'Retain' reclaim policy is not automatically deleted or recycled. Instead, the PV transitions to a 'Released' state, indicating that its data is preserved but it is no longer bound to a PVC. The PV remains in the cluster until an administrator manually reclaims it by removing the claimRef or deleting the PV.

Exam trap

The trap here is that candidates often confuse the 'Retain' policy with automatic recycling or deletion, assuming the PV will be cleaned up or rebound, when in fact it remains in a 'Released' state requiring manual administrator action.

How to eliminate wrong answers

Option B is wrong because the 'Retain' reclaim policy explicitly prevents automatic deletion of the PV; only a 'Delete' policy would cause automatic deletion. Option C is wrong because a PV in 'Released' state is not automatically bound to another PVC; it must be manually reclaimed by an administrator. Option D is wrong because the 'Retain' policy does not recycle or wipe the PV for reuse; recycling is associated with the 'Recycle' policy, which is deprecated in Kubernetes.

437
Multi-Selecthard

You have a pod that is in CrashLoopBackOff. Which two troubleshooting steps should you take first? (Choose two.)

Select 2 answers
A.kubectl describe pod pod-name
B.kubectl delete pod pod-name
C.kubectl logs pod-name --previous
D.kubectl exec -it pod-name -- sh
E.kubectl rollout restart deployment
AnswersA, C

kubectl describe pod pod-name is correct for CrashLoopBackOff because it displays the pod's full lifecycle events, container states, restart counts, and the last reason/exit code from the previous terminated container. Those events often reveal the root cause, such as image pull failures, failed readiness/liveness probes, or OOMKilled. It also shows the current backoff state and timestamps, making it the first diagnostic command to run.

Why this answer

`kubectl describe pod pod-name` provides detailed information about the pod's current state, including recent events, container restart counts, and the reason for the CrashLoopBackOff (e.g., exit code 137 from OOMKill or 1 from application error). This is the first step to understand the root cause of the crash loop.

Exam trap

The CKA exam often tests the misconception that `kubectl exec` can be used to debug a crashing pod, but in CrashLoopBackOff the container is not running, so exec fails; candidates must remember to use `kubectl logs --previous` to access logs from the terminated instance.

438
MCQmedium

A NetworkPolicy named 'deny-all' has only a podSelector matching all pods and no rules. What is the effect?

A.Has no effect because NetworkPolicy requires at least one rule
B.Allows all traffic because there are no explicit deny rules
C.Denies all ingress traffic to all pods in the namespace
D.Denies all egress traffic from all pods in the namespace
AnswerC

A NetworkPolicy with an empty `podSelector: {}` targets all pods within its namespace. When no `ingress` rules are explicitly defined, or an empty `ingress: []` array is present, and `policyTypes` implicitly defaults to `["Ingress"]`, the policy effectively denies all incoming network connections to these selected pods. This creates a secure-by-default posture for ingress traffic across the entire namespace, preventing any external or internal pod-to-pod communication unless explicitly allowed by another policy.

Why this answer

A NetworkPolicy with a podSelector matching all pods and no rules defaults to denying all ingress traffic because the policy's empty `ingress` rules array means no traffic is allowed. This implements a default-deny ingress behavior for the selected pods, as Kubernetes NetworkPolicy rules are whitelist-based: any traffic not explicitly allowed is denied.

Exam trap

The trap here is that candidates assume an empty policy has no effect, but in Kubernetes, a NetworkPolicy with no rules creates a default-deny for the selected direction (ingress or egress), which is a common point of confusion in the CKA exam.

How to eliminate wrong answers

Option A is wrong because a NetworkPolicy does not require at least one rule to take effect; an empty rules array still creates a policy that denies all ingress traffic. Option B is wrong because NetworkPolicy does not have implicit allow rules; it operates on a whitelist model where no rules means no traffic is permitted. Option D is wrong because this policy has no `egress` rules specified, so it does not affect egress traffic; egress is only denied if an egress rule is present or if a separate egress policy is applied.

439
MCQeasy

Which kubectl command will show the rollout history of a Deployment named 'web-app'?

A.kubectl describe deployment web-app
B.kubectl rollout status deployment web-app
C.kubectl rollout history deployment web-app
D.kubectl get deployment web-app -o yaml
AnswerC

kubectl rollout history deployment web-app is correct because it is the dedicated kubectl subcommand for viewing the Deployment's rollout history. It lists all revisions with their change-cause annotations (if set), and can be combined with --revision to inspect a specific revision; this history is actually derived from the underlying ReplicaSets created for each change to the pod template.

Why this answer

`kubectl rollout history deployment web-app` is the dedicated command to display the rollout history of a Deployment, including revision numbers and change-cause annotations. This command retrieves the stored ReplicaSet revisions associated with the Deployment, allowing you to see past rollout states.

Exam trap

The trap here is that candidates confuse `rollout status` (which shows live progress) with `rollout history` (which shows past revisions), or assume `describe` or `get -o yaml` will expose the revision list, but neither command formats the rollout history in the concise, revision-based output that `rollout history` provides.

How to eliminate wrong answers

Option A is wrong because `kubectl describe deployment web-app` shows the current state and metadata of the Deployment, but does not display the rollout history or revision list. Option B is wrong because `kubectl rollout status deployment web-app` shows the current progress of a rollout (e.g., waiting for pods to become ready), not the historical record of past rollouts. Option D is wrong because `kubectl get deployment web-app -o yaml` outputs the full YAML manifest of the Deployment, which includes the `spec.revisionHistoryLimit` and `status.observedGeneration` but does not present the formatted rollout history with revision numbers and change-causes.

440
MCQmedium

A Deployment named 'web' is failing to schedule pods. You run 'kubectl describe pod web-xyz' and see the event: '0/3 nodes are available: 3 Insufficient cpu.' What is the most likely cause?

A.The CPU request in the pod spec is too high
B.The network plugin is misconfigured
C.The nodes have insufficient memory
D.The kubelet is not running on the nodes
AnswerA

The scheduler evaluates the pod's CPU request against the allocatable CPU on each node after reserving resources for existing pods and system components. If the requested CPU exceeds what any node can accommodate, the scheduler reports 'Insufficient cpu' and leaves the pod Pending. This is a resource-fit failure, not an API or runtime error, so checking the pod's resources.requests is the first diagnostic.

Why this answer

The error indicates that CPU requests are too high for the available node resources. Reducing CPU requests or adding more nodes can fix it.

441
MCQhard

You have a ResourceQuota in a namespace that sets limits: pods: 10, requests.cpu: 4, requests.memory: 8Gi. You try to create a Pod with requests.cpu: 1, requests.memory: 2Gi, and no limits. The namespace currently has 8 pods using 3 CPUs and 5Gi memory in total requests. What happens?

A.The pod is created successfully.
B.The pod is rejected because it exceeds the memory request quota.
C.The pod is rejected because it exceeds the CPU request quota.
D.The pod is rejected because it does not specify CPU and memory limits.
AnswerA

The new pod's resource requests are 1 CPU and 2Gi memory. When combined with the existing pods' total requests of 3 CPU and 5Gi memory, the cumulative resource consumption becomes 4 CPU and 7Gi memory. Since the ResourceQuota specifies hard limits of 4 CPU and 8Gi memory for requests, both the CPU and memory totals remain at or below their respective quotas. Therefore, the admission controller allows the pod to be created without any quota violations.

Why this answer

The ResourceQuota only enforces the total sum of requests across all pods in the namespace. Currently, the namespace has 8 pods using 3 CPUs and 5Gi memory. Adding a pod with requests.cpu: 1 and requests.memory: 2Gi would bring totals to 4 CPUs (3+1) and 7Gi memory (5+2), both within the quota limits of 4 CPUs and 8Gi.

The pod does not specify limits, but ResourceQuota does not require limits unless a LimitRange enforces default limits; here, no LimitRange is mentioned, so the pod is allowed.

Exam trap

The trap here is that candidates often assume a ResourceQuota enforces both requests and limits simultaneously, or that creating a pod without limits will be rejected, but Kubernetes only rejects pods if the sum of requests (or limits, if specified) would exceed the quota, and it does not require limits unless a LimitRange is present.

How to eliminate wrong answers

Option B is wrong because the total memory requests after creation would be 7Gi, which is under the 8Gi quota limit, so it does not exceed the memory request quota. Option C is wrong because the total CPU requests after creation would be exactly 4 CPUs, which is at the quota limit but not exceeded (the quota allows up to 4 CPUs, and equality is permitted). Option D is wrong because ResourceQuota does not require pods to specify CPU and memory limits; it only enforces requests and limits if they are set, and without a LimitRange, a pod can be created without limits.

442
Multi-Selecthard

Which THREE of the following are valid ways to restrict or influence pod scheduling using taints and tolerations? (Select THREE.)

Select 3 answers
A.Adding a taint with effect NoSchedule to a node
B.Adding a toleration to a pod to prevent it from being scheduled on certain nodes
C.Adding a taint with effect PreferNoSchedule to a node
D.Applying a nodeSelector to a pod to match node labels
E.Adding a taint with effect NoExecute to a node
AnswersA, C, E

A NoSchedule taint on a node instructs the Kubernetes scheduler to exclude any Pod that does not have a matching toleration from being placed onto that node. It is a hard scheduling constraint: the scheduler will not assign new Pods to that node unless the Pod's toleration matches the taint's key, value, and effect. However, Pods already running on the node are not evicted by this effect, so it is useful for cordoning off nodes for maintenance without disrupting workloads.

Why this answer

Adding a taint with effect NoSchedule (option A) prevents scheduling of pods without matching tolerations onto the node. Adding a taint with effect PreferNoSchedule (option C) is a soft preference that tries to avoid scheduling pods without tolerations onto the node but does not guarantee it. Adding a taint with effect NoExecute (option E) not only prevents scheduling but also evicts any existing pods that do not tolerate the taint.

Options B and D are not valid uses of taints and tolerations: tolerations allow pods to be scheduled on tainted nodes, not prevent scheduling, and nodeSelector is a separate mechanism not based on taints and tolerations.

Exam trap

The trap here is that candidates often confuse tolerations as a way to repel pods from nodes, when in fact tolerations allow pods to be scheduled onto tainted nodes, while taints themselves repel pods.

443
Multi-Selectmedium

Which TWO of the following are common causes for a pod to be in the 'Pending' state?

Select 2 answers
A.The container image is not found
B.Insufficient cluster resources (CPU/memory) to schedule the pod
C.The pod's liveness probe is failing
D.A PersistentVolumeClaim (PVC) referenced by the pod is not bound
E.The node is unreachable due to network issues
AnswersB, D

If the cluster lacks nodes with enough allocatable CPU or memory to satisfy the pod's resource requests, the Kubernetes scheduler cannot assign the pod to any node and leaves it in Pending. The scheduler only considers unreserved resources calculated as capacity minus requests from existing pods; a node with insufficient free capacity or failing a node selector will keep the pod unschedulable. The scheduler emits events like '0/3 nodes are available: insufficient cpu' to point you to this condition.

Why this answer

Option B is correct because the Kubernetes scheduler places a pod into the Pending state when no node has enough allocatable CPU or memory to satisfy the pod's resource requests, so the pod remains unscheduled until resources free up or the cluster scales. Option D is correct because if a pod references a PersistentVolumeClaim that is not yet Bound (for example, waiting on a dynamic provisioner or a matching PersistentVolume), the scheduler cannot satisfy the volume's node affinity/topology constraints and the pod stays Pending. Option A is not a cause of Pending; an image that cannot be pulled produces an ImagePullBackOff/ErrImagePull status while the pod is already scheduled and typically Running or Waiting on a node.

Option C is not a cause of Pending; a failing liveness probe causes kubelet to restart the container, resulting in CrashLoopBackOff or repeated restarts, not a scheduling failure. Option E is not a cause of Pending; an unreachable node affects existing pods (marking them Unknown/NotReady) rather than preventing scheduling, since the scheduler simply avoids nodes it considers unhealthy.

Exam trap

The CKA exam often tests the distinction between pod lifecycle phases—candidates confuse 'Pending' (pre-scheduling or pre-startup) with post-startup failures like probe failures or image pull errors, which occur in later states.

444
MCQhard

A cluster has a PersistentVolumeClaim (PVC) named 'data-claim' bound to a PersistentVolume (PV) with reclaim policy 'Retain'. The PVC is deleted. The PV now shows status 'Released'. What must be done so that the PV can be reused by a new PVC?

A.Nothing; the PV will automatically become Available after some time.
B.Delete and recreate the PersistentVolume.
C.Create a new PVC with the same name.
D.Change the reclaim policy to Delete.
AnswerB

Deleting and recreating the PersistentVolume resource is a standard and clean way to make the underlying storage available for new claims. Because the reclaim policy is Retain, deleting the Kubernetes PV object does not destroy the actual data on the external storage provider. Recreating the PV with the same storage details allows a new PVC to bind to it successfully.

Why this answer

When a PVC is deleted and the PV has a reclaim policy of 'Retain', the PV enters a 'Released' state, meaning it still contains the data but is no longer bound to the original PVC. The PV cannot be directly reused by a new PVC because its claim reference is still set to the deleted PVC's UID. To make the PV available again, you must manually delete and recreate the PV (or at least delete it and re-create it with a clean claimRef), which resets its status to 'Available'.

Exam trap

The CKA exam often tests the misconception that a 'Released' PV will automatically become 'Available' over time, but the 'Retain' policy requires explicit administrative action to clear the claim reference.

How to eliminate wrong answers

Option A is wrong because a PV with reclaim policy 'Retain' does not automatically transition from 'Released' to 'Available'; manual intervention is required. Option C is wrong because creating a new PVC with the same name does not clear the existing PV's claimRef; the PV remains 'Released' and will not bind to the new PVC unless the PV is manually cleaned. Option D is wrong because changing the reclaim policy to 'Delete' would cause the PV to be deleted (and its underlying storage potentially removed), not make it 'Available' for reuse; the correct action is to delete and recreate the PV.

445
MCQmedium

Which component is responsible for implementing the NetworkPolicy rules?

A.CoreDNS
B.kube-controller-manager
C.kube-proxy
D.CNI plugin
AnswerD

The correct answer is the CNI plugin. The Container Network Interface plugin manages pod networking and, depending on the implementation (e.g., Calico, Cilium, Weave, or Antrea), also enforces NetworkPolicy by programming dataplane rules. When a NetworkPolicy is created or updated, the CNI plugin receives the pod metadata and translates the allow/deny rules into iptables, eBPF, or other forwarding constructs. Without a CNI plugin that supports NetworkPolicy, the rules are stored by the API server but have no effect on traffic.

Why this answer

NetworkPolicy rules are enforced by the Container Network Interface (CNI) plugin, not by kube-proxy or any other Kubernetes control plane component. The CNI plugin (e.g., Calico, Cilium, Weave Net) implements the actual network policy by programming iptables, eBPF, or other data-plane mechanisms to allow or deny traffic between pods based on the policy selectors and rules defined in the NetworkPolicy resource.

Exam trap

The trap here is that candidates often confuse kube-proxy's role in service traffic with network policy enforcement, but kube-proxy only handles load balancing for Services, not the pod-to-pod access control defined by NetworkPolicy.

How to eliminate wrong answers

Option A is wrong because CoreDNS is the cluster DNS resolver, responsible for service discovery and name resolution, not for enforcing network traffic policies. Option B is wrong because kube-controller-manager runs controllers like the Node Controller and Replication Controller, but it does not handle packet filtering or network policy enforcement. Option C is wrong because kube-proxy implements service load balancing (via iptables, IPVS, or userspace mode) and handles cluster IP traffic, but it does not enforce NetworkPolicy rules; those are implemented by the CNI plugin at the pod network level.

446
MCQmedium

You see a pod in 'Pending' state. 'kubectl describe pod' shows '0/4 nodes are available: 1 node(s) had taint(s) that the pod didn't tolerate, 3 Insufficient cpu'. What should you do?

A.Delete the taint from the node
B.Scale down other deployments to free CPU
C.Increase the CPU limits only
D.Add the required toleration to the pod spec and increase CPU requests
AnswerB

Scaling down other Deployments reduces the total CPU requests reported against those nodes, which is exactly what the scheduler uses to compute resource availability. When the request sums drop below a node's allocatable capacity, the pending pod's request can fit, enabling successful placement. This resolves the root cause of the pending state without altering the pod's toleration settings or risking node stability, and it is a common operational remedy for clusters experiencing CPU exhaustion.

Why this answer

The pod is pending due to two issues: taint on one node and insufficient CPU on three nodes. Scaling down other deployments frees CPU resources on nodes, allowing the pod to be scheduled on nodes with sufficient CPU, potentially avoiding the tainted node. Option A only removes the taint but does not solve the CPU shortage.

Option C does not affect scheduling. Option D increases CPU requests, worsening the CPU shortage. Therefore, B is the correct action.

447
Multi-Selecthard

Which THREE of the following are common causes for a pod to remain in 'Pending' state?

Select 3 answers
A.Node taints that the pod does not tolerate
B.Image pull backoff
C.Container OOMKilled
D.Insufficient CPU or memory resources on any node
E.PersistentVolumeClaim is not bound
AnswersA, D, E

If one or more nodes have taints (e.g., node-role.kubernetes.io/control-plane:NoSchedule) and the pod spec lacks matching tolerations, the scheduler will exclude those nodes from feasible candidates. As a result, the pod remains in Pending because no node can satisfy both taint/toleration rules and other scheduling predicates. This is a common cause of Pending, especially in single-node clusters or clusters with specialized node pools.

Why this answer

A pod stays in Pending when the Kubernetes scheduler cannot place it on any node, and node taints that the pod does not tolerate (option A) cause the scheduler to filter out those nodes, leaving the pod unscheduled. Insufficient CPU or memory resources on any node (option D) is a classic scheduling failure: the scheduler's resource-fit predicate rejects every node, so the pod remains Pending. A PersistentVolumeClaim that is not bound (option E) also blocks scheduling, because a pod referencing an unbound PVC cannot be assigned to a node until the volume is provisioned and bound.

By contrast, Image pull backoff (option B) occurs after scheduling, when the kubelet cannot pull the image, so the pod is in Waiting/ContainerCreating rather than Pending. Container OOMKilled (option C) is a runtime termination state that happens after the container starts, so it does not cause a Pending pod.

Exam trap

The CKA exam often tests the distinction between pre-scheduling (Pending) and post-scheduling (Running, Waiting, Terminated) failures; candidates mistakenly associate image pull or OOM errors with Pending, but these occur only after the pod is bound to a node.

448
Multi-Selectmedium

Which TWO components are part of the Kubernetes control plane? (Select two.)

Select 2 answers
A.kubelet
B.etcd
C.kube-proxy
D.container runtime
E.kube-controller-manager
AnswersB, E

etcd is a distributed, strongly consistent key-value store that holds the authoritative state of the entire Kubernetes cluster, including all objects, configs, and secrets. It is a foundational control plane component because every API read/write is persisted there, and control plane controllers rely on its data. Without a healthy etcd quorum, the cluster cannot function correctly.

Why this answer

etcd is a distributed key-value store that serves as the primary datastore for the Kubernetes cluster, storing all cluster state and configuration data. The kube-controller-manager runs controller processes that regulate the state of the cluster, such as the node controller, replication controller, and endpoints controller. Both are core control plane components that run on the master node(s).

Exam trap

CNCF often tests the distinction between control plane components and node-level agents; the trap here is that candidates confuse kubelet or kube-proxy as control plane components because they are essential to cluster operation, but they actually run on every node and are not part of the control plane.

449
Multi-Selectmedium

Which TWO components run on worker nodes? (Select 2)

Select 2 answers
A.etcd
B.kubelet
C.kube-apiserver
D.kube-scheduler
E.kube-proxy
AnswersB, E

The kubelet is the primary node agent that runs on every node and is responsible for ensuring that containers described in PodSpecs are running and healthy. It registers the worker node with the cluster API server and continuously monitors the status of Pods, executing actions such as starting, stopping, or restarting containers as needed. It directly manages the container runtime (like containerd) and enforces resource limits and probes.

Why this answer

kubelet (B) is correct because it is the primary node agent that runs on every worker node, registering the node with the API server and managing pod lifecycles via the container runtime. kube-proxy (E) is also correct because it runs on each worker node to maintain network rules (iptables/IPVS) that implement Kubernetes Service load balancing and pod networking. etcd (A) is incorrect because it is the cluster's distributed key-value datastore, typically running on control plane nodes. kube-apiserver (C) is incorrect because it is the control plane's front-end REST API server, not a worker node component. kube-scheduler (D) is incorrect because it is a control plane component that assigns pods to nodes rather than running on the worker nodes themselves.

Exam trap

The trap here is that candidates often confuse control plane components (etcd, kube-apiserver, kube-scheduler) with node-level agents, especially since kube-proxy is sometimes mistakenly thought to be optional or only for network plugins, but it is a required component on every worker node.

450
MCQmedium

A pod is in CrashLoopBackOff. You run 'kubectl logs mypod --previous' and see 'Error: unable to connect to database'. What is the MOST likely cause?

A.The database service endpoint is unreachable
B.The pod's readiness probe is failing
C.The pod's liveness probe is misconfigured
D.The pod is out of memory
AnswerA

`kubectl logs` captures the container's stdout/stderr, so a database connection failure (e.g., "connection refused" or "dial tcp: lookup db-service") is exactly what appears. This is a typical application-level startup error that causes the process to exit, triggering the kubelet's restart backoff. Probe failures or OOM would not produce this specific log content, making this the most plausible direct cause.

Why this answer

The error 'unable to connect to database' indicates a network connectivity issue between the pod and the database service. Since the error is from the application itself (not a Kubernetes probe), the most likely cause is that the database service endpoint is unreachable, either due to a misconfigured service, incorrect DNS resolution, or network policy blocking traffic. The `--previous` flag shows logs from the previous container instance, confirming the application consistently fails to reach the database.

Exam trap

The trap here is that candidates often confuse application-level errors with probe failures, but the CKA exam expects you to recognize that a specific database connection error points to a network or service endpoint issue, not a probe misconfiguration or resource problem.

How to eliminate wrong answers

Option B is wrong because a failing readiness probe would cause the pod to be removed from service endpoints, but it would not produce an application-level error like 'unable to connect to database'; readiness probe failures result in the pod being marked as not ready, not a CrashLoopBackOff from application crashes. Option C is wrong because a misconfigured liveness probe would cause the pod to be restarted by kubelet, but the application error message would not be 'unable to connect to database'; liveness probe failures typically result in container restarts without application-specific database connection errors. Option D is wrong because an out-of-memory (OOM) condition would cause the container to be killed by the kernel with an OOMKilled status, and logs would show no such error message; the error 'unable to connect to database' is a network-level error, not a resource exhaustion symptom.

Page 5

Page 6 of 10

Page 7

All pages