Skip to content

Linux Foundation

Certified Kubernetes Application Developer (CKAD)

Exam 5 · 98 questions · Choose another exam

  1. Question 400 of 597Your organization is deploying a microservice that generates high volumes of temporary logs which need to be processed by a secondary 'log-aggregator' container residing in the same Pod. The logs should be stored in a way that they are accessible to both containers, but they must not persist if the Pod is deleted or moved to another node. Which volume type should be defined in the Pod spec to facilitate this high-speed, ephemeral shared storage?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. An emptyDir volume with the medium set to Memory for high-speed access

    An emptyDir volume with the medium set to Memory provides high-speed, RAM-backed ephemeral storage that is shared between containers in the same Pod. On the exam, remember that emptyDir volumes are erased when the Pod is removed from the node.

  2. Question 401 of 597A legacy financial application is being migrated to Kubernetes. The application is designed to run as a single instance because it performs exclusive file-level locking on a shared directory. If two instances of the application attempt to run simultaneously, data corruption occurs. During a standard rolling update, Kubernetes normally starts a new Pod before terminating the old one. You must ensure that the deployment strategy strictly prevents any overlap between the old and new versions during an update.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Update the deployment strategy to Recreate to ensure the old Pod is terminated before the new one starts

    The Recreate deployment strategy terminates all existing Pods before starting new ones, ensuring no overlap occurs during updates. RollingUpdate cannot achieve this because it inherently requires surging or tearing down Pods concurrently.

  3. Question 402 of 597A Node.js application is experiencing intermittent crashes shortly after starting up. You suspect that the livenessProbe is killing the container before it has finished a mandatory data migration step that occurs on startup. The migration can take anywhere from 30 to 120 seconds. What is the recommended way to handle this slow startup without compromising the ability to detect deadlocks later in the application's lifecycle?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add a startupProbe to the container that monitors the application's health and disables the livenessProbe until the startup is complete.

    A startupProbe runs first and disables other probes until it succeeds, making it perfect for slow initializations. Increasing the liveness probe delay is a weaker solution because it delays detecting deadlocks later in the application lifecycle.

  4. Question 403 of 597A DevOps engineer is investigating why a Java-based microservice is constantly restarting. The Pod description shows an Exit Code 137 and the Status is 'OOMKilled'. The container has a memory limit of 1Gi specified in the manifest, but the Java process inside the container is configured with a Max Heap Size (-Xmx) of 1.5Gi. You need to determine the correct configuration change to stabilize the Pod.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Adjust the container memory limit to be higher than the Java Heap Size, for example setting the limit to 2Gi.

    An OOMKilled status means the container exceeded its Kubernetes memory limit, so you must increase the container limit above the JVM heap size. Reducing memory requests only changes scheduling and does not prevent the container from being killed.

  5. Question 404 of 597Your team is deploying a data processing application that runs as a non-root user with UID 2000. The application needs to write temporary files to a PersistentVolumeClaim mounted at /var/app/data. During testing, the application fails with a 'Permission Denied' error because the mounted volume is owned by the root user by default. How should you configure the Pod to ensure the container has the necessary write permissions?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Use the fsGroup field in the Pod's securityContext to specify the group ID 2000 for all volumes in the Pod.

    Using the fsGroup field in the Pod security context ensures Kubernetes automatically adjusts the mounted volume ownership for the specified group. This allows non-root users to write to the directory without requiring insecure privileged access.

  6. Question 405 of 597A batch processing job is designed to handle video transcoding tasks. Occasionally, a malformed video file causes the container to exit with a non-zero status. The engineering team wants to ensure that the Job controller attempts to retry the task if it fails, but they want to limit the total number of retries to exactly 4 attempts before the entire Job is marked as failed. Which field in the Job specification should be used to control this behavior?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Set the backoffLimit field in the Job spec to 4, which determines the number of retries before the Job is considered failed.

    The backoffLimit field defines the exact number of retries the Job controller will attempt before marking the Job as failed. The parallelism field only controls the number of Pods running simultaneously, not failure retries.

  7. Question 406 of 597Ambassador Container Pattern. You are managing a microservice that needs to communicate with different versions of an external legacy database depending on the geographic region of the request. To avoid bloating the main application code with complex routing logic, you want to use a pattern where a dedicated container in the same Pod handles the connection routing to the correct database endpoint. What is the name of this multi-container pattern?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. The Ambassador pattern, where a sidecar container acts as a specialized proxy for external communication

    The Ambassador pattern acts as a dedicated proxy inside the Pod, abstracting complex external routing away from the main application. The Adapter pattern is incorrect because it transforms output data rather than routing traffic.

  8. Question 407 of 597A multi-container Pod is designed for log processing. The 'app-container' writes its operational logs to a directory at /var/log/app, while the 'sidecar-log-shipper' container needs to read these logs in real-time to compress and upload them to an external S3 bucket. You need to configure the Pod so both containers can access the same filesystem location without persisting data after the Pod is deleted.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Define an emptyDir volume in the Pod spec and mount it at /var/log/app in both the app-container and the sidecar-log-shipper.

    An emptyDir volume is explicitly designed for sharing ephemeral data between containers within the same Pod, automatically deleting its contents when the Pod is removed. On the exam, look for the keywords ephemeral and shared between containers to immediately identify emptyDir over PersistentVolumeClaims.

  9. Question 408 of 597Your organization is hosting a multi-service web platform. You need to expose the user-portal service at the URL https://portal.example.org/dashboard. The traffic must be encrypted using a TLS certificate stored in a Secret named portal-tls-secret. You are tasked with creating an Ingress resource that specifically routes traffic for this path to the correct backend service on port 80 while ensuring the TLS termination is handled correctly.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Define an Ingress with a tls section specifying the host and the secretName, and a rule for host portal.example.org with the path /dashboard

    An Ingress resource uses a dedicated tls block to bind a Kubernetes Secret for TLS termination, while rules route specific host and path combinations to backend services. NodePort or Service annotations do not handle layer seven path-based routing or native TLS termination.

  10. Question 409 of 597A specialized monitoring agent is deployed as a Pod in the cluster. This agent needs to programmatically list and update all ConfigMaps within its own namespace to synchronize local settings. For security reasons, the agent should not have any access to Secrets or other resources. You need to configure the Pod to use a specific identity that grants it the necessary permissions through the Kubernetes API.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Create a custom ServiceAccount, a Role granting access only to ConfigMaps, and a RoleBinding to associate them with the Pod

    You grant specific API permissions to a Pod by binding a custom ServiceAccount to a properly scoped Role using a RoleBinding. Using the default ServiceAccount with cluster-admin or hardcoding tokens violates the principle of least privilege and fails security best practices.

  11. Question 410 of 597Your team needs to process a large batch of 50 work items using a Kubernetes Job. Each work item is independent and has an integer ID from 0 to 49. To optimize the process, you want to run 5 Pods in parallel. Each Pod must be able to determine its own index (0, 1, 2, 3, or 4) so it can fetch the correct subset of work items from a database. Which Job configuration best supports this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Set completionMode to Indexed and specify a completions value of 50 with a parallelism of 5.

    Indexed Jobs provide each Pod with a unique completion index via the JOB_COMPLETION_INDEX environment variable, allowing parallel workers to partition workloads without external coordination. Using standard Jobs or Deployments requires custom scripts or external state tracking to assign work.

  12. Question 411 of 597You are deploying a distributed database system using a StatefulSet. Each database node needs to discover its peers by performing a DNS lookup that returns the individual IP addresses of all Pods in the set. A standard Service with a ClusterIP would only return a single virtual IP, which is not sufficient for peer-to-peer discovery. What configuration is required to enable this functionality?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Create a Headless Service by setting 'clusterIP: None' in the Service specification and ensuring the selector matches the StatefulSet pods.

    A Headless Service, created by setting clusterIP to None, returns the individual Pod IP addresses via DNS instead of a single virtual IP. This behavior is essential for StatefulSet peer discovery, whereas standard Services only provide load-balanced virtual IPs.

  13. Question 412 of 597You are deploying a new microservice that communicates via gRPC on port 50051. The application takes about 10 seconds to start and initialize its internal buffer. You want to implement a liveness probe that specifically uses the gRPC health checking protocol instead of a standard HTTP or TCP check to ensure the service is truly functional. How should you define this probe in the Pod manifest for a cluster running Kubernetes v1.24 or later?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Configure the livenessProbe with the grpc field, specifying the port as 50051 and leaving the service field empty or as a specific string.

    For clusters running v1.24 or later, you configure a native gRPC probe by specifying the grpc field and the appropriate port directly in the probe definition. The older exec method using the sidecar binary is no longer necessary and adds unnecessary operational overhead.

  14. Question 413 of 597Your engineering team is deploying a multi-container Pod where the main application container writes its internal state to a specific file at /data/state.log. A second sidecar container is required to read this file and transmit the data to an external observability platform. To ensure that both containers can access the same file despite being in different environments within the Pod, you need to configure a shared storage mechanism that persists only for the lifetime of the Pod and is automatically cleaned up once the Pod is deleted.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Define an emptyDir volume in the Pod spec and mount it at the required paths in both containers

    An emptyDir volume is explicitly designed for sharing ephemeral data between containers within the same Pod, automatically deleting its contents when the Pod is removed. ConfigMaps or PersistentVolumeClaims are incorrect because they persist data beyond the Pod lifecycle.

  15. Question 414 of 597A cluster has a specific set of nodes equipped with specialized hardware for machine learning. These nodes have been tainted with 'hardware=specialized:NoSchedule' to prevent general workloads from being scheduled on them. You are deploying a Pod named 'ml-trainer' that must run on these nodes to access the specialized hardware. You need to configure the Pod to allow it to be scheduled on these tainted nodes.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Add a toleration to the Pod spec with the key 'hardware', operator 'Equal', value 'specialized', and effect 'NoSchedule'.

    Tolerations are applied to Pods to allow them to be scheduled onto tainted nodes matching the specified key, value, and effect. Node affinity and selectors attract Pods to nodes but do not override taints that explicitly repel workloads with NoSchedule.

  16. Question 415 of 597A security auditor has mandated that the 'payment-gateway' Pod in the 'finance' namespace must be isolated from the rest of the network. The Pod requires access from the corporate management subnet 10.50.0.0/16 to receive administrative commands. However, for security reasons, access must be specifically denied from a known compromised jump host located at 10.50.10.25, even though it sits within that authorized subnet. Which NetworkPolicy configuration correctly implements this exception?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. An ingress rule using an ipBlock with cidr: 10.50.0.0/16 and an except: [10.50.10.25/32] field

    The ipBlock field in a NetworkPolicy allows you to define a broad CIDR range while using the except field to exclude specific IP addresses or subnets. Kubernetes NetworkPolicies are additive and do not support priorities, so separate deny rules will not work.

  17. Question 416 of 597A security-hardened Pod is configured to run as a non-root user with UID 5000 for compliance reasons. The application container needs to write logs and temporary files to a volume mounted from a PersistentVolumeClaim. After deployment, the container logs show 'Permission Denied' errors when attempting to write to the mount path, even though the volume is correctly attached. What is the most appropriate technical solution to resolve this issue?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Define the fsGroup: 5000 setting within the Pod-level securityContext to ensure Kubernetes changes the ownership and permissions of the volume to the specified group.

    Setting fsGroup in the Pod securityContext ensures Kubernetes recursively changes the mounted volume ownership to the specified group identifier. This allows non-root containers to write to attached storage, avoiding the need for insecure privileged init containers.

  18. Question 417 of 597A developer is attempting to deploy a new Pod in the 'research-dev' namespace. Although the cluster has plenty of free CPU and memory across its nodes, the Pod remains in a 'Pending' state indefinitely. When running 'kubectl describe pod', the events show a message: 'failed quota: compute-resources: must specify cpu,memory'. What is the cause of this error and how should it be fixed?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. The namespace has a ResourceQuota enabled, and because the Pod does not define resource requests/limits, it is being rejected by the admission controller.

    A ResourceQuota tracking CPU and memory forces every Pod to define those values before admission. Remember that LimitRanges set default requests, whereas ResourceQuotas hard-block any Pod missing them.

  19. Question 418 of 597ConfigMap Immutability. A large-scale web application uses a ConfigMap containing 200 parameters. The operations team has noticed that whenever the ConfigMap is updated, the Kubelet on various nodes consumes significant CPU resources to watch for changes and sync the volumes, even though the application doesn't support hot-reloading and requires a restart anyway. How can you optimize the cluster performance for this specific ConfigMap?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Set the 'immutable' field to true in the ConfigMap metadata to stop the Kubelet from watching for updates

    Setting the immutable field to true disables kubelet polling, dropping unnecessary API server load. Secrets and ConfigMaps behave identically here, so swapping object types won't help.

  20. Question 419 of 597Your organization has a strict network isolation policy. You are deploying a three-tier application where the 'database' Pods are located in the 'data' namespace. These database Pods should only accept incoming traffic on port 5432 from Pods that have the label 'role: backend' and are located in the 'app' namespace. How should you structure the NetworkPolicy to fulfill these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Define an Ingress rule with a podSelector for 'role: backend' and a namespaceSelector that matches the 'app' namespace label

    Combining namespaceSelector and podSelector within a single ingress rule creates the required logical AND condition. Using CIDR ranges is brittle because Pod IPs are ephemeral and dynamic.

  21. Question 420 of 597InitContainer Patterns. You are deploying a mission-critical web application that depends on a database being fully initialized and reachable. If the application starts before the database is ready, it enters a failed state and requires a manual restart. You need to implement a mechanism within the Pod specification that checks for the database's availability on port 5432 and prevents the main application container from starting until the check succeeds. What is the standard implementation for this scenario?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add an InitContainer with a script that uses nc or a similar tool to loop until port 5432 is open

    Init containers run sequentially and must complete before the main app starts. Probes only act after startup, so they cannot delay the initial container boot process.

  22. Question 421 of 597You are containerizing a legacy application that writes its logs to a local file at '/mnt/logs/app.log' in a proprietary binary format. A requirements document states that these logs must be converted to JSON and printed to the standard output (stdout) of the Pod so they can be aggregated by the cluster's Fluentd agent. How should this transformation be implemented in a single Pod?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add an Adapter container to the Pod that reads the binary log file, converts it to JSON, and writes it to its own stdout.

    The Adapter pattern transforms the primary application output into a standardized format like JSON. A standard sidecar merely tails logs without modifying their underlying format.

  23. Question 422 of 597You are managing an Ingress resource for a global SaaS platform. The requirement is to route all traffic for 'example.com/api/v1' to the 'api-v1-service' and all traffic for 'example.com/api/v2' to the 'api-v2-service'. You must ensure that a request to 'example.com/api/v123' does not accidentally match the v1 rule. Which pathType should be used in the Ingress rules to satisfy this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use the Prefix pathType for the paths '/api/v1' and '/api/v2' to match based on the URL path components.

    The Prefix pathType separates URL elements by slashes, preventing accidental matches. Exact matching would block legitimate sub-paths, breaking standard API endpoint routing.

  24. Question 423 of 597A distributed data-processing system uses a Kubernetes Job to process 100 independent work items. Each item takes about 30 seconds to complete. You have noticed that if a few items fail, the entire Job retries too many times, delaying the overall pipeline. You want to configure the Job so that it processes up to 5 items in parallel and stops completely if more than 4 individual Pod executions fail. Which combination of Job specifications should you use?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Set completions to 100, parallelism to 5, and backoffLimit to 4 in the Job specification template.

    Setting parallelism and completions distributes the workload while backoffLimit halts execution after failures. Use the backoffLimit instead of activeDeadlineSeconds to stop based on error counts.

  25. Question 424 of 597Hardening Pod Security. Your DevOps team is deploying a Python-based web scraper that interacts with the local filesystem for temporary storage. To minimize the attack surface, the security policy mandates that the container must not be allowed to gain additional privileges after startup and should ideally operate with a read-only root filesystem. Which SecurityContext settings should be applied to the Pod to meet these two specific requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Set allowPrivilegeEscalation to false and readOnlyRootFilesystem to true in the container securityContext

    Setting allowPrivilegeEscalation to false blocks setuid exploits while a read-only root filesystem protects the base image. PodSecurityPolicies were removed in version 1.25, making them an invalid distractor.

  26. Question 425 of 597A developer is building a microservice that needs to communicate with a legacy key-value store. The store requires complex request signing and a specific authentication protocol that is difficult to implement in the main application language. The architect suggests offloading this logic to a separate container that runs in the same Pod and acts as a local proxy for the application. Which design pattern is being described and how is it implemented?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. The Ambassador pattern, implemented by adding a second container to the Pod that handles the signing logic and listens on localhost

    The Ambassador pattern acts as an outbound proxy managing complex connections to external services. Unlike an Adapter, it brokers outbound traffic rather than normalizing application output.

  27. Question 426 of 597A critical payment-gateway application must perform a cleanup operation and notify an external monitoring service whenever its Pod is about to be terminated. The notification must include the final status of internal transactions to prevent data loss. You want to ensure that the container has enough time to finish these tasks before the SIGTERM signal is followed by a SIGKILL. Which lifecycle configuration should you add to the container specification?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Add a preStop hook that executes the cleanup command and set the terminationGracePeriodSeconds for the Pod to a value like 60.

    The preStop hook executes cleanup logic before the SIGTERM signal reaches the container. Pairing it with a longer terminationGracePeriodSeconds ensures the pod avoids a premature SIGKILL. PostStart hooks run immediately at startup, making them useless for termination.

  28. Question 427 of 597Your company uses a set of nodes equipped with ultra-fast NVMe storage labeled with 'disktype=ssd-nvme'. These nodes are reserved for high-I/O database workloads only. You need to ensure that regular web application Pods are never scheduled on these nodes, while also ensuring that the database Pods explicitly choose these nodes. What combination of Kubernetes features must be used to achieve this strict isolation?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Apply a Taint to the NVMe nodes and add a matching Toleration and NodeAffinity to the database Pods

    The correct answer applies a Taint to repel standard workloads while using Toleration and NodeAffinity to specifically attract the database Pods. NodeSelector alone cannot repel unwanted pods from the NVMe nodes.

  29. Question 428 of 597Your engineering team is deploying a specialized data-crunching Job that must process 10 distinct data partitions. Each execution of the container needs to know its unique index (from 0 to 9) to determine which data partition to fetch from a remote storage bucket. The team wants to avoid creating 10 separate Job manifests. What is the most efficient way to achieve this using a single Kubernetes Job object? Correct answer

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Set the Job completionMode to Indexed and access the JOB_COMPLETION_INDEX environment variable inside the container

    The correct answer uses an indexed completion mode to automatically expose the job completion index. This is the native Kubernetes feature for parallel processing, preventing the need for complex API queries to identify partitions.

  30. Question 429 of 597An engineering team is migrating a legacy on-premises application suite to Kubernetes. One of the microservices is hardcoded to connect to a database using the hostname 'db.internal.production'. However, the actual database has been moved to a managed cloud service with the address 'db-cluster-xyz.provider.com'. The team cannot change the application code or configuration. What Kubernetes resource can be created to map the internal hostname to the external cloud address?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. A Service of type ExternalName with the externalName field set to db-cluster-xyz.provider.com and the metadata name db.internal.production

    The correct answer creates an ExternalName Service. This acts as a CNAME record in cluster DNS, seamlessly redirecting the hardcoded internal hostname to the external cloud database without requiring application changes.

  31. Question 430 of 597A financial services application needs to be exposed externally via the domain 'transactions.secure-bank.com'. Corporate security mandates that all external traffic must be encrypted using TLS. You have been provided with a TLS certificate and private key. You need to configure an Ingress resource to terminate TLS at the controller and route traffic to the 'transaction-svc' Service.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Create a Kubernetes Secret of type kubernetes.io/tls and reference it in the 'tls' section of the Ingress resource manifest.

    Creating a Secret of type kubernetes.io/tls and referencing it in the Ingress spec correctly terminates TLS at the controller. Avoid base64 encoding certificates directly in annotations, as standard manifests use the tls block.

  32. Question 431 of 597A custom database container does not have an HTTP health check endpoint but instead indicates its health by maintaining a specific lock file at '/var/lib/db/active.lock'. If the database process crashes or hangs, it stops updating this file or the file is removed. Which liveness probe configuration is most appropriate for monitoring this container?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. An exec probe that runs the command 'test -f /var/lib/db/active.lock' to check for the existence of the file.

    An exec probe runs a command directly inside the container, making it perfect for checking file existence. Using tcpSocket would only check if the port is open, which fails to verify if the underlying process is actually healthy or hung.

  33. Question 432 of 597A security audit requires that a high-risk financial processing Pod in the production namespace must have its system calls restricted using a custom Seccomp profile named 'audit-policy.json'. This profile has been pre-distributed to the /var/lib/kubelet/seccomp/ directory on all worker nodes. How should you configure the Pod specification to enforce this security requirement at the container level?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Add a securityContext to the container with seccompProfile set to type 'Localhost' and localhostProfile set to 'audit-policy.json'.

    Setting the seccompProfile to Localhost with the specific profile name applies the custom security profile at the container level. The annotation-based method is completely deprecated and replaced by the modern securityContext fields.

  34. Question 433 of 597Your organization has implemented a strict security policy requiring all applications to follow the principle of least privilege. You are deploying a Python-based web scraper that only needs to write temporary data to /tmp and listen on port 8080. The security auditor mandates that the container must not be able to write to any other part of the filesystem and must not be allowed to gain root privileges even if a vulnerability is exploited. Which securityContext configuration satisfies these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Configure allowPrivilegeEscalation to false and set readOnlyRootFilesystem to true, while providing an EmptyDir volume for the /tmp directory.

    Setting readOnlyRootFilesystem to true blocks writes across the entire container, while mounting an emptyDir to /tmp explicitly allows necessary temporary logging. Disabling privilege escalation ensures compromised processes cannot gain root.

  35. Question 434 of 597You are deploying a distributed stateful application that requires each instance to have a stable network identity. Specifically, each pod must be addressable by a unique DNS name (e.g., 'data-node-0.data-svc') so they can form a cluster and synchronize data. You want to avoid using a single ClusterIP that would load-balance requests across the nodes. How should the Service and the workload be configured?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Deploy the application as a StatefulSet and create a Headless Service by setting 'clusterIP: None' in the Service spec.

    A StatefulSet paired with a Headless Service provides stable pod identities like data-node-0, returning individual pod IPs via DNS. Standard ClusterIP Services load balance across pods, destroying direct pod-to-pod routing required for clustered stateful apps.

  36. Question 435 of 597You are migrating a legacy application to Kubernetes. The application is hardcoded to connect to a database at 'localhost:5432'. However, the database is now running as an external managed service outside the cluster. You cannot modify the application's source code or its configuration files. Which design pattern should you use to allow the application to connect to the external database without code changes?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Deploy an ambassador container in the same Pod that listens on localhost:5432 and proxies traffic to the external database's address.

    An ambassador container runs in the same pod network namespace, allowing it to listen on localhost and proxy traffic to the external database. Kubernetes Services and HostAliases cannot bind external traffic to the localhost loopback address.

  37. Question 436 of 597A network security tool needs to be deployed as a Pod to monitor packet headers and perform diagnostic traces. To function correctly, the container's process requires the 'NET_ADMIN' capability to modify network interfaces and 'NET_RAW' to create raw sockets. By default, these privileges are restricted in the cluster. How should you define these requirements in the Pod manifest?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Define a securityContext at the container level and add 'NET_ADMIN' and 'NET_RAW' to the capabilities list.

    Adding specific capabilities like NET_ADMIN and NET_RAW via the container securityContext follows the principle of least privilege. Enabling privileged mode grants excessive unwanted root access, while PodSecurityPolicies are deprecated and removed.

  38. Question 437 of 597Your organization is hosting a web application through a Service named 'frontend-svc'. You need to implement a Blue-Green deployment strategy where you have two identical Deployments, 'app-blue' (v1) and 'app-green' (v2), running simultaneously. You need to perform the switchover so that all traffic currently going to 'app-blue' is redirected to 'app-green' instantaneously, and you can quickly revert if any issues are detected.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Modify the selector in the 'frontend-svc' Service definition to match the labels of the 'app-green' Pods

    Modifying the Service selector immediately shifts traffic to the new deployment pods based on their updated labels. Deleting the old deployment causes unintended downtime, violating the instantaneous traffic shift requirement of a blue-green deployment.

  39. Question 438 of 597An application is generally healthy but occasionally becomes extremely slow while performing heavy background data migrations. During these specific latency spikes, the application should stop receiving new user requests to avoid timeout errors, but it must NOT be restarted, as a restart would corrupt the ongoing migration process and lead to data loss. How should the health probes be configured to handle this requirement in a production environment?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Configure a Readiness probe to detect the latency and fail when the app is slow, while keeping the Liveness probe configured to check only the basic process existence.

    A failing Readiness probe removes the pod from Service endpoints, stopping traffic during latency spikes without restarting it. A Liveness probe failure triggers a restart, which would corrupt the ongoing background data migration and cause data loss.

  40. Question 439 of 597An enterprise resource planning system written in Java experiences a heavy startup phase where it initializes a local cache and validates remote database connections. This process typically takes between 60 and 120 seconds. During this time, the default readiness probe frequently fails, causing the pod to be marked as unhealthy and eventually restarted by the liveness probe before it can finish its setup. How can you ensure the pod has enough time to initialize without permanently disabling health monitoring?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Configure a startupProbe with a sufficient failureThreshold and periodSeconds to cover the initialization period.

    A startupProbe disables liveness and readiness checks until it succeeds, protecting slow-starting applications from premature termination. Using initialDelaySeconds forces you to guess maximum startup times, leaving the application unprotected if it hangs later.

  41. Question 440 of 597Your e-commerce platform uses an Ingress resource to manage traffic to various microservices. For the checkout service, it is critical that once a user starts a session, all subsequent requests from that specific user are routed to the same backend Pod to maintain local session state. The cluster uses an NGINX Ingress Controller. You need to configure the Ingress resource to ensure session persistence using a cookie named SHOP-SESSION. How should you modify the Ingress resource to meet this technical requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add the annotation nginx.ingress.kubernetes.io/affinity set to cookie and specify the cookie name using the session-cookie-name annotation.

    NGINX Ingress controllers handle sticky sessions via specific annotations rather than standard Kubernetes object fields. Do not choose the native serviceAffinity option, as that applies strictly to Layer 4 Service routing, not Layer 7 Ingress configurations.

  42. Question 441 of 597An engineering team is deploying a memory-intensive data processing tool called data-cruncher in the analytics namespace. During peak hours, this application has a tendency to consume all available memory on the worker node, leading to the eviction of other essential services and even node instability. The team wants to configure the Pod so that it can utilize available node resources when the node has spare capacity, but they also want to ensure that Kubernetes treats this Pod with the lowest possible priority during memory pressure events to protect more critical system components that have strict resource requirements. Which configuration strategy should be applied to the data-cruncher Pod to meet these requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Omit both the requests and limits fields in the container specification to categorize the Pod into the BestEffort Quality of Service class.

    Omitting requests and limits assigns the BestEffort QoS class, making these pods the first evicted during node memory pressure. Avoid the Burstable option, as setting explicit limits restricts the pod from utilizing spare memory.

  43. Question 442 of 597A production Pod running a critical API is based on a distroless image, meaning it contains no shell (like bash or sh) and no package manager. You are observing intermittent 500 errors and need to inspect the network connections and local files of the running container without restarting the Pod or changing its image. Which Kubernetes feature allows you to troubleshoot this container effectively?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use 'kubectl debug' to create an ephemeral container inside the existing Pod that shares the same network and process namespaces

    The kubectl debug command injects an ephemeral container into a running pod to share its namespaces for troubleshooting. You cannot kubectl exec into a distroless image lacking a shell, nor can you modify a running pod's containers.

  44. Question 443 of 597A DevOps engineer is hardening a Pod for a sensitive data-processing application. For security compliance, the container must run as a non-root user with UID 2000. However, the application needs to write logs to a volume mounted at /var/log/app. By default, the mounted volume is owned by the root user, causing 'Permission Denied' errors for the application process. You need to ensure the volume is accessible to the non-root user without manually changing permissions via an entrypoint script.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Configure the fsGroup field within the Pod-level SecurityContext to manage volume ownership

    Setting the fsGroup field in the pod-level security context automatically adjusts mounted volume ownership for the specified group. Simply using runAsUser changes the executing user but does not fix the underlying volume ownership problem.

  45. Question 444 of 597You are managing an Ingress resource for a company's API platform. The platform is currently transitioning from an older version of the API to a newer one. You need to configure the Ingress so that requests to 'api.company.com/v1' are routed to the 'legacy-api' Service, while requests to 'api.company.com/v2' are routed to the 'modern-api' Service. Both services are running in the same namespace and listen on port 8080.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Define a single Ingress resource with multiple paths under the same host rule, each pointing to its respective service

    A single Ingress resource can route traffic to different backend services based on multiple URL path definitions. Avoid creating separate Ingress objects for this, as combining them under one host rule cleanly manages path-based routing.

  46. Question 445 of 597Advanced Liveness Probes: A Java application is known to suffer from heap exhaustion that doesn't immediately crash the JVM but makes the application completely unresponsive to requests. A standard TCP check on the application port still succeeds because the socket remains open. You need to implement a more robust check that ensures the application is actually healthy and capable of processing data. What is the most reliable configuration for this check?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Configure an HTTP Liveness Probe that targets a specific /health endpoint returning a 200 OK status

    An HTTP liveness probe validates actual application health by checking a dedicated endpoint. TCP probes are inadequate here because the network socket remains open even when the application is frozen and cannot process traffic.

  47. Question 446 of 597Your application needs to connect to several external third-party APIs that require complex authentication, retry logic, and circuit breaking. To simplify the application code, the development team wants to offload these networking concerns to a separate container within the same Pod. This container will act as a local proxy, presenting a simplified interface to the main application while handling the external complexities. Which architectural pattern are you implementing?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. The Ambassador pattern where a proxy container manages and simplifies the connection between the application and external services.

    The Ambassador pattern acts as a local proxy to shield the main application from complex external networking duties. The Sidecar pattern is the strongest distractor, but it focuses on local enhancements rather than proxying external traffic.

  48. Question 447 of 597A retail company wants to test version 2 of their search engine with a small subset of production traffic. They do not have an Ingress controller that supports traffic splitting or weighting. The team decides to use a single Service and two separate Deployments (v1 and v2) to achieve a simple canary release. If they want version 2 to receive approximately 25% of the traffic, how should they configure the replicas and the Service selector?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Apply a common label like 'app: search-engine' to both Deployments, then set version 1 to 3 replicas and version 2 to 1 replica, and point the Service selector to 'app: search-engine'.

    A Service load balances randomly across all matching Pods, so matching four total Pods sends roughly twenty five percent of traffic to the single version two Pod. Option D fails because it requires a specific Ingress controller.

  49. Question 448 of 597A developer has deployed a Node.js application that performs a heavy initialization of its cache. During this period, which lasts about 45 seconds, the application is technically running and passing TCP health checks, but it cannot yet process any incoming HTTP requests. If the Service starts sending traffic to the Pod during this time, users receive 503 errors. You need to ensure the Pod is only added to the Service's endpoint list after the cache is fully loaded.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Add a ReadinessProbe that performs an HTTP GET request to a specific /health/ready endpoint in the application.

    A ReadinessProbe controls when a Pod joins a Service endpoint list to receive traffic. The LivenessProbe distractor fails because it only restarts unhealthy containers and does not manage traffic routing.

  50. Question 449 of 597Your organization is deploying a legacy data transformation tool that requires exclusive access to a persistent disk. This disk is mounted via a PersistentVolumeClaim with the ReadWriteOnce access mode. When you update the Deployment to a new version, the new Pod remains in a Pending or ContainerCreating state because it cannot attach the volume, as the volume is still being held by the old Pod. Which deployment strategy should you use to resolve this specific conflict?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Change the deployment strategy type to Recreate to ensure all existing Pods are terminated before any new Pods are created.

    The Recreate strategy ensures old Pods terminate before new ones start, preventing attachment conflicts with ReadWriteOnce volumes. The RollingUpdate option fails because it still attempts to create new Pods before old ones fully terminate.

  51. Question 450 of 597A data analytics company uses a Kubernetes CronJob to generate daily reports at 01:00 AM. The cluster occasionally undergoes maintenance or experiences high load, which might prevent the CronJob controller from starting the Job exactly on time. You want to configure the CronJob so that if it fails to start within 30 minutes of its scheduled time for any reason, the execution is skipped entirely to avoid running outdated reports during business hours.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Configure the startingDeadlineSeconds field in the CronJob spec to 1800 to limit the allowed delay.

    Setting startingDeadlineSeconds limits how late a Job can start before being skipped entirely. The activeDeadlineSeconds distractor fails because it limits the execution duration of a running Job rather than its start delay.

  52. Question 451 of 597A development team is migrating a legacy data-processing application to Kubernetes. The application was designed to run on a single server and requires a specific directory structure at '/var/lib/shared-data' that must be shared and concurrently writable by 5 different Pods distributed across various nodes in the cluster. The storage backend used by the cluster supports shared access. Which PersistentVolumeClaim configuration is necessary to support this multi-node concurrent write requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. A PersistentVolumeClaim with the accessModes set to ReadWriteMany.

    The ReadWriteMany access mode is required to mount a volume as read-write across multiple nodes simultaneously. The ReadWriteOnce distractor fails because it strictly restricts write access to a single node.

  53. Question 452 of 597You are updating a production Deployment named 'order-processor' from version 1 to version 2. The Deployment currently has 10 replicas. To maintain stability, you must ensure that at least 8 replicas are available at all times during the update, and the total number of Pods in the cluster for this deployment never exceeds 13. Which rollingUpdate strategy parameters should be configured in the Deployment manifest?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Set maxUnavailable: 2 and maxSurge: 3 in the rollingUpdate strategy.

    Using a maxUnavailable of 2 ensures 8 replicas stay available while a maxSurge of 3 strictly limits the total to 13 Pods. Option C fails because percentages round up, exceeding the specified hard limits.

  54. Question 453 of 597A Java-based analytics application runs as a non-root user with UID 2000. It needs to process large datasets stored on a PersistentVolume mounted at /data/input. However, the application fails to start with a 'Permission Denied' error because the volume is owned by root (UID 0). You are not allowed to change the container image or run the application as root. What is the most secure and native Kubernetes way to fix this permission issue?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Set the securityContext.fsGroup field to 2000 in the Pod specification to allow Kubernetes to change the volume ownership.

    Setting the fsGroup in the Pod securityContext automatically adjusts the mounted volume ownership to match the application. The initContainer distractor fails because running it as root violates strict security boundaries.

  55. Question 454 of 597An application named 'cache-engine' consists of 6 replicas and is deployed in a cluster with 3 nodes. To ensure maximum resilience against node failure, you need to configure the Pods so that they are distributed as evenly as possible across the nodes. You want to ensure that the difference in the number of 'cache-engine' Pods between any two nodes is no more than one. Which Kubernetes feature should you implement in the Deployment spec? Correct answer

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Use topologySpreadConstraints with a maxSkew of 1, topologyKey set to kubernetes.io/hostname, and whenUnsatisfiable set to DoNotSchedule.

    The correct answer uses topology spread constraints with a maxSkew of one. Pod anti-affinity cannot guarantee even distribution and might block scheduling, while maxSkew explicitly limits the pod count difference across your topology domains.

  56. Question 455 of 597Your company is deploying a finance application that processes sensitive transactions. To prevent potential kernel-level attacks, the security team has required that the application containers run with a restricted seccomp profile that only allows a minimal set of system calls. You have already uploaded the custom profile 'audit.json' to the nodes. How do you apply this profile to a specific container in a Pod specification?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Configure the 'securityContext' at the container level and set the 'seccompProfile' type to 'Localhost' with the 'localhostProfile' set to 'audit.json'

    The correct answer configures the security context and sets the seccomp profile type to Localhost. The annotation method is deprecated and no longer valid in modern Kubernetes, so always use the security context for seccomp.

  57. Question 456 of 597A high-security financial application requires periodic updates to its database credentials, which are stored in a Kubernetes Secret. The application is designed to watch for file changes and reload configurations dynamically without a process restart. You have mounted the Secret as a volume in the application Pod. You need to ensure that when the Secret is updated in the API server, the application can detect and apply the new credentials automatically. Which mounting strategy must be employed to support this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Mount the entire Secret as a volume and ensure the application reads the data from the projected symlinks created by Kubernetes in the mount path.

    The correct answer mounts the entire Secret as a volume to allow atomic updates via symlinks. Using subPath breaks this functionality because it creates a direct file mount, preventing the kubelet from injecting live updates.

  58. Question 457 of 597CronJob Scheduling. A financial reconciliation task is scheduled to run every 10 minutes via a Kubernetes CronJob. Due to occasional cluster-wide network latency, the job controller might sometimes miss its scheduled start time. The business requirement states that if a job is delayed by more than 30 seconds, it should be skipped entirely to avoid overlapping with the next scheduled run. Which configuration parameter must be adjusted to enforce this behavior? Correct answer

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Set the startingDeadlineSeconds field to 30 in the CronJob specification

    The correct answer sets the starting deadline seconds to thirty. If the controller misses this window, it skips the execution, whereas concurrency policy only manages overlapping pods and does not enforce strict start times.

  59. Question 458 of 597A financial company needs to secure their 'customer-portal' web service using HTTPS. They have already created a Kubernetes Secret named 'portal-tls-secret' containing the 'tls.crt' and 'tls.key' files. They are using an Ingress resource to manage external access. How must the Ingress manifest be configured to use this secret for TLS termination for the domain 'portal.example.com'?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Add a 'tls' section under the Ingress spec, specifying 'portal.example.com' in the hosts list and 'portal-tls-secret' as the secretName.

    Adding a tls section under the Ingress spec correctly references the Secret for TLS termination at the controller. Do not mount Secrets manually into the controller or use backend sections, as the spec.tls block handles certificates natively.

  60. Question 459 of 597A proprietary database engine is running as a containerized workload in your production cluster. The application does not provide an HTTP status endpoint or a listening TCP port for health checks; instead, it updates a timestamp in a local file at /tmp/heartbeat every 20 seconds. If this file is not updated for more than 60 seconds, the engine is considered deadlocked and must be restarted. Which configuration should you implement to ensure the container is automatically recovered by the kubelet?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Configure a livenessProbe using the exec field to run a shell command that checks the modification time of the heartbeat file.

    A liveness probe using the exec field correctly triggers the kubelet to restart the container based on internal file changes. TCP and HTTP probes lack arbitrary command execution, and readiness probes control traffic routing rather than restarts.

  61. Question 460 of 597A legacy enterprise application is hardcoded to connect to a local database endpoint at 127.0.0.1:5432. However, the database has been moved to a managed cloud service with a specific external DNS endpoint. You need to implement a solution that allows the application to continue connecting to its local address while transparently routing traffic to the external cloud database without modifying the legacy application code.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Deploy an Ambassador container in the same Pod that listens on 127.0.0.1:5432 and proxies traffic to the external database endpoint.

    An ambassador container correctly proxies local loopback traffic to the external database without code changes. ExternalName services cannot bind to local IP addresses like 127.0.0.1, making sidecars the standard adapter pattern.

  62. Question 461 of 597In a shared multi-tenant cluster, your 'production' namespace hosts a 'backend-api' deployment. Security requirements dictate that this backend must only be accessible by the 'frontend-web' pods located in the same namespace on TCP port 9000. All other incoming traffic from any other pods, including those in the same namespace or other namespaces, must be blocked. Which configuration strategy correctly implements this isolation?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Define a NetworkPolicy with a podSelector matching 'backend-api' and an ingress rule allowing 'frontend-web' on port 9000.

    Defining a NetworkPolicy that targets backend-api and allows ingress from frontend-web on port 9000 correctly isolates the pod. Empty selectors or egress rules fail to secure the target destination from unauthorized callers.

  63. Question 462 of 597You are managing a shared development namespace where a ResourceQuota is enforced to limit total CPU usage to 8 cores. A developer submits a Deployment for a high-performance API that consists of 3 replicas. Each Pod in the Deployment contains two containers: the main application container requesting 2 CPUs and a sidecar logging container requesting 1 CPU. What will happen when this Deployment is applied to the cluster?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. The Deployment will be accepted, but the third Pod will remain in Pending state because it exceeds the namespace's total CPU quota

    The Deployment is accepted, but the third Pod stays Pending because the namespace ResourceQuota is exceeded. Quotas are checked during Pod admission by the API server, not by stripping sidecars or immediately rejecting the Deployment.

  64. Question 463 of 597A legacy Java-based microservice is being migrated to Kubernetes. During internal testing, it was observed that the application takes approximately 180 seconds to initialize its internal cache and start the JVM before it can respond to any requests. When using standard Liveness and Readiness probes, the Pod is frequently killed and restarted by the Kubelet before it finishes its initialization phase. What is the most effective way to handle this slow startup without compromising the ability to detect later deadlocks?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Implement a startupProbe with a failureThreshold and periodSeconds that cover the 180-second window before the livenessProbe takes over

    A startupProbe correctly protects slow-starting applications from liveness checks killing them prematurely. Relying on initialDelaySeconds makes later deployments fragile if startup times vary, whereas startup probes adapt seamlessly.

  65. Question 464 of 597Your security policy requires strict egress control for all Pods in the 'payment-processing' namespace. Specifically, the 'transaction-validator' Pod must be able to communicate with an external bank API at 203.0.113.5 and resolve DNS via the cluster DNS service, but all other outbound connections to the internet or other Pods must be blocked. How should you define the Egress NetworkPolicy?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Define an Egress policy with two rules: one with an ipBlock for 203.0.113.5 and another allowing UDP/TCP on port 53 to the kube-dns CIDR.

    The correct answer works because an Egress NetworkPolicy explicitly permits traffic to the specified ipBlock and allows DNS resolution via port 53, while implicitly blocking all other outbound traffic. Remember that Kubernetes network policies are default-deny once applied, so you must explicitly allow DNS.

  66. Question 465 of 597A security-sensitive application requires a configuration file containing dynamic API tokens. These tokens are updated every hour by an external security orchestrator that modifies the corresponding Kubernetes Secret. The application is designed to watch for changes in its configuration directory and reload them automatically. You need to decide how to provide the Secret to the Pod to ensure the application sees the updated tokens without requiring a manual restart of the container.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Mount the Secret as a volume in the Pod, as Kubernetes automatically updates the projected files when the Secret object changes

    Mounting the Secret as a volume is correct because the kubelet automatically handles syncing and updating the mounted files whenever the underlying Secret object changes. Environment variables loaded from Secrets remain static after pod creation and do not support live updates without a manual restart.

  67. Question 466 of 597A data reconciliation CronJob is scheduled to run every day at midnight. Occasionally, the cluster is under heavy load or the control plane is busy, causing delays in Job creation. If the Job cannot be started within 1 minute of its scheduled time, it is critical that it does not run at all to prevent data corruption with the next day's tasks. You need to configure the CronJob to enforce this behavior.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Set the startingDeadlineSeconds field in the CronJob spec to 60 to limit the window for starting missed jobs.

    Setting startingDeadlineSeconds to 60 is correct because it dictates the maximum deadline window for a CronJob to start after its scheduled time, skipping missed executions. The activeDeadlineSeconds field limits how long a started Job runs, not its creation delay window.

  68. Question 467 of 597A security-sensitive application in your production cluster needs to authenticate with an external cloud provider's API using OIDC. The cloud provider requires a short-lived, audience-bound ServiceAccount token to be present at a specific file path within the container. To comply with the principle of least privilege and security hardening, you must ensure the token is rotated frequently and is not stored in the standard Kubernetes Secret. Which volume configuration should be used in the Pod specification?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use a projected volume with a serviceAccountToken source, specifying the target path, expirationSeconds, and audience

    Using a projected volume with a serviceAccountToken source is correct because it safely injects short-lived, audience-bound tokens directly into the pod, handling rotation automatically. ConfigMaps store static data and lack native expiration handling, failing security requirements.

  69. Question 468 of 597Your organization is preparing to release a significant version update (v2.0) of a critical booking engine. The stakeholders have mandated a Blue-Green deployment strategy because the application does not support session sharing between different versions, and they want the ability to perform an instantaneous cutover or rollback. The current version (v1.0) is served by a Service named booking-svc. How should you manage the Service and Deployment objects to achieve this strategy?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Deploy version 2.0 with a new selector and update the existing Service selector to point to the new version only after validation

    Deploying version 2.0 with a new selector and updating the existing Service selector is correct because it instantly shifts all traffic to the new pods once validated. This allows an immediate rollback by simply reverting the Service selector if issues arise.

  70. Question 469 of 597Your organization is hosting a multi-tenant platform where internal services are exposed via an Ingress resource. You have two distinct backend services: 'inventory-svc' which handles general requests, and 'inventory-v2-svc' which handles a new API version. A specific requirement states that traffic directed to the path '/api/v2' must be routed exclusively to 'inventory-v2-svc', while all other traffic starting with '/api' (like '/api/v1' or '/api/search') must go to 'inventory-svc'. How should the Ingress paths be defined to prevent routing conflicts?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Define the '/api/v2' path with pathType: Exact and the '/api' path with pathType: Prefix in the Ingress rules

    Using pathType: Exact for the specific route and pathType: Prefix for the broader route is correct because it prevents overlapping matches and ensures traffic routes predictably. Relying on physical YAML ordering or ImplementationSpecific behavior fails the consistency requirement.

  71. Question 470 of 597A data-intensive application requires a specific configuration manifest and several binary assets to be downloaded from a remote Git repository before the main application container starts. If the download fails or the assets are corrupted, the main application should not attempt to start to avoid inconsistent states. The download process requires specialized tools that are not present in the main application image.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Define an InitContainer with the necessary tools to download the assets into a shared volume accessible by the main container.

    Defining an InitContainer is correct because it runs to completion and blocks the main container from starting until the shared assets are successfully downloaded. Sidecars run concurrently, risking an inconsistent application state if the required files are missing.

  72. Question 471 of 597Your organization is migrating a legacy application that is hardcoded to connect to a database only on localhost:5432. To modernize the infrastructure, the database has been moved to a managed cloud service with a dynamic endpoint. Since you cannot modify the source code of the legacy application to point to the new endpoint, you need to implement a solution within the Kubernetes Pod to handle this connection proxying transparently. Which design pattern and implementation should you use?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Implement an Ambassador container as a sidecar that runs a proxy like HAProxy or Nginx to forward localhost:5432 traffic to the external database endpoint.

    An Ambassador container acts as a proxy, letting the legacy application connect to localhost while the sidecar forwards traffic to the external endpoint. Remember that init containers or modifying /etc/hosts cannot redirect localhost traffic dynamically.

  73. Question 472 of 597You are managing a critical Deployment named 'order-processor' that currently has 10 replicas running version v1. To ensure high availability during an update to version v2, you must satisfy two conditions: first, there should never be more than 12 Pods running at any time during the rollout; second, there must always be at least 9 Pods available to handle traffic. Which configuration for the rollingUpdate strategy should be applied to the Deployment manifest?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Configure maxSurge to 2 and maxUnavailable to 1 in the rollingUpdate section of the Deployment strategy specification.

    Setting maxSurge to 2 allows up to 12 pods during the rollout. Setting maxUnavailable to 1 ensures at least 9 pods remain available. Absolute integer values strictly enforce these operational limits.

  74. Question 473 of 597Your organization has a strict network security policy in the production cluster. You are deploying a new microservice named 'secure-processor' in the 'finance' namespace. This service must be configured to only accept incoming connections from Pods that have the label 'role: frontend' within the same namespace. All other incoming traffic from any other source must be blocked by the network layer to ensure zero-trust security.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Apply a NetworkPolicy with an Ingress rule that matches the podSelector with the label role: frontend.

    A NetworkPolicy controls traffic flow at the pod level. By using a podSelector in the ingress rule, you specifically allow connections only from frontend pods. Services or Ingress cannot enforce this strict IP-level zero-trust security.

  75. Question 474 of 597Your team is managing a critical microservice called stock-analyzer that periodically fetches data from a third-party legacy provider. If the provider goes offline for maintenance, the stock-analyzer can no longer process requests, but it should not be restarted as the initialization process is very resource-intensive and could impact the host node's stability. You need to configure a mechanism that ensures the Pod is temporarily removed from the Service's endpoint list without triggering a container restart when the external dependency is unavailable.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Implement a Readiness Probe that verifies the connectivity to the third-party provider and reports failure when the service is unreachable

    A Readiness Probe controls traffic routing by removing the pod from Service endpoints when it fails. This isolates the application without restarting it. A Liveness Probe would incorrectly trigger a restart during external outages.

  76. Question 475 of 597Your application deployment named 'order-processor' currently runs 4 replicas. The cluster is operating near full capacity, and the scheduler cannot find room for even one extra pod. However, you need to update the application to a new version while maintaining at least 3 replicas at all times to handle the current load. Which RollingUpdate strategy configuration should you apply?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Set maxSurge to 0 and maxUnavailable to 1 to ensure a pod is deleted first, creating space for the new version.

    Setting maxSurge to 0 prevents creating extra pods during the rollout. Setting maxUnavailable to 1 allows terminating one old pod first, freeing cluster resources for the replacement. This guarantees continuous availability under tight constraints.

  77. Question 476 of 597Your team is migrating an application from a local on-premises environment to a Kubernetes cluster. The application is hardcoded to connect to a database using the hostname 'db-service.internal'. In the cloud environment, the database is now hosted on a managed cloud service with a long, dynamic DNS name. You need to ensure the application can resolve 'db-service.internal' to the external cloud database address without modifying the application code or the container image.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Deploy a Service of type ExternalName with the externalName field set to the cloud database DNS string

    A Service of type ExternalName creates a DNS alias by returning a CNAME record to an external domain. This transparently maps your internal service name to the cloud database. Manual endpoints require static IPs.

  78. Question 477 of 597Your e-commerce platform uses an Ingress controller to manage traffic. You need to configure an Ingress resource that routes traffic for the host 'shop.example.com'. Requests directed to the path '/products' must be sent to the 'product-catalog' service, while requests to '/checkout' must go to the 'order-manager' service. Both backend services listen on port 80. How should the rules section of the Ingress be structured to achieve this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Define a single rule for the host with a list of paths, each specifying a pathType and a backend service with a service name and port.

    An Ingress resource defines a host with multiple path entries. Each path maps a specific URI to a distinct backend service and port. Using separate resources risks routing conflicts depending on controller merging behavior.

  79. Question 478 of 597You are managing a cluster distributed across three availability zones (us-east-1a, us-east-1b, us-east-1c). A mission-critical deployment named 'high-availability-api' must ensure that its 9 replicas are distributed as evenly as possible across these zones to minimize the impact of a single zone outage. You want Kubernetes to handle this distribution automatically during scheduling.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Utilize topologySpreadConstraints in the Pod spec with the topologyKey set to topology.kubernetes.io/zone.

    TopologySpreadConstraints automatically distribute pods across defined topology domains like availability zones. Setting the maxSkew ensures even balancing during scheduling. Node selectors require manual management and lack dynamic scaling.

  80. Question 479 of 597Your organization is migrating a legacy on-premises database to a managed cloud SQL instance. The internal application microservices, currently running in a Kubernetes cluster, are hardcoded to connect to the hostname 'legacy-db-svc'. You need to ensure these microservices can reach the external cloud database using this specific internal hostname without modifying the application code or using a Headless Service. Which Kubernetes Service configuration fulfills this requirement?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Create a Service of type ExternalName with the externalName field set to the cloud database FQDN

    A Service of type ExternalName creates a DNS alias by returning a CNAME record to the external database address. This lets internal pods resolve the local service name seamlessly. Other service types cannot handle dynamic external DNS.

  81. Question 480 of 597You are managing a high-traffic retail website and need to test a new checkout workflow. You want to direct exactly 10% of the incoming traffic to a new version of the application (v2) while the remaining 90% stays on the stable version (v1). Both versions are running as separate Deployments with their own Services. You are using the NGINX Ingress Controller. How should you configure the Ingress resource to achieve this canary release?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Create two Ingress resources and set the service weights manually using the 'nginx.ingress.kubernetes.io/canary-weight' annotation set to '10'

    The NGINX Ingress controller shifts traffic percentages when you add a second Ingress annotated with canary-weight. Standard Kubernetes Services do not support percentage-based routing natively.

  82. Question 481 of 597An enterprise-level e-commerce company is migrating its monolithic inventory management system into a Kubernetes-based microservices architecture. The application core, written in a legacy framework, is hardcoded to resolve its database connection via the hostname db-inventory-legacy on port 5432. The actual PostgreSQL database resides on a high-performance external bare-metal server outside the Kubernetes cluster to meet strict IOPS requirements. The infrastructure team requires a solution that abstracts this external dependency within Kubernetes, allowing the application to resolve the hostname correctly while providing the flexibility to update the destination IP address in the future without modifying the application configuration files or container images.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Define a Kubernetes Service of type ClusterIP named db-inventory-legacy without a label selector and manually create an Endpoints resource with the same name that specifies the external database IP address and port.

    A selectorless Service combined with manually created Endpoints correctly maps an internal DNS name to an external IP. This abstraction lets you update the database IP later without touching application code. ExternalName only handles DNS CNAMEs, not local port remapping.

  83. Question 482 of 597A legacy web application is being scaled to 10 replicas to handle increased traffic during a marketing campaign. The application uses in-memory session management, which is causing users to lose their shopping cart data whenever their requests are routed to a different Pod than the one where they initially logged in. You need to ensure that a client's requests are always sent to the same Pod throughout their session.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Modify the Service resource to set the sessionAffinity field to ClientIP to ensure sticky sessions based on the source IP.

    Setting sessionAffinity to ClientIP in the Service spec ensures requests from the same client route to the same backend pod, preserving in-memory session data. A Headless Service simply exposes pod IPs but does not enforce sticky routing like ClientIP affinity.

  84. Question 483 of 597A developer is creating a Pod for a static website that involves two distinct phases. First, a 'content-builder' container must clone a repository and run a complex build script to generate HTML files. Once the files are ready, a 'web-server' container must start and serve these files. The 'content-builder' must finish its task entirely before the 'web-server' starts, and the generated files must be shared between them to ensure the web server has the latest content.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Define the 'content-builder' as an InitContainer and use a shared volume to pass the generated HTML files

    InitContainers run sequentially to completion before app containers start, making them perfect for build steps. Shared volumes pass data between the builder and web server. The sidecar pattern starts containers concurrently, which fails the sequential execution requirement.

  85. Question 484 of 597A high-performance data processing team is implementing a Kubernetes Job to migrate 500 legacy database records. Each record takes approximately 30 seconds to process. To meet a strict maintenance window, the team requires that 10 records are processed simultaneously at any given time, and the Job must be considered successful only when all 500 records have been successfully acknowledged. Which configuration parameters in the Job spec should be defined to meet these exact requirements?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Configure the completions field to 500 and the parallelism field to 10 within the Job specification

    The completions field defines the total successful pods needed, while parallelism dictates how many run at once. For the exam, remember that Deployments use replicas, while Jobs use parallelism and completions to manage batch workloads.

  86. Question 485 of 597An application requires its configuration file, 'config.json', to be mounted at the path '/etc/app/config.json'. However, the directory '/etc/app/' already contains several other critical system files that were created during the image build process. If you mount a ConfigMap as a volume to '/etc/app/', the existing files in that directory disappear. What is the correct way to mount only the specific file without masking the existing directory content?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Utilize the subPath field within the volumeMounts section to mount only the specific key from the ConfigMap into the target file path.

    The subPath field in volumeMounts lets you mount a single file without overwriting the destination directory. Avoid using InitContainers for this, as subPath declaratively solves the file masking issue directly within the pod manifest.

  87. Question 486 of 597A stateful application named data-logger is deployed in your cluster. The application container is configured to run as a non-privileged user with UID 5000. It requires writing persistent logs to a mounted volume. However, after mounting the volume, the application fails with a Permission Denied error because the volume's root directory is owned by the root user. You need to ensure the application can write to the volume while still maintaining the non-root execution policy for the container.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Set the fsGroup field in the Pod securityContext to the group ID associated with the application user to change volume ownership

    Configuring the fsGroup in the pod security context automatically changes volume ownership to the specified group ID. This declaratively grants write access to non-root users, unlike InitContainers which require imperative permission tweaks.

  88. Question 487 of 597A data science team needs to process a large backlog of 500 data chunks. Each chunk is independent. To optimize processing time, they want to run exactly 5 worker instances in parallel. The overall task is considered complete only when 500 successful completions have been recorded. You need to configure a Kubernetes Job that manages this workload efficiently while maintaining the specified level of concurrency.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Create a Job with the completions field set to 500 and the parallelism field set to 5 to process chunks in groups of five until done

    The completions field sets the total successful pods required, while parallelism controls the concurrent workers. Remember that swapping these values would either overload the cluster or fail to achieve the desired concurrency.

  89. Question 488 of 597A financial technology company is deploying a critical transaction processing application across a multi-zone Kubernetes cluster. To ensure high availability and fault tolerance, the operations team requires that the application replicas are distributed as evenly as possible across three distinct availability zones (zone-a, zone-b, and zone-c). If the distribution cannot be perfectly even due to node constraints, the system should still allow scheduling but must prioritize the spread. Which configuration should be implemented in the Deployment manifest to satisfy this requirement precisely?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Configure topologySpreadConstraints with a maxSkew of 1, topologyKey set to topology.kubernetes.io/zone, and whenUnsatisfiable set to ScheduleAnyway.

    Using topologySpreadConstraints with a maxSkew of 1 and ScheduleAnyway fulfills both the distribution and priority requirements. Pod anti-affinity lacks the granular control needed to prioritize scheduling without strictly blocking the pods.

  90. Question 489 of 597An application Pod in your production namespace is frequently being terminated with a status of 'OOMKilled'. Monitoring data shows that the application has a memory leak that causes it to gradually consume all available memory on the node. You want to implement a mechanism that allows the application to run but ensures it is restarted whenever its memory usage exceeds 512Mi, preventing it from impacting other workloads on the same node.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: D. Configure memory limits to 512Mi in the container's resources section to trigger a restart upon exceeding the limit.

    Setting memory limits forces the container to restart when it exceeds the specified threshold. The memory requests distractor fails because requests only handle scheduling and do not enforce hard restarts.

  91. Question 490 of 597In a shared namespace named 'production-backend', you have three types of pods: 'web-frontend', 'api-server', and 'internal-db'. To meet strict security requirements, you must ensure that only pods labeled 'app: api-server' can connect to the 'internal-db' pods on port 5432. All other ingress traffic to 'internal-db' from within or outside the namespace must be prohibited. Which NetworkPolicy configuration achieves this?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Create a NetworkPolicy targeting pods with 'app: internal-db' that includes an ingress rule allowing traffic from pods with 'app: api-server' on port 5432.

    Targeting the database pods with an ingress rule restricting traffic to the api-server on port 5432 successfully isolates the workload. Egress policies only restrict outgoing traffic from the source pod, leaving the database open to other clients.

  92. Question 491 of 597You are troubleshooting a production issue in a Pod named secure-gateway that uses a distroless container image. The image does not contain any shell, package manager, or debugging tools. The Pod is running, but you suspect a configuration file is missing from the internal volume. You need to inspect the file system of the running container without restarting it or modifying the original Deployment manifest.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Execute the kubectl debug command to create an ephemeral container with a debugging image like alpine inside the existing Pod

    The kubectl debug command correctly injects an ephemeral container into a running Pod to share its namespaces. Standard kubectl exec fails on distroless images lacking a shell, and modifying the deployment requires restarts.

  93. Question 492 of 597Deployment Stability. You are updating a high-traffic e-commerce API. To prevent service interruptions during a rolling update, you want to ensure that each new Pod is not only running but has also successfully passed its health checks for at least 30 seconds before the Deployment controller continues to replace the next Pod. Which Deployment strategy field should be configured to achieve this delay?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Configure the minReadySeconds field to 30 in the Deployment specification

    The minReadySeconds field correctly forces the Deployment to wait before moving to the next Pod. The initialDelaySeconds parameter only delays the initial probe and does not guarantee post-ready stability during rollouts.

  94. Question 493 of 597Ingress TLS Configuration. You are tasked with exposing a secure internal portal at 'secure-portal.company.com'. You have been provided with a TLS certificate and a private key. You need to ensure that the Nginx Ingress Controller terminates SSL traffic and presents the correct certificate to users. Which sequence of actions is required to implement this according to Kubernetes best practices?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Create a Secret of type kubernetes.io/tls and reference it in the 'tls' section of the Ingress resource

    Creating a Secret of type kubernetes.io/tls and referencing it in the Ingress resource is correct because it provides the standard mechanism for controllers to load certificates for SSL termination. Mounting certificates directly via ConfigMaps lacks the required key separation and native integration.

  95. Question 494 of 597You are managing a resource-constrained Kubernetes cluster where the total number of Pods is strictly limited by a ResourceQuota. You have a Deployment named reporting-engine with 8 replicas. During a version update, you must ensure that at least 6 replicas are always available to handle the incoming load, but the cluster cannot host more than 9 replicas at any given time due to the strict quota. You need to configure the deployment strategy to respect these constraints.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: B. Apply a strategy with maxSurge set to 1 and maxUnavailable set to 2 to maintain exactly the number of required healthy instances

    Applying maxSurge of 1 and maxUnavailable of 2 is correct because it respects the strict quota by creating a maximum of 9 pods, while keeping 6 available. Setting maxSurge to 0 would cap replicas at 8, dropping below the required 6 available instances during updates.

  96. Question 495 of 597A security auditor requires that all Pods in the 'processing' namespace are strictly isolated. These Pods must only be allowed to communicate with a specific external logging server located at the IP address 192.168.10.50 on port 514. All other outgoing traffic to any destination, including other namespaces and the public internet, must be blocked to prevent data exfiltration. How should you define the NetworkPolicy to enforce this restriction?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: A. Define an Egress policy with an ipBlock CIDR of 192.168.10.50/32 and specify the UDP/TCP port 514

    Defining an Egress policy with an ipBlock CIDR and port is correct because it explicitly allows traffic to the external logging server while defaulting to deny for all other destinations. Ingress policies only control incoming traffic and cannot restrict outbound data exfiltration.

  97. Question 496 of 597An enterprise application named legacy-app generates performance data in a proprietary binary format and writes it to a local shared volume. The central monitoring system can only ingest data formatted as JSON via an HTTP POST request. You need to implement a solution within the same Pod that reads the binary files, converts them to JSON, and sends them to the monitoring system without modifying the original legacy-app source code.

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Implement an Adapter container that exposes a standard metrics endpoint and translates internal binary data for the monitoring system

    The correct answer uses the Adapter pattern to translate internal binary metrics into a standard format. A Sidecar container that polls the shared volume and pushes JSON also technically solves the stated requirements.

  98. Question 497 of 597A legacy Java application is being migrated to Kubernetes. The application takes about 60 seconds to initialize its internal cache. During this time, the process is running and the port is open, but it cannot yet handle traffic. If traffic is sent too early, the application crashes. Which probe configuration should be used to ensure the Pod only receives traffic after the cache is fully loaded without causing the container to restart during the warmup?

    Tap an answer — you get instant feedback and the reasoning.

    Show answer & explanation

    Correct answer: C. Use a startupProbe with a failureThreshold of 12 and a periodSeconds of 10 to cover the 120-second initialization window

    A startup probe disables liveness checks during initialization, preventing unwanted restarts. Pairing it with a readiness probe ensures traffic flows only after warmup. Fixed delays are brittle because actual startup times vary.

Study on mobile

Get CertPunch for iOS or Android.

Website sessions are saved in this browser tab. They do not transfer to the apps.

Scroll to Top