Certified Kubernetes Application Developer (CKAD) Practice Test – 597 Free Exam Questions with Answers

Certified Kubernetes Application Developer (CKAD)

597 questions · instant answer feedback · concise explanations · free

  1. Question 1 of 597A security audit has flagged that several application pods are running as the root user, which violates the organization's hardening standards. You are tasked with updating the deployment for a Python web app to ensure that it runs with the user ID 1001, belongs to the group ID 2001, and is strictly prohibited from gaining more privileges than its parent process. Which configuration block in the Pod specification is required to enforce these settings?

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

    Show answer & explanation

    Correct answer: C. A securityContext block at the container level defining runAsUser, runAsGroup, and allowPrivilegeEscalation: false.

    The container-level securityContext is the correct block because it directly defines runAsUser, runAsGroup, and allowPrivilegeEscalation to enforce these specific runtime constraints. A NetworkPolicy or RBAC bindings cannot enforce user IDs or prevent privilege escalation inside a running container.

  2. Question 2 of 597You are managing an Ingress resource that handles traffic for an internal HR portal. To secure the communication, you have been provided with a TLS certificate and a private key. You have already created a Secret named 'hr-tls-secret' containing these credentials. What is the next step to enable HTTPS on the Ingress resource for the host 'hr.example.com'?

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

    Show answer & explanation

    Correct answer: C. Update the Ingress specification by adding a 'tls' block that specifies the hosts and references the 'hr-tls-secret' name.

    Adding a TLS block to the Ingress specification referencing the existing Secret enables TLS termination for the specified host. You do not need to modify the Service or manually mount certificate volumes into the Ingress controller deployment.

  3. Question 3 of 597An engineering team is managing a multi-tenant cluster where the 'payment-processing' namespace handles highly sensitive transactions. A new compliance rule dictates that pods with the label 'role: backend' in this namespace should only accept incoming traffic from pods labeled 'role: frontend' located within the same 'payment-processing' namespace on TCP port 443. All other incoming traffic from other namespaces or other pods must be blocked. Which Kubernetes resource configuration achieves this isolation?

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

    Show answer & explanation

    Correct answer: B. A NetworkPolicy with an ingress rule that selects 'role: frontend' pods and specifies port 443 under the 'role: backend' pod selector

    A NetworkPolicy isolates the backend pods by selecting them and defining an ingress rule that permits traffic only from the frontend pod selector on TCP port 443. RBAC roles control API permissions rather than network access between pods.

  4. Question 4 of 597A distributed application consists of a 'frontend' deployment and a 'database' deployment in the same namespace. To comply with internal security standards, the database must be isolated so that it only accepts incoming connections on TCP port 5432 from pods specifically labeled with 'app: web-frontend'. You need to define the network rules to enforce this restriction while ensuring the database can still reach the cluster DNS for service discovery.

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

    Show answer & explanation

    Correct answer: C. Create a NetworkPolicy with an ingress rule matching the frontend podSelector and a port 5432

    A NetworkPolicy applied to the database pods with an ingress rule restricting port 5432 to the frontend pod selector effectively isolates the database. By default, NetworkPolicies allow egress traffic unless specifically restricted, so cluster DNS remains accessible.

  5. Question 5 of 597A deployment of 'v1.0.0' of a web application is currently running with 5 replicas. The development team wants to deploy 'v2.0.0' using a strategy that ensures at least 4 replicas are always available to handle traffic, and no more than 7 replicas are running in the cluster at any given time during the transition. Which RollingUpdate strategy parameters should the developer configure in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: C. Set maxUnavailable to 1 and maxSurge to 2 to maintain the required availability and resource usage limits during the update.

    Configuring maxUnavailable to 1 ensures 4 replicas stay available, while maxSurge set to 2 limits the maximum total replicas to 7 during the rollout. Using percentages introduces fractional replicas and unpredictable scaling limits.

  6. Question 6 of 597In a multi-tenant cluster, the 'marketing' team is complaining that their pods are being evicted because the 'data-science' team's pods are consuming all available CPU on the nodes. You need to implement a solution in the 'data-science' namespace that restricts any individual pod from requesting more than 500m CPU and also ensures the entire namespace cannot consume more than 4000m CPU in total. Which resources must be created?

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

    Show answer & explanation

    Correct answer: D. A LimitRange to set default and maximum constraints on individual pods and a ResourceQuota to limit the total namespace usage.

    A LimitRange enforces the maximum CPU limit per individual pod, while a ResourceQuota caps the total aggregate CPU usage across the namespace. PodSecurityPolicies are deprecated, and NetworkPolicies do not restrict compute resource consumption.

  7. Question 7 of 597A data science team is running intensive Python scripts in a shared cluster. Occasionally, these scripts consume all available memory on a node, causing other critical system components to fail or enter an unstable state. You must enforce memory constraints to ensure that no single pod can exceed 2GB of RAM, and if it does, it should be terminated to protect the node.

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

    Show answer & explanation

    Correct answer: C. Configure the memory limits field to 2Gi in the container's resource specification

    Setting the container memory limits field to 2Gi triggers an Out Of Memory kill if the application attempts to exceed that threshold. A ResourceQuota caps total namespace usage rather than terminating individual offending pods.

  8. Question 8 of 597A data science team needs to run a large-scale data transformation task consisting of 50 independent chunks of data. Each chunk takes about 5 minutes to process. To finish the entire task as quickly as possible without overwhelming the cluster's resources, the team wants to process exactly 5 chunks simultaneously at all times until all 50 chunks are successfully completed. Which configuration for a Kubernetes Job should be used to achieve this specific parallel execution behavior?

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

    Show answer & explanation

    Correct answer: B. Set completions: 50 and parallelism: 5 in the Job specification

    The correct answer uses completions for the total successful pods and parallelism for the concurrent workers. Do not confuse this with Deployments, which use replicas for steady-state services.

  9. Question 9 of 597A high-performance computing task involves processing 100 independent data chunks. Each chunk takes about 5 minutes to process. To meet a strict deadline, the DevOps team decides to use a Kubernetes Job that can process multiple chunks in parallel. They want exactly 10 pods to be running at any given time until all 100 chunks are successfully processed. Which parameters in the Job spec should be configured to achieve this behavior?

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

    Show answer & explanation

    Correct answer: B. Set completions to 100 and parallelism to 10 to ensure a steady state of 10 concurrent workers

    The correct answer sets completions to the total desired successes and parallelism to the concurrent worker count. Avoid swapping these values or mixing in activeDeadlineSeconds, which only sets a timeout.

  10. Question 10 of 597A security auditor has mandated that a specific Pod named 'payment-processor' in the 'finance' namespace must be restricted at the network level. The Pod is allowed to send traffic to an internal legacy database located at the IP address 10.50.0.22, but it must be strictly prohibited from initiating any other outbound connections to the internet or other internal services. You are creating a NetworkPolicy to enforce this. Which section of the NetworkPolicy manifest should you focus on to define these egress restrictions?

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

    Show answer & explanation

    Correct answer: D. Specify an egress rule with a to block containing an ipBlock for 10.50.0.22/32

    The correct answer uses an egress rule with an ipBlock targeting the database IP. Once an egress policy applies, Kubernetes isolates the pod and blocks all unspecified outbound traffic.

  11. Question 11 of 597A cluster is running at near-full capacity with several background data-processing Pods. A critical 'emergency-alert' Pod must be deployed immediately and guaranteed to run, even if it means terminating existing low-priority Pods to free up resources. The cluster administrator has already created several PriorityClasses: 'high-priority' (value: 1000000) and 'low-priority' (value: 1000). How should the developer configure the 'emergency-alert' Pod to ensure the scheduler preempts lower priority workloads?

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

    Show answer & explanation

    Correct answer: A. Assign the 'priorityClassName: high-priority' field in the Pod's spec to indicate its importance to the Kubernetes scheduler

    The correct answer assigns the priorityClassName field in the pod spec. The scheduler uses this exact field to determine priority and evict lower-priority workloads, whereas labels and autoscalers do not trigger preemption.

  12. Question 12 of 597Your organization is deploying a microservice that requires access to a sensitive database password and a shared configuration file containing API endpoints. According to the strict security policy, sensitive information must not be exposed as environment variables within the container to prevent accidental leaks in logs or process dumps. The application expects the password to be available at /etc/secrets/db-password and the configuration at /etc/config/settings.yaml. How should you configure the Pod specification to meet these requirements?

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

    Show answer & explanation

    Correct answer: D. Mount the Secret and ConfigMap as separate volumes and use volumeMounts to map them to the specific directory paths

    Mounting Secrets and ConfigMaps as volumes projects the data as files at the specified paths. Using envFrom would inject values as environment variables, violating the strict security policy.

  13. Question 13 of 597A complex Java-based microservice takes approximately 90 seconds to initialize its internal cache and establish connections to backend databases. During the deployment process, the developer notices that Kubernetes restarts the container several times before it becomes stable. The current configuration includes a livenessProbe with an initialDelaySeconds of 10. How should the developer adjust the probe configuration to ensure the application starts successfully without being prematurely terminated?

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

    Show answer & explanation

    Correct answer: C. Replace the livenessProbe with a startupProbe that has a sufficient failureThreshold and periodSeconds for the 90-second delay.

    A startupProbe correctly disables liveness checks during initialization, preventing premature restarts for slow-starting apps. Relying only on livenessProbe delays risks killing the container before it fully boots.

  14. Question 14 of 597A high-traffic e-commerce platform uses a legacy binary that outputs internal transaction logs to a local file system path /opt/app/logs/output.log. The platform team needs to stream these logs to a central Fluentd collector without altering the legacy application source code or its container image. They decide to implement a multi-container Pod pattern to handle this requirement efficiently within the Kubernetes cluster. Which implementation strategy should the developer use to meet these requirements?

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

    Show answer & explanation

    Correct answer: A. Deploy a sidecar container sharing an emptyDir volume with the main application to tail the log file to stdout.

    A sidecar container sharing an emptyDir volume correctly tails the log file and streams it to stdout. This pattern extends the main container's functionality without modifying its source code or image.

  15. Question 15 of 597You are investigating a performance issue in a shared development namespace. One application container is consuming an excessive amount of CPU, which is starving other critical development tools in the same namespace. To prevent this 'noisy neighbor' effect in the future, you want to enforce a policy that requires every container in this namespace to specify its own resource limits. If a container does not specify them, it should be assigned a default limit automatically. Which Kubernetes object should you configure?

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

    Show answer & explanation

    Correct answer: B. A LimitRange object defined within the namespace to set default requests and limits for CPU and Memory.

    A LimitRange is the correct object to automatically enforce default CPU and memory limits for individual containers. A ResourceQuota caps total namespace usage but does not assign default limits per pod.

  16. Question 16 of 597A data processing application needs to process a backlog of 100 files stored in an S3 bucket. To optimize performance, the team wants to run exactly 5 worker pods simultaneously until all 100 files are processed. Each pod processes one file and then terminates. Which configuration in a Kubernetes Job object will ensure this specific level of parallelism and total completion count?

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

    Show answer & explanation

    Correct answer: C. Define a Job with completions: 100 and parallelism: 5 to manage the lifecycle of the worker pods.

    A Job specifically manages batch tasks using parallelism to limit concurrent pods and completions to set the total success count. Deployments and ReplicaSets are meant for long-running services, not tasks that terminate after processing.

  17. Question 17 of 597A security policy requires that all Pods in the 'finance-prod' namespace must follow the 'Restricted' Pod Security Standard. Specifically, the application must run with a non-root user, must not be allowed to escalate its privileges, and must have its root filesystem mounted as read-only to prevent unauthorized modifications of the container image at runtime. You are configuring the PodSpec for a new transaction-processor microservice. Which combination of securityContext settings at the container level will satisfy these specific requirements?

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

    Show answer & explanation

    Correct answer: A. runAsNonRoot: true, allowPrivilegeEscalation: false, and readOnlyRootFilesystem: true

    This combination directly enforces non-root execution, prevents privilege escalation, and makes the root filesystem immutable. Option C misses the required read-only filesystem, and Option B adds unnecessary complexity without meeting all criteria.

  18. Question 18 of 597A complex analytics application requires a specific configuration file to be available in a shared volume before the main application container starts. This file is generated by a legacy script that requires a different base image and specific environment variables not needed by the main application. The generation process must finish successfully before the application begins its startup sequence. If the file generation fails, the application should not start at all. What is the most efficient way to implement this dependency within the Pod specification?

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

    Show answer & explanation

    Correct answer: D. Use an InitContainer to run the legacy script and write the file to a shared volume

    An InitContainer runs to completion before the main container starts, blocking startup if it fails. Sidecars and lifecycle hooks run concurrently with the app, meaning they cannot guarantee the file exists before the main process begins.

  19. Question 19 of 597Your application deployment named 'transaction-manager' must ensure that no more than one instance of the pod is running at any given time because it uses an exclusive file lock on a shared network storage volume. When updating the application to a new version, the existing pod must be completely terminated and its resources released before the new version starts to avoid lock contention. The standard rolling update process is causing failures because the new pod starts before the old one is deleted. Which deployment configuration change is required?

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

    Show answer & explanation

    Correct answer: A. Set the 'strategy' type to 'Recreate' to ensure all existing pods are killed before any new pods are created during the update.

    The Recreate strategy terminates all existing pods before creating new ones, preventing concurrent access. RollingUpdate attempts to scale new pods while old ones are still terminating, which would cause lock contention.

  20. Question 20 of 597An application is known to experience occasional internal deadlocks where the main process remains active but fails to process any further incoming requests. The container runtime does not detect this as a crash because the PID 1 process is still alive. You need to implement a mechanism that allows the Kubernetes control plane to automatically detect this unhealthy state and perform a container restart.

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

    Show answer & explanation

    Correct answer: A. Implement a LivenessProbe that checks an internal health endpoint for responsiveness

    A LivenessProbe detects unrecoverable states like deadlocks and triggers the kubelet to restart the container. A ReadinessProbe would only remove the pod from service, but it would not restart the deadlocked process.

  21. Question 21 of 597An organization is deploying an application that requires access to a sensitive API key stored in a Secret named 'api-credentials'. The security policy dictates that the secret must not be exposed as an environment variable to prevent it from being logged by the application process or visible in the container metadata. Instead, the application expects the key to be available as a file at the path '/etc/api/key.txt'. How should the Pod be configured to satisfy this security requirement?

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

    Show answer & explanation

    Correct answer: C. Configure a volume of type 'secret' in the Pod spec and mount it as a volumeMount at the specified path in the container.

    Mounting a Secret as a volume writes the data to a memory-backed filesystem at the exact target path. This avoids accidental exposure via environment variables in process listings or application crash logs.

  22. Question 22 of 597A Python-based data processing application occasionally enters a deadlock state due to resource contention. In this state, the process remains running, so the container does not exit, but it stops consuming messages from the internal queue. You need to configure a mechanism that detects this stall and triggers a container restart to recover the service. Which configuration is most appropriate?

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

    Show answer & explanation

    Correct answer: C. Configure a LivenessProbe that executes a script checking for recent activity in the application processing logs.

    A LivenessProbe using an exec action checks application activity and restarts the container if the probe fails. A ReadinessProbe only removes the pod from the service endpoints without restarting the deadlocked process.

  23. Question 23 of 597A legacy enterprise application writes its operational logs directly to a static file located at /opt/app/logs/server.log inside the container. The corporate logging policy requires these logs to be streamed to stdout so they can be captured by the cluster-wide Fluentd collector. You cannot modify the original application code or the container image. How should you design the Pod to meet this requirement using a common Kubernetes pattern?

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

    Show answer & explanation

    Correct answer: A. Add a sidecar container to the Pod that shares a volume with the main container and runs a command to tail the log file to its own stdout.

    A sidecar container shares a volume with the main app and tails the log file to its own standard output. This streams the logs to the Kubernetes infrastructure without modifying the original application image.

  24. Question 24 of 597A development team is preparing to update a critical data-migration application from version 2.0 to 3.0. The update includes a non-backward compatible database schema change. If version 2.0 and version 3.0 run simultaneously, the older version will crash when it encounters the new schema, potentially leaving the database in an inconsistent state. The team requires a deployment strategy that ensures the old version is completely terminated before any new pods are started. Which strategy should be defined in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: C. Set the strategy type to Recreate to ensure all existing Pods are killed before new ones are created

    Setting the strategy type to Recreate guarantees all old pods are killed before new ones are created. A RollingUpdate would temporarily run both versions concurrently, crashing the older pods accessing the new schema.

  25. Question 25 of 597An external legacy monitoring system needs to collect metrics from a Prometheus exporter running as a Service inside your Kubernetes cluster. The monitoring system is located on the same physical network as the cluster nodes but cannot use an Ingress. It requires a fixed port that is accessible on every node's IP address. Which Service type should you implement?

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

    Show answer & explanation

    Correct answer: B. Configure a Service of type NodePort and specify a value in the nodePort field between 30000 and 32767.

    A NodePort service exposes the application on a static port across all cluster nodes. ClusterIP is internal only, while LoadBalancer relies on cloud provider integration rather than direct node access.

  26. Question 26 of 597A data engineer is managing a stateful workload that stores critical logs on a PersistentVolume (PV) backed by cloud-specific block storage. The engineer is concerned that if the PersistentVolumeClaim (PVC) is accidentally deleted by an automated cleanup script, the underlying data and the physical storage volume will be immediately purged by the cloud provider. Which configuration must be applied to the PersistentVolume to ensure the physical data remains intact even if the PVC is removed?

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

    Show answer & explanation

    Correct answer: C. Update the persistentVolumeReclaimPolicy of the PV to the value Retain

    The Retain reclaim policy ensures the underlying storage asset and data are preserved when the PersistentVolumeClaim is deleted. On the exam, recall that the default policy for dynamically provisioned cloud volumes is Delete, so you must explicitly patch the PersistentVolume to Retain.

  27. Question 27 of 597The development team is working in a shared Kubernetes namespace that has a ResourceQuota enforced. This quota requires every Pod to have explicit CPU and memory requests and limits defined. You are deploying a resource-intensive data processing Pod that occasionally spikes in CPU usage. If you define only the CPU limits without specifying CPU requests in your Pod manifest, how will the Kubernetes control plane handle the Pod creation request in this restricted namespace?

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

    Show answer & explanation

    Correct answer: D. Kubernetes will automatically set the requests to match the defined limits

    In a restricted namespace, Kubernetes automatically sets the CPU and memory requests to match the defined limits if limits are omitted. The default request of zero is incorrect because ResourceQuota validation requires explicit values, which it derives from the limits.

  28. Question 28 of 597Your company manages a web platform where the main site is hosted at example.com, and a separate search service is hosted at example.com/search. Each is managed by a different Deployment and Service. You need to configure a single entry point that routes traffic to the appropriate backend Service based on the URL path. What is the most efficient Kubernetes resource to manage this requirement?

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

    Show answer & explanation

    Correct answer: C. An Ingress resource with path-based rules mapping / and /search to their respective backend services.

    An Ingress resource handles Layer 7 routing based on URL paths, efficiently mapping different routes to backend services. Using a LoadBalancer service is incorrect because it lacks native HTTP path-awareness, and manually updating endpoints is not a standard Kubernetes pattern.

  29. Question 29 of 597A stateful database application needs to be deployed in a Kubernetes cluster. The database requires high-performance disk access and the data must persist even if the Pod is rescheduled to a different node. The cluster uses an external cloud storage provider that supports volume attaching to a single node at a time. Which PersistentVolume access mode and volume type should the developer choose for this database deployment?

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

    Show answer & explanation

    Correct answer: C. Use ReadWriteOnce (RWO) access mode with a PersistentVolumeClaim to ensure exclusive access for the single database Pod.

    ReadWriteOnce allows a single node to mount the cloud block storage for exclusive read-write access, protecting the database. ReadWriteMany is incorrect because cloud block storage typically does not support multi-node simultaneous writing.

  30. Question 30 of 597Your team needs to schedule a recurring data validation task that runs every hour. A critical requirement is that if a task instance takes longer than 60 minutes to complete, the next scheduled instance must not start until the current one has finished, to avoid overlapping database writes and potential data corruption. Which configuration field in the CronJob manifest is essential to enforce this behavior?

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

    Show answer & explanation

    Correct answer: C. Configure 'concurrencyPolicy' to 'Forbid' to prevent the controller from starting a new Job if the previous one is still running.

    Setting concurrencyPolicy to Forbid prevents overlapping Job executions by skipping new runs if a previous one is active. backoffLimit is incorrect because it limits failure retries rather than controlling concurrent schedules.

  31. Question 31 of 597Your team is preparing to launch a new version of the 'order-processor' application. To minimize risk, you want to perform a canary deployment where only 10% of the production traffic is directed to the new version (v2), while the remaining 90% stays on the stable version (v1). Both versions should be accessible via the same Service named 'order-service'. How can you achieve this using standard Kubernetes Deployment and Service objects without an Ingress controller or Service Mesh?

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

    Show answer & explanation

    Correct answer: D. Create two separate Deployments (v1 and v2) with the same labels used by the Service's selector, and adjust the replica counts to a 9:1 ratio.

    A Kubernetes Service load-balances across all Pods matching its label selector. Creating two Deployments with identical labels and a 9:1 replica ratio achieves the 10% traffic split. Setting an image list is invalid because Deployments only run a single image per container template.

  32. Question 32 of 597A network security audit has identified that several Pods in the 'internal-services' namespace have unrestricted access to the public internet. The corporate policy mandates that all Pods in this namespace must be prohibited from making any outbound connections, except for communication to a specific internal DNS server located at 10.10.10.53 on UDP port 53. You are tasked with creating a NetworkPolicy that enforces these egress rules while maintaining normal operation for internal DNS resolution. How should the egress section of the NetworkPolicy be structured?

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

    Show answer & explanation

    Correct answer: C. Define an egress rule with a 'to' block containing an 'ipBlock' for 10.10.10.53/32 and a 'ports' block for UDP port 53.

    Specifying an ipBlock destination and specific port creates an explicit allow-list for egress traffic, denying everything else by default. An empty or undefined egress list blocks all outbound traffic entirely, breaking DNS resolution and violating the functional requirement.

  33. Question 33 of 597A team is migrating a microservices architecture to Kubernetes. One of the internal services needs to communicate with an Oracle database that is currently hosted on a physical server outside the cluster. To keep the application configuration consistent with other internal services, the team wants to use a standard Kubernetes DNS name like 'db-service.production.svc.cluster.local' to reach the external database. Which type of Kubernetes Service should be created to map this internal DNS name to the external IP or FQDN of the Oracle database?

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

    Show answer & explanation

    Correct answer: C. A Service of type ExternalName that points to the external database FQDN

    The ExternalName service type maps a service to a DNS name by returning a CNAME record with the external address. Other options like ClusterIP or LoadBalancer are intended for routing traffic to cluster pods rather than providing lightweight aliasing to external FQDNs.

  34. Question 34 of 597Your team is deploying a microservice that needs to connect to an external database. Due to a recent network security audit, you are required to restrict egress traffic from the microservice Pod so that it can only communicate with the specific CIDR block of the database server and is blocked from accessing any other external or internal IP addresses. The Pod is labeled 'app: processor' in the 'finance' namespace. What is the correct approach to implement this restriction using native Kubernetes resources?

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

    Show answer & explanation

    Correct answer: A. Create a NetworkPolicy in the finance namespace with an egress rule specifying the target CIDR and an empty podSelector.

    A NetworkPolicy with an egress section allows you to define white-listed destinations based on CIDR blocks and labels. Defining allowed egress CIDRs isolates traffic, as all other outbound paths are automatically denied once the policy applies.

  35. Question 35 of 597A retail company uses a legacy inventory management application that outputs log files in a proprietary binary format to a local volume. The company monitoring stack only supports JSON format via a centralized collector. You are tasked with implementing a Kubernetes-native solution that transforms these logs in real-time without modifying the core application code or its image. Which design pattern should be applied to meet this requirement while maintaining clear separation of concerns?

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

    Show answer & explanation

    Correct answer: C. Deploy an Adapter container that reads the binary logs and exports them in JSON format

    The Adapter container pattern standardizes or translates application output, converting proprietary logs into JSON format for monitoring tools. An init container runs only once before the app starts, so it cannot handle continuous, real-time log transformation during the application lifecycle.

  36. Question 36 of 597An engineering team is attempting to deploy a suite of resource-intensive microservices into a dedicated namespace called accounting-prod. During the rollout, several Pods remain in a Pending state. An inspection of the events reveals a message stating that the requested CPU and memory exceed the limits defined by a ResourceQuota object in the namespace. However, the cluster has ample physical capacity. You must resolve this by ensuring that every container in the namespace is automatically assigned a default resource consumption profile if none is specified by the developer. Which Kubernetes object should you implement to automate this requirement?

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

    Show answer & explanation

    Correct answer: A. Create a LimitRange object in the accounting-prod namespace to define default requests and limits

    A LimitRange sets default request and limit values for containers, automatically injecting them if a pod lacks explicit resource definitions. This ensures pods comply with namespace ResourceQuotas, resolving the pending state without manually adjusting individual deployments.

  37. Question 37 of 597A complex data-processing application requires a specific configuration directory to be populated with a large dataset from an external S3 bucket before the main application starts. The main application image is stripped of all utilities for security reasons. How can you ensure the data is available in the shared volume /data before the application begins its execution?

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

    Show answer & explanation

    Correct answer: A. Utilize an InitContainer with an image that includes the AWS CLI to download the data into a shared emptyDir volume.

    Init containers run to completion before the main application starts, preparing shared volumes safely using specialized tools. A postStart hook executes concurrently with the main container, creating a race condition where the app might access the directory before the download finishes.

  38. Question 38 of 597A high-availability web portal named portal-web is being deployed into a production cluster that spans three distinct availability zones (zone-a, zone-b, and zone-c). The deployment consists of 12 replicas. To maintain service continuity during a regional failure, you must ensure that these replicas are distributed evenly across the zones. The requirement specifies that if the scheduler cannot achieve a perfectly even distribution due to resource constraints in one zone, it must still schedule the pod rather than leaving it in a Pending state. Which pod specification configuration correctly implements this requirement?

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

    Show answer & explanation

    Correct answer: C. Set topologySpreadConstraints with maxSkew: 1, topologyKey: topology.kubernetes.io/zone, and whenUnsatisfiable: ScheduleAnyway.

    Setting whenUnsatisfiable to ScheduleAnyway within topologySpreadConstraints creates a soft rule, prioritizing even spread while guaranteeing the pod schedules during resource constraints. Using DoNotSchedule acts as a hard constraint, leaving the pod pending if exact distribution fails.

  39. Question 39 of 597A production deployment currently running 10 replicas needs to be updated to a new version. The cluster has limited available resources, and you cannot exceed 12 total pods at any time during the transition to avoid node pressure. However, to maintain user experience, the application must never have fewer than 9 replicas available at any given moment. Which RollingUpdate strategy configuration correctly fulfills these constraints?

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

    Show answer & explanation

    Correct answer: A. Define the maxSurge as 2 and the maxUnavailable as 1 in the deployment specification

    A maxSurge of 2 permits scaling up to 12 pods maximum, preventing node pressure during the update. A maxUnavailable of 1 guarantees at least 9 replicas remain ready, satisfying the minimum capacity requirement throughout the rollout process.

  40. Question 40 of 597A microservices architecture consists of a 'frontend' application in the 'web-dev' namespace and a 'catalog-db' service in the 'data-services' namespace. The developers are reporting that the frontend cannot reach the database using the short name 'catalog-db'. You need to provide the correct internal Fully Qualified Domain Name (FQDN) that follows the Kubernetes DNS standard so that the frontend can communicate with the database service across namespace boundaries. What is the correct FQDN for the 'catalog-db' service?

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

    Show answer & explanation

    Correct answer: C. catalog-db.data-services.svc.cluster.local

    The standard Kubernetes service FQDN format is service-name.namespace.svc.cluster.local, which allows cross-namespace resolution via CoreDNS. Watch the domain word order carefully, as reversing the service and namespace parts is a common trap.

  41. Question 41 of 597Your cluster is running at maximum capacity, and you cannot provision additional nodes. You need to update a Deployment named 'order-service' that currently has 10 replicas. The update must ensure that at no point there are more than 10 pods running, and at least 8 pods must be available at all times during the rolling update. Which strategy parameters should you set?

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

    Show answer & explanation

    Correct answer: B. Set maxSurge to 0 and maxUnavailable to 2 in the RollingUpdate strategy specification.

    Setting maxSurge to 0 prevents any new pods beyond the desired count, while maxUnavailable to 2 maintains the minimum required availability. Choosing a non-zero maxSurge would violate the hard cluster capacity limit.

  42. Question 42 of 597You are managing a microservice that processes messages from a RabbitMQ queue. You notice that occasionally the application enters a deadlock state where the HTTP health check endpoint still responds with 200 OK, but the internal message consumer thread has stopped working entirely. To improve observability and self-healing, you need to implement a check that verifies if the message consumer is still active by checking the timestamp of the last processed message in a local file. How should you configure the Pod to handle this specific failure mode?

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

    Show answer & explanation

    Correct answer: A. Configure an 'livenessProbe' that uses an 'exec' command to run a script checking the age of the last processed message file.

    A liveness probe using an exec command directly checks internal application health and triggers a restart if the script fails. A readiness probe would only stop traffic routing, leaving the deadlocked consumer unhealed.

  43. Question 43 of 597A security-sensitive application requires access to an API key stored in a Kubernetes Secret named 'provider-credentials'. The application is designed to look for this key at a specific file path: '/var/secrets/api/token'. However, the Secret contains multiple data keys (username, password, and token). You need to mount only the 'token' value from the Secret into the container at the exact file path required by the application without mounting the other keys. How should you configure the volumeMounts and volumes in the Pod specification?

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

    Show answer & explanation

    Correct answer: C. Use the secret volume with the 'items' field to map the specific key to a path

    Using the items field in a secret volume projection selectively exposes specific keys at designated file paths. Environment variables cannot easily map to required file paths, and mounting the entire secret overwrites the directory.

  44. Question 44 of 597A data processing application needs to run a specific maintenance script every night at 2:00 AM. The script performs a cleanup of a shared persistent volume and then terminates. The operation must be guaranteed to run to completion at least once, and if the container fails during the execution, it should be retried until successful. Which Kubernetes resource is specifically designed to handle this time-based, finite task while ensuring completion?

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

    Show answer & explanation

    Correct answer: A. A CronJob resource that defines the schedule and contains a Job template for the maintenance task.

    A CronJob schedules time-based tasks and wraps them in a Job template to ensure finite execution with retries. Deployments are for perpetual services, while StatefulSets and DaemonSets do not guarantee task completion.

  45. Question 45 of 597During a routine update of the 'order-api' deployment, a new container image version (v2.5) was rolled out. Immediately after the update, the support team reported a 100% error rate on the order submission endpoint. You checked the rollout history and found that version 2.4 was the previous stable release. You need to immediately revert the deployment to the state it was in during revision 12, which corresponds to the stable v2.4 version. Which command should you use to perform this specific rollback?

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

    Show answer & explanation

    Correct answer: B. kubectl rollout undo deployment order-api –to-revision=12

    The kubectl rollout undo command with the to-revision flag immediately restores a deployment to its exact previous state. The pause command simply halts a rollout, and set image pushes a new update forward.

  46. Question 46 of 597A critical Java-based microservice takes a significant amount of time to warm up its internal cache after the process starts. During this warm-up period, the application process is running, but it cannot yet handle incoming traffic efficiently and would return errors if it received requests. You need to ensure that the Kubernetes Service does not forward traffic to the Pod until the cache is fully populated. Which probe configuration is most appropriate for this specific requirement?

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

    Show answer & explanation

    Correct answer: A. A readinessProbe configured to check the cache status via an exec command

    A readiness probe checks if an application is ready to accept traffic and removes the pod from endpoints until it passes. A liveness probe restarts unhealthy containers, and a startup probe only gates other probes during initialization.

  47. Question 47 of 597An application pod needs to read and write data to a PersistentVolume (PV) mounted at /data/storage. The application runs inside the container as a non-privileged user with UID 1005. However, the external storage provider provisions the volume with root ownership, causing 'Permission Denied' errors when the application attempts to create files. How can you ensure the application has the correct permissions without modifying the container image or using a root-based sidecar?

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

    Show answer & explanation

    Correct answer: A. Configure the Pod's securityContext with the fsGroup field set to 1005 to allow the volume to be owned by that group

    Setting fsGroup in the pod securityContext automatically changes the mounted volume ownership to the specified group. Running privileged containers or using hostPath volumes violates basic security best practices.

  48. Question 48 of 597A multi-tier application consists of a 'frontend' and a 'database' in the same namespace. To improve security, you must implement a policy that prevents all incoming traffic to the 'database' Pod except for connections on port 5432 originating from Pods that have the label 'role: backend'. Which Kubernetes resource and configuration will achieve this isolation?

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

    Show answer & explanation

    Correct answer: A. A NetworkPolicy with an ingress rule that selects the backend pods and specifies the target port for the database pods.

    A NetworkPolicy applied to the database pods uses an ingress rule to explicitly allow traffic only from pods matching the backend label on port 5432. Services and Ingress resources handle traffic routing and discovery but do not block unauthorized pod-to-pod traffic.

  49. Question 49 of 597An API microservice depends on an external legacy database hosted on-premises. If the database becomes unreachable, the microservice can no longer process requests, but the container process itself remains healthy. The operations team wants to ensure that the Pod stops receiving traffic if the database connection fails, but they do not want Kubernetes to restart the container, as the issue is external and a restart won't fix it. How should the probes be configured?

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

    Show answer & explanation

    Correct answer: A. Configure a Readiness probe to check database connectivity while keeping the Liveness probe focused only on the local process health.

    Failing a Readiness probe removes the Pod from Service endpoints without restarting the container, fulfilling the requirement to stop traffic during an external database outage. A Liveness probe failure would force a restart, which is the exact behavior to avoid here.

  50. Question 50 of 597A web platform needs to host three different services (Marketing, Sales, and Support) under a single external IP address. The routing must be handled based on the URL path: '/marketing' should go to the marketing-service, '/sales' to the sales-service, and '/support' to the support-service. All services are running on port 80. What is the most efficient Kubernetes resource to implement this path-based routing at the cluster edge?

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

    Show answer & explanation

    Correct answer: A. An Ingress resource with a set of rules defining path-based backend targets for each service.

    An Ingress resource configured with path-based routing rules maps distinct HTTP paths to different backend Services behind a single IP. ClusterIP services lack Layer 7 routing capabilities, and custom sidecars introduce unnecessary operational complexity.

  51. Question 51 of 597A financial services company is deploying a highly sensitive payment processing application. The application requires access to an API key and a database password. For security reasons, the security team mandates that these sensitive credentials must never be stored in the Pod's environment variables to prevent accidental exposure via debugging tools. Instead, they must be projected into the Pod as files with restricted permissions. What is the most secure and native way to achieve this requirement in Kubernetes?

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

    Show answer & explanation

    Correct answer: D. Store the credentials in a Kubernetes Secret and mount that Secret as a volume at a specific path in the container.

    The correct answer uses a Kubernetes Secret mounted as a volume to project credentials as files. ConfigMaps lack security features for sensitive data, and environment variables risk exposure via logs.

  52. Question 52 of 597A microservice requires a sensitive configuration file to be fetched from a secure vault and placed into a shared volume before the main application starts. The main application does not have the credentials or logic to interact with the vault directly. Which Kubernetes feature allows you to perform this setup securely and ensures the main container only starts once the file is present?

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

    Show answer & explanation

    Correct answer: A. Implement an init container that fetches the file and writes it to an emptyDir volume

    Init containers run to completion before any app containers start, guaranteeing the file exists. A postStart hook executes concurrently with the main container, creating a race condition where the app might look for the file before it is written.

  53. Question 53 of 597An application pod requires a specific configuration file to be generated based on the current environment's dynamic variables before the main application starts. This generation process involves running a specialized utility tool that is not included in the main application's lightweight container image to keep the image size small. The generated file should be stored in a location where the main application can read it at runtime. What is the most efficient Kubernetes pattern to implement this?

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

    Show answer & explanation

    Correct answer: A. Use an init container with the utility tool image and a shared emptyDir volume to generate and pass the file to the main container

    Init containers run to completion before the main app starts, safely using separate images. A sidecar runs concurrently and wastes resources, while modifying the main image bloats it.

  54. Question 54 of 597An application requires sensitive API keys and a large configuration file to operate. The developer decides to use a Secret for the keys and a ConfigMap for the configuration file, both mounted as volumes. During a maintenance window, the ConfigMap is updated with new values. The developer needs to ensure the application picks up these changes without manually deleting the Pods, assuming the application process is capable of reloading files from disk. Which behavior of Kubernetes volume mounting should the developer rely on?

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

    Show answer & explanation

    Correct answer: C. The kubelet periodically synchronizes mounted ConfigMaps and Secrets, updating the projected files in the volume without a restart.

    The kubelet automatically synchronizes mounted volumes on a configurable delay, updating files without a restart. Avoid using subPath for files that require updates, as subPath mounts do not receive live updates.

  55. Question 55 of 597Your application needs to perform a complex calculation using a large static dataset provided as a CSV file. This dataset is updated weekly by a separate data science team and stored in a ConfigMap named 'calculation-data'. The application expects this data to be available at '/data/values.csv'. However, the application process does not have permission to write to the '/data' directory. How can you ensure the ConfigMap is correctly mounted as a file without changing the directory permissions or the container image?

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

    Show answer & explanation

    Correct answer: C. Mount the ConfigMap using a volumeMount with a subPath that points specifically to the 'values.csv' key within the directory.

    Using subPath mounts a specific file without overwriting the target directory. This avoids permission issues entirely. Setting readOnly to false does not bypass filesystem permission rules for the directory.

  56. Question 56 of 597An application Pod named 'batch-processor' has entered a 'CrashLoopBackOff' state immediately after deployment. You have attempted to check the logs using 'kubectl logs batch-processor', but the output is completely empty because the container crashes before it can write anything to the standard output. You need to gather more information about why the container is failing to start or why it is being terminated by the system. Which sequence of commands provides the most relevant diagnostic information for this scenario?

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

    Show answer & explanation

    Correct answer: A. kubectl describe pod batch-processor and then kubectl logs –previous

    The describe command reveals events like failed probes or pull errors. The previous flag retrieves logs from the last crashed instance. Executing into the container will fail because it keeps crashing.

  57. Question 57 of 597You are configuring an Ingress resource to route traffic to multiple microservices. The external users access the services via a single domain 'api.example.com'. Requests to 'api.example.com/orders' should be routed to the 'orders-service' on port 80. However, the 'orders-service' application is not aware of the '/orders' prefix and expects all incoming requests to be on the root path '/'. Which Ingress controller configuration is required to ensure the prefix is removed before the request reaches the backend service?

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

    Show answer & explanation

    Correct answer: D. Add an annotation such as 'nginx.ingress.kubernetes.io/rewrite-target: /' to the Ingress resource to modify the URI path

    Ingress controllers use annotations like rewrite-target to modify HTTP requests before forwarding them. Services and NetworkPolicies operate below the application layer and cannot manipulate HTTP paths.

  58. Question 58 of 597A production deployment named 'inventory-api' currently runs 10 replicas of version v1. The management requires that during the update to version v2, the application must never drop below 100% of its current capacity to ensure zero performance degradation for users. Simultaneously, the cloud infrastructure team has set a strict limit on resource usage, allowing only 2 additional Pod instances to be created temporarily during the rollout. Which configuration for the RollingUpdate strategy should you apply to the Deployment manifest?

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

    Show answer & explanation

    Correct answer: C. Set maxSurge to 2 and maxUnavailable to 0 to maintain full capacity

    Setting maxUnavailable to zero maintains the ten replicas, satisfying full capacity. Setting maxSurge to two respects the strict limit of two extra pods. Any maxUnavailable value above zero drops capacity.

  59. Question 59 of 597Your organization is hosting a web application that must be accessible over HTTPS via the domain 'app.example.com'. You have been provided with a TLS certificate and a private key. You have already created a Kubernetes Secret named 'app-tls-secret' containing the 'tls.crt' and 'tls.key'. You now need to configure an Ingress resource to use this secret for TLS termination at the Ingress controller level. Which section must be added to the Ingress manifest to correctly implement this?

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

    Show answer & explanation

    Correct answer: A. A tls block containing the hosts list and the secretName referencing the secret

    The spec dot tls block configures TLS termination by mapping domain hosts to a specific Kubernetes Secret. The Ingress controller serves the certificate, so backend services can remain on standard HTTP.

  60. Question 60 of 597Your engineering team is deploying a modern application that outputs performance metrics in Prometheus format. However, the organization's legacy centralized monitoring server only accepts metrics via a proprietary XML-based API. You need to implement a solution where a container within the same Pod reads the Prometheus metrics from the application and transforms them into the proprietary format before pushing them to the monitoring server without modifying the original application code. Which container pattern is most appropriate for this specific integration scenario?

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

    Show answer & explanation

    Correct answer: C. Utilize an Adapter container to standardize the output of the application to match the requirements of the external monitoring system.

    The Adapter pattern standardizes output by transforming internal application data for external systems. This differs from a standard sidecar, which typically extends or proxies services without fundamentally altering the data format.

  61. Question 61 of 597A critical banking application requires a deployment strategy where the new version (v2) is fully deployed and tested alongside the current version (v1) before any production traffic is cut over. The organization requires a method that allows for an instantaneous switch of traffic and an immediate rollback by pointing back to the old version if any issues are detected in the live environment. Which Kubernetes-native approach best meets these requirements?

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

    Show answer & explanation

    Correct answer: A. Deploy version v2 as a separate Deployment and update the Service label selector to point to the new version's labels.

    Updating a service selector to point to a completely new deployment achieves a Blue-Green release. Rolling updates lack instantaneous rollback because traffic must be gradually shifted back to the original pods.

  62. Question 62 of 597A DevOps engineer is troubleshooting a 'payments-api' deployment that keeps failing with a status of OOMKilled. The node has plenty of available memory, but the Pod specifically is being terminated shortly after it starts processing transactions. The developer suspects that the resource constraints defined in the deployment manifest are too restrictive for the application's actual memory footprint during peak loads. Which action is the most appropriate to stabilize the deployment?

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

    Show answer & explanation

    Correct answer: B. Increase the memory limit in the resources section of the container specification to match the application's peak usage requirements.

    The OOMKilled status indicates a container exceeded its configured memory limit. Increasing the limit in the resource specification directly resolves the termination. Moving the pod to a larger node will not help because the kernel kills the process based on the pod limit, not node capacity.

  63. Question 63 of 597You are tasked with securing a public-facing web application hosted on Kubernetes. The application is accessed via an Ingress resource at the host 'api.company-services.com'. Your security department has provided a valid SSL certificate and a private key that must be used to encrypt all incoming traffic. You have already created a TLS secret named 'api-tls-secret' in the same namespace as the application. How must the Ingress resource be configured to correctly utilize this secret for HTTPS termination for the specified host?

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

    Show answer & explanation

    Correct answer: A. Add a tls section to the Ingress spec containing the secretName and the list of hosts

    The standard method for enabling TLS on an Ingress is adding a tls section to the spec with the secretName and hosts list. Controller-specific annotations are deprecated and non-portable. Relying on the native tls block ensures the controller correctly serves the certificate for the specified hostname.

  64. Question 64 of 597A developer is troubleshooting a deployment named 'order-service' that is constantly crashing immediately after start. The 'kubectl get pods' command shows the status as 'CrashLoopBackOff'. The developer needs to see the log output from the very last execution of the container to understand why it failed, but the logs for the currently running (but failing) container are empty. Which command provides the necessary diagnostic information?

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

    Show answer & explanation

    Correct answer: B. Execute 'kubectl logs order-service –previous' to retrieve the logs from the last terminated container instance

    The –previous flag retrieves stdout and stderr from the previously terminated container instance. This is the primary debugging tool for CrashLoopBackOff scenarios where the current container has not logged anything yet. The describe command only shows cluster events, not application output.

  65. Question 65 of 597During a troubleshooting session, you notice that several Pods for your application are stuck in the 'ImagePullBackOff' state. You suspect that the issue is related to the private container registry credentials, but you need to confirm exactly why the image retrieval is failing (e.g., 'authentication failed' vs 'image not found'). Which 'kubectl' command provides the detailed event log showing the specific error messages from the Kubelet regarding the image pull process?

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

    Show answer & explanation

    Correct answer: A. kubectl describe pod <pod-name> to inspect the 'Events' section at the bottom of the output.

    The kubectl describe pod command displays a chronological Events section containing explicit Kubelet messages detailing exactly why the image pull failed. The logs command will not work because the container has not started, meaning there is no application output to inspect.

  66. Question 66 of 597An enterprise legacy application is migrating to a Kubernetes environment. The application is hardcoded to write its internal transaction logs to a specific local file path within its container. To comply with the company's centralized logging policy, you must ensure these logs are continuously streamed to a logging aggregator without altering the application's source code or its container image. You decide to implement a multi-container Pod. Which container pattern is most appropriate to solve this requirement by sharing a volume and tailing the log file?

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

    Show answer & explanation

    Correct answer: A. Implementing a Sidecar container that shares an emptyDir volume with the main application and tails the log file to stdout.

    A sidecar container shares an emptyDir volume with the main application to read and stream logs to stdout. This decouples logging from the primary application and allows standard Kubernetes logging to capture the output. An init container cannot continuously run to stream logs.

  67. Question 67 of 597A mission-critical financial application Pod is consistently being terminated with an 'OOMKilled' status. You have observed that while the container usually stays under 256Mi of RAM, it occasionally spikes to 1Gi during daily reconciliation tasks. The namespace currently has a LimitRange that enforces a maximum memory limit of 512Mi for all containers. What is the most effective way to allow the Pod to handle these spikes while ensuring it doesn't consume all cluster resources?

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

    Show answer & explanation

    Correct answer: A. Update the Pod's container spec to set a memory 'limit' of 1Gi and ensure the namespace LimitRange is adjusted to allow this value.

    The container memory limit must be raised above the spike threshold to prevent the kernel from killing the process. Because a LimitRange enforces maximum values, it must also be updated to permit the new 1Gi limit. Increasing requests without limits does not prevent termination.

  68. Question 68 of 597Your organization is implementing strict security controls for a three-tier application consisting of a frontend, a backend, and a database. The security policy dictates that the 'backend' pods in the 'prod' namespace should only accept incoming traffic from 'frontend' pods on port 8080 and must be prohibited from communicating with any external internet resources. Which NetworkPolicy configuration must be applied to the 'backend' pods to enforce these specific constraints?

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

    Show answer & explanation

    Correct answer: B. Apply an Ingress policy allowing the frontend label and a separate Egress policy with an empty set of allowed destinations.

    Applying an Ingress rule with a podSelector for the frontend allows specific incoming traffic, while an empty Egress rule blocks all outgoing traffic. Using a CIDR block filter is imprecise for dynamic pod IPs, and HostPort bypasses standard network policy enforcement entirely.

  69. Question 69 of 597An enterprise application generates operational metrics in a proprietary XML format through a local Unix socket. The organization has standardized on Prometheus for monitoring, which requires metrics to be exposed via HTTP in a specific plain-text format. You are tasked with implementing a solution that allows the central monitoring system to scrape these metrics without modifying the legacy application code. The solution must ensure that the transformation logic is decoupled from the main application logic and runs within the same network namespace to access the local socket efficiently.

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

    Show answer & explanation

    Correct answer: B. Deploy an Adapter container within the same Pod that consumes the XML metrics and exposes them on a dedicated HTTP port for Prometheus

    An adapter container standardizes output by transforming proprietary application metrics into a format the monitoring system expects. Running in the same pod allows it to access the local socket efficiently. An ambassador container proxies traffic, while an init container cannot run continuously.

  70. Question 70 of 597Your team is preparing to deploy a mission-critical update to a financial API. The management requires a deployment strategy where the new version is fully deployed and tested in the production environment before any live traffic is switched. If the new version fails validation, the switch must be reverted instantly. Which approach best satisfies these constraints in a Kubernetes environment?

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

    Show answer & explanation

    Correct answer: B. Deploy a second Deployment for the new version and update the Service selector to point to the new version labels after successful validation.

    Deploying a second deployment and updating the service selector implements a blue-green strategy, providing instant traffic shifting and rollback. A rolling update gradually replaces old pods, meaning both versions receive live traffic simultaneously and rollback is not instantaneous.

  71. Question 71 of 597A security audit reveals that several Pods in the 'finance' namespace are running with root privileges, which violates the company's security policy. The developer must update the Deployment manifest to ensure that the container runs as a non-privileged user (UID 1000) and cannot escalate its privileges or access the host's sensitive files. Which section of the Pod specification should be modified to enforce these security constraints?

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

    Show answer & explanation

    Correct answer: B. Set the securityContext at the container level with runAsUser: 1000 and allowPrivilegeEscalation: false.

    Setting the container-level securityContext with runAsUser: 1000 and allowPrivilegeEscalation: false directly enforces the required non-root and non-escalating execution. RoleBindings and ResourceQuotas manage API access and resource limits, not the running container's process privileges.

  72. Question 72 of 597A specialized database container requires a specific configuration script to be executed immediately after the container process starts. This script registers the container's IP in a legacy registry system. The script must run within the same container environment as the database engine, but the database engine itself does not have a mechanism to trigger external scripts. Which Kubernetes feature should be used?

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

    Show answer & explanation

    Correct answer: B. A postStart lifecycle hook that executes the registration script once the container has been created.

    The postStart hook executes immediately after the container is created, making it perfect for registering the IP. An InitContainer is incorrect because it runs and terminates before the main container starts.

  73. Question 73 of 597Your company is deploying a complex web application architecture where different services need to be accessible via a single public IP address. The requirements specify that requests to 'api.company.com/v1' should be routed to the 'v1-service' on port 80, and requests to 'api.company.com/v2' should be routed to the 'v2-service' on port 8080. Both services are in the same namespace. Which Kubernetes resource is best suited to manage this traffic routing based on the URL path?

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

    Show answer & explanation

    Correct answer: A. An Ingress resource with rules defining a single host and multiple paths, each pointing to a different backend service

    An Ingress resource is the standard choice for Layer 7 load balancing, natively supporting path-based routing for splitting traffic between services. NetworkPolicies are incorrect because they manage IP-level firewall rules, not HTTP request routing.

  74. Question 74 of 597You are deploying a distributed database where each instance must be addressable individually by a stable DNS name to manage peer-to-peer synchronization. The instances manage their own replication and need to know the direct IP addresses of their peers. Standard Service load balancing is not desired because the application logic handles traffic distribution among the members.

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

    Show answer & explanation

    Correct answer: D. Create a Headless Service by setting the clusterIP field to None in the specification

    Setting clusterIP to None creates a Headless Service, which returns individual pod IP addresses via DNS instead of a single virtual IP. This enables direct peer-to-peer communication required by stateful applications. NodePort or Ingress add unwanted load balancing.

  75. Question 75 of 597A monolithic legacy application is being containerized and deployed into a production cluster. During its startup phase, the application performs a heavy checksum validation of its local data files, which typically takes 180 seconds to complete. The current LivenessProbe is configured to check the health endpoint every 10 seconds. However, because the application is fully occupied with the checksum process, it cannot respond to the probe, leading the Kubelet to restart the container repeatedly before it ever reaches a ready state. Which configuration should be implemented to resolve this cycle?

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

    Show answer & explanation

    Correct answer: A. Implement a StartupProbe with a failureThreshold of 30 and a periodSeconds of 10 to disable other probes during initialization

    A StartupProbe disables Liveness and Readiness probes until it succeeds, preventing slow containers from being killed by the Kubelet during initialization. Relying on initialDelaySeconds is brittle because exact startup times fluctuate under variable loads or hardware conditions.

  76. Question 76 of 597A financial data processing application uses a CronJob to run a reconciliation script every minute. The script typically completes in 45 seconds, but during peak hours, it can take up to 150 seconds. The operations team notices that multiple instances of the same Job are running simultaneously, causing race conditions and database locks that corrupt the reconciliation data. You need to ensure that if a new Job is scheduled while the previous one is still active, the new execution is skipped entirely to protect data integrity. Which configuration parameter in the CronJob spec will achieve this behavior?

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

    Show answer & explanation

    Correct answer: B. Set the concurrencyPolicy field to Forbid within the CronJob specification

    Setting concurrencyPolicy to Forbid tells the controller to skip creating new Jobs if an existing one is still running. The Replace policy kills the active Job, while changing history limits only cleans up old completed tasks without preventing overlaps.

  77. Question 77 of 597A web application experiences highly variable traffic patterns throughout the day. To ensure high availability and cost-efficiency, the operations team wants the number of running pods to automatically increase when the average CPU utilization across all pods exceeds 70%, and decrease when the load drops. The application is managed by a Deployment. Which Kubernetes component must be configured to enable this dynamic scaling behavior?

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

    Show answer & explanation

    Correct answer: A. A Horizontal Pod Autoscaler (HPA) targeting the Deployment with the specified CPU utilization threshold

    The Horizontal Pod Autoscaler automatically scales the number of Deployment replicas based on observed CPU utilization. The Cluster Autoscaler only adjusts the cluster node size, and the Vertical Pod Autoscaler modifies resource requests rather than replica counts.

  78. Question 78 of 597A production team is managing a high-traffic web service currently running on Deployment 'webapp-v1'. They need to perform a zero-downtime update to 'webapp-v2'. The requirement is to maintain 100% of the current capacity at all times during the update process to prevent performance degradation. However, the cluster has limited extra resources, so they can only afford to run 25% additional capacity during the transition. Which configuration of the RollingUpdate strategy in the Deployment manifest correctly addresses these infrastructure constraints and capacity requirements?

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

    Show answer & explanation

    Correct answer: B. Define maxUnavailable as 0% and maxSurge as 25% to ensure no capacity is lost while limiting the temporary resource overhead

    Setting maxUnavailable to 0 guarantees no existing pods are removed before new ones are ready. Pairing it with a 25% maxSurge strictly limits the temporary extra pods, satisfying the resource constraint while maintaining full application availability.

  79. Question 79 of 597Your development team has provided a ConfigMap named 'app-config' that contains over 40 individual environment variables required by a microservice. Instead of mapping each variable individually in the Deployment manifest using the 'valueFrom' field, you want to inject all the keys in the ConfigMap as environment variables into the container automatically. This approach should ensure that any new keys added to the ConfigMap in the future are automatically included in the next Pod deployment without manifest changes. Which field in the container spec allows this bulk injection?

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

    Show answer & explanation

    Correct answer: C. Use the envFrom field and reference the ConfigMap using the configMapRef attribute

    The envFrom field automatically imports all key-value pairs from a ConfigMap as container environment variables. This avoids listing each variable individually with valueFrom and ensures future ConfigMap additions are automatically consumed by the container.

  80. Question 80 of 597A financial reconciliation task is scheduled to run every 5 minutes using a Kubernetes CronJob. Due to occasional high data volumes, the task sometimes takes 7 or 8 minutes to complete. The business requirement states that if a previous execution is still running when the next scheduled interval arrives, the new execution must not start, to avoid data corruption and resource contention. Which setting in the CronJob specification ensures this behavior is strictly enforced by the controller?

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

    Show answer & explanation

    Correct answer: A. Configure concurrencyPolicy to 'Forbid' to prevent the controller from creating a new Job if the previous one has not finished

    The Forbid policy explicitly tells the CronJob controller to skip creating a new Job if an existing one is still running. Replace terminates the current Job, and backoffLimit only dictates retry behavior for failed tasks rather than concurrency rules.

  81. Question 81 of 597A security policy requires that the 'frontend' pods in the 'production' namespace must only be allowed to communicate with 'backend' pods on port 8080. All other outgoing traffic from the 'frontend' pods, including traffic to external internet addresses or other internal pods, must be blocked. Which NetworkPolicy configuration achieves this requirement?

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

    Show answer & explanation

    Correct answer: A. Create an Egress policy for 'frontend' pods with a 'to' rule selecting 'backend' pods and a 'ports' rule for 8080.

    An Egress policy applied to the frontend pods explicitly restricts outgoing traffic to only the specified backend on port 8080. An Ingress policy on the backend fails this requirement because it does not block the frontend from sending traffic to external addresses.

  82. Question 82 of 597A healthcare technology company is deploying a HIPAA-compliant web service in a Kubernetes cluster. The application, named 'portal-app', must be accessible over HTTPS using the domain 'portal.healthcare.com'. The infrastructure team has provided a TLS certificate and a private key stored in a Kubernetes Secret named 'portal-tls-secret' within the 'production' namespace. To meet compliance standards, you need to configure an Ingress resource that terminates TLS using this specific secret and routes incoming traffic from 'portal.healthcare.com' to a service named 'portal-svc' on port 8080. You must ensure the Ingress is configured according to the 'networking.k8s.io/v1' API standards. Which configuration snippet correctly defines the Ingress resource to meet these requirements?

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

    Show answer & explanation

    Correct answer: D. Define the 'tls' field with 'hosts' containing 'portal.healthcare.com' and 'secretName' set to 'portal-tls-secret', while setting the 'rules' to forward traffic to 'portal-svc' on port 8080.

    The tls block in the Ingress specification correctly associates the TLS secret with the host, while the rules block maps the host to the backend service port. ConfigMaps cannot store TLS keys, and annotations alone fail to configure secure routing properly.

  83. Question 83 of 597You are performing a canary release for a new version of a stateless web service. The current version is running in a Deployment named 'webapp-v1' with 9 replicas. You have created a new Deployment named 'webapp-v2' with 1 replica. Both deployments share the same label 'app: webapp-service'. A single Service is configured with the selector 'app: webapp-service'. How will Kubernetes distribute incoming traffic to these pods?

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

    Show answer & explanation

    Correct answer: A. Traffic will be distributed randomly among all 10 available pods, resulting in approximately 10% of traffic reaching the new 'webapp-v2' version.

    The Service load balances randomly across all matching pods, sending roughly 10% of traffic to the new version. Kubernetes does not understand version labels natively, so it treats all matching pods as identical endpoints rather than isolating deployments.

  84. Question 84 of 597A developer wants to deploy a container that needs to capture network packets for debugging purposes within a specific namespace. For security reasons, you must grant the minimum necessary Linux capabilities rather than running the container in privileged mode. Which configuration in the Pod's securityContext will allow the container to perform packet capture while maintaining security?

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

    Show answer & explanation

    Correct answer: C. Add the NET_RAW capability to the capabilities list in the security context

    The NET_RAW capability allows processes to use raw and packet sockets, which tools like tcpdump need for capturing traffic without full host access. Setting privileged to true violates the least-privilege principle, and root permissions do not directly grant specific capabilities securely.

  85. Question 85 of 597You are tasked with deploying a new version of a stateless web application. The business requirement is to ensure that the transition happens with zero downtime. During the update, the cluster should always have at least the current number of desired replicas running, and it is acceptable to temporarily exceed the desired replica count to speed up the rollout. Which strategy and parameters should be configured in the Deployment manifest to satisfy these constraints?

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

    Show answer & explanation

    Correct answer: C. Set the strategy type to RollingUpdate with maxUnavailable set to 0 and maxSurge set to 25%.

    Setting maxUnavailable to 0 ensures no pods are removed until new ones are ready, maintaining full capacity. Setting maxSurge allows the deployment to create additional pods during the update, fulfilling the requirement to speed up the rollout.

  86. Question 86 of 597Your organization has a strict security policy requiring that all containers in the 'payment-gateway' namespace run as non-root users. You are deploying a new microservice that needs to run with the specific user ID 2000 and group ID 3000. These settings must be enforced for all containers within the Pod. Where should you define these requirements in the manifest?

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

    Show answer & explanation

    Correct answer: A. Apply the runAsUser and runAsGroup settings within the securityContext section at the Pod level of the manifest.

    Defining runAsUser and runAsGroup in the pod-level securityContext ensures all containers inherit these exact execution permissions. Applying settings at the container level only affects one container, and service accounts handle API authentication.

  87. Question 87 of 597A developer needs to deploy an Nginx container that uses a custom 'nginx.conf' file stored in a ConfigMap named 'web-config'. The Nginx image stores its default configuration files in the '/etc/nginx' directory. If the developer mounts the ConfigMap directly to '/etc/nginx', all existing files in that directory (like mime.types) will be hidden. The requirement is to inject only the 'nginx.conf' file into the existing '/etc/nginx' directory without losing the other files provided by the container image.

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

    Show answer & explanation

    Correct answer: C. Use the 'subPath' field in the volumeMounts section to mount only the specific 'nginx.conf' key from the volume into the full file path

    Using the subPath field in volumeMounts injects a single ConfigMap file into an existing directory without overwriting neighbors. Without subPath, the entire directory is masked by the mounted volume, breaking the container.

  88. Question 88 of 597You are deploying an Ingress resource to manage traffic for a multi-tenant platform. The platform hosts two separate services: 'billing.example.com' and 'support.example.com'. The billing service requires HTTPS and uses a TLS certificate stored in a Secret named 'billing-tls-cert'. The support service currently only requires HTTP. How should the Ingress manifest be structured to provide TLS for the billing host only while routing traffic to both services correctly?

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

    Show answer & explanation

    Correct answer: D. Define a single Ingress with a 'tls' block where the 'hosts' list only includes 'billing.example.com' and the 'secretName' is 'billing-tls-cert'.

    Creating a single Ingress with a TLS block for the billing host correctly restricts HTTPS to that domain. However, creating two separate Ingress resources is also valid, making the options ambiguous.

  89. Question 89 of 597An organization hosts two separate web services: 'shop.example.com' and 'blog.example.com'. Both services are running in the same Kubernetes cluster. You need to configure a single entry point that routes traffic to the correct service based on the Host header in the HTTP request and handles SSL termination at the entry point.

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

    Show answer & explanation

    Correct answer: B. Implement an Ingress resource with rules defined for each host pointing to their services

    An Ingress resource manages external access to services, providing Layer 7 routing and TLS termination. Services lack host-based routing, making Ingress the only option for HTTP host rules.

  90. Question 90 of 597An enterprise microservice is being migrated to a Kubernetes cluster. The application was originally designed to connect to a local database on a specific port. Due to architectural constraints, the application cannot be modified to handle complex connection logic or service discovery for the external sharded database it now needs to access. You decide to implement a specialized container within the same Pod that acts as a local proxy, intercepting the application's requests and routing them to the appropriate database shard. Which architectural pattern are you implementing to solve this connectivity requirement?

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

    Show answer & explanation

    Correct answer: B. Deploying an Ambassador container to proxy the database connections

    The Ambassador pattern deploys a proxy container to handle outbound traffic on behalf of the main application. This abstracts complex service discovery or sharding logic away from the application code.

  91. Question 91 of 597An enterprise is hosting multiple web services under the same domain but different subpaths: '/api' routes to the 'api-service' and '/static' routes to the 'content-service'. They need to implement an Ingress resource that handles this routing and also terminates SSL/TLS using a certificate stored in a Secret named 'tls-secret'. How should the Ingress rules be structured to achieve this path-based routing securely?

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

    Show answer & explanation

    Correct answer: A. Define a single host with multiple paths in the 'rules' section and specify the 'tls' section referencing the 'tls-secret'.

    A single Ingress resource can define multiple paths under a specific host block and configure TLS termination. Using NodePort or separate Ingress resources lacks native path mapping and unified TLS management.

  92. Question 92 of 597Startup Probes for Legacy Apps. A legacy Java application takes a significant amount of time to initialize, often between 3 and 5 minutes, due to heavy JVM startup and database schema validations. During this period, the application does not respond to any traffic. The operations team has noticed that the Liveness probe often fails during this startup phase, causing the container to restart in an infinite loop. They need a solution that prevents the Liveness and Readiness probes from interfering until the application is fully initialized, without increasing the failure thresholds of those probes permanently.

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

    Show answer & explanation

    Correct answer: C. Implement a Startup probe with a failureThreshold of 30 and a periodSeconds of 10 to protect the container during its initial boot

    A Startup probe specifically disables Liveness and Readiness checks until it succeeds, accommodating slow-starting applications. Modifying initialDelaySeconds forces rigid timing limits that cannot adapt.

  93. Question 93 of 597Egress Network Policies. An application Pod named 'data-fetcher' in the 'processing' namespace needs to communicate with an external API service located at the static IP address 203.0.113.10. For compliance reasons, the security team has requested a NetworkPolicy that blocks all outgoing traffic from this Pod to any other internal or external destination, except for this specific API IP and the internal DNS service (kube-dns) on port 53. Which NetworkPolicy configuration correctly implements this restrictive egress rule?

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

    Show answer & explanation

    Correct answer: D. An Egress policy with two rules: one with an ipBlock allowing 203.0.113.10/32, and another allowing UDP/TCP port 53 to the kube-system namespace

    Defining an Egress policy triggers default-deny behavior for all unspecified outbound traffic. You must explicitly allow an ipBlock for the external API and a namespace selector for DNS resolution.

  94. Question 94 of 597An application Pod in the 'security-tools' namespace needs to interact with the Kubernetes API to list other Pods and their IP addresses for a network mapping utility. By default, the Pod is using the 'default' ServiceAccount, which does not have the necessary permissions to query the API. You have already created a Role and a RoleBinding that grant the 'list' permission on Pod resources. What is the final step required in the Pod manifest to ensure the application can successfully authenticate and use these permissions?

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

    Show answer & explanation

    Correct answer: D. Specify the custom 'serviceAccountName' in the Pod's spec section

    A Pod inherits permissions based on its explicitly assigned serviceAccountName, mounting the correct API token. Without mapping the specific ServiceAccount, the default restricted permissions remain active.

  95. Question 95 of 597An analytics team needs to run a data processing task that takes several hours to complete. The task consists of 10 independent units of work. To optimize time, they want to process 3 units simultaneously. The task must be resilient; if a specific unit fails, it should be retried until it succeeds. Which Kubernetes object and configuration parameters should be used to manage this batch processing requirement?

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

    Show answer & explanation

    Correct answer: D. A Job with completions: 10 and parallelism: 3 to ensure sequential completion with a set amount of concurrent workers.

    A Kubernetes Job is designed for finite tasks and automatically retries failed pods until they succeed. Setting parallelism limits concurrent workers, optimizing resource usage while completions tracks the total required successes. CronJobs are for scheduled recurring tasks.

  96. Question 96 of 597A data processing task must run to completion exactly once for each data set provided. If the pod performing the task fails due to a node crash, Kubernetes must ensure a new pod is scheduled to complete the remaining work. The task is not continuous and should stop once the processing logic returns a success code.

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

    Show answer & explanation

    Correct answer: A. Deploy a Job with a restartPolicy set to OnFailure to ensure task completion

    A Job handles run-to-completion workloads. Setting restartPolicy: OnFailure guarantees that Kubernetes retries the container exactly until it succeeds. A Deployment or DaemonSet is incorrect because they manage continuous, long-running processes.

  97. Question 97 of 597You are managing a production deployment of a web application that frequently experiences internal deadlocks. When a deadlock occurs, the main process continues to run, so the container remains in a 'Running' state, but the application stops responding to all incoming requests. To ensure high availability, you need to configure a mechanism that automatically detects this non-responsive state and restarts the faulty container. Which Kubernetes probe configuration should you implement to address this specific failure mode?

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

    Show answer & explanation

    Correct answer: A. Define a LivenessProbe with an HTTP GET action targeting a health check endpoint that verifies internal application logic.

    A LivenessProbe with an HTTP GET action checks application health and restarts the container upon failure. TCP socket checks only verify network listening, failing to detect internal application deadlocks.

  98. Question 98 of 597Sidecar for Metrics Transformation. You are deploying a microservice that exposes raw performance data via a local text file updated every 30 seconds. You need to use a sidecar container to read this file and provide an HTTP endpoint that a central monitoring tool can query. The two containers must share a common storage area to exchange the file. Which volume type is most appropriate for this high-frequency, transient data exchange between two containers within the same Pod?

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

    Show answer & explanation

    Correct answer: A. An emptyDir volume mounted at the same path in both containers to provide a shared, temporary filesystem in memory or on disk

    An emptyDir volume provides shared, temporary storage accessible by all containers within a single Pod. Persistent volumes are unnecessary for transient data, and ConfigMaps are strictly read-only.

  99. Question 99 of 597A legacy internal application only supports HTTP communication, but the security team mandates HTTPS for all traffic entering the pod. The development team decides to use an Nginx sidecar container to handle SSL/TLS termination so the application code remains unchanged. The sidecar needs to listen on port 443 and proxy traffic to the application on port 8080. Which configuration detail is essential for this sidecar pattern to function correctly within the same Pod?

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

    Show answer & explanation

    Correct answer: A. Configure the Nginx sidecar and application container to share the same Network namespace using localhost for communication.

    Containers within the same Pod inherently share the same Network namespace, enabling them to communicate via localhost. The proxy sidecar listens on external ports while forwarding traffic to localhost.

  100. Question 100 of 597A development team is struggling with a Pod containing two containers: an 'app-container' and a 'helper-container'. The 'helper-container' crashes frequently during the first 10 seconds of startup due to a configuration error. When the team tries to view the logs using 'kubectl logs helper-container', they only see logs from the newly restarted instance which doesn't show the initial error. What command should be used to inspect the logs of the instance that crashed immediately prior to the current one?

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

    Show answer & explanation

    Correct answer: A. Run 'kubectl logs pod-name -c helper-container –previous' to retrieve the logs from the last terminated container instance.

    The –previous flag retrieves logs from the last terminated instance of a container, essential for debugging crash loops. Events and current logs rarely capture the exact application failure trace.

  101. Question 101 of 597A security-focused financial microservice named audit-logger is being deployed into a hardened Kubernetes namespace. During a recent internal security assessment, the compliance team discovered that the application Pods are automatically mounting the default ServiceAccount credentials at the path /var/run/secrets/kubernetes.io/serviceaccount. Since the audit-logger microservice does not need to interact with the Kubernetes API, this configuration poses an unnecessary security risk of credential leakage if the container is ever compromised. You are tasked with ensuring that no API token is automatically projected into the Pods of this specific deployment while maintaining the standard deployment configuration for other services in the same namespace. Which configuration change is required in the Deployment manifest to meet this security requirement?

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

    Show answer & explanation

    Correct answer: C. Set the automountServiceAccountToken field to false within the spec.template.spec section of the Deployment manifest.

    Setting automountServiceAccountToken to false within the Pod template spec prevents Kubernetes from injecting the default API token. Overwriting the mount path with an emptyDir is a hacky workaround, whereas the native boolean field is the intended security control.

  102. Question 102 of 597Your main application container generates metrics in a proprietary binary format and writes them to a shared volume at /data/logs/metrics.bin. The company's monitoring system requires these metrics to be available in a Prometheus-compatible text format at a specific /metrics endpoint via HTTP. You need to deploy a solution that performs this conversion in real-time within the same Pod. Which multi-container pattern is most appropriate?

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

    Show answer & explanation

    Correct answer: A. The Adapter pattern, where a second container transforms the output of the main container into a standardized format for external systems

    The Adapter pattern transforms the main container output into a standardized format for external monitoring systems to consume. A generic sidecar merely adds features, while an Ambassador strictly proxies external network traffic.

  103. Question 103 of 597You need to run a high-volume data migration task that involves processing 500 independent datasets. The task is encapsulated in a container image that processes one dataset and then exits. To complete the migration quickly, you want to ensure that 10 containers are running in parallel at any given time until all 500 datasets are processed. If a container fails, the system should attempt to retry it, but the whole task should stop if there are more than 5 total failures.

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

    Show answer & explanation

    Correct answer: B. Create a Job with 'completions: 500', 'parallelism: 10', and 'backoffLimit: 5' to manage the execution and retries.

    A Kubernetes Job uses completions to target successful exits and parallelism to control concurrency. The backoffLimit halts the entire workload after the specified failure count, which Deployments cannot do natively.

  104. Question 104 of 597A containerized Node.js application takes a significant amount of time to load its initial configuration and cache into memory, typically between 45 and 60 seconds. If the container is checked for health during this period, it fails the check and is restarted by Kubernetes, leading to an infinite loop of restarts. You need to ensure the container is not killed during its long startup phase while still allowing it to be restarted if it deadlocks later. What is the most efficient configuration?

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

    Show answer & explanation

    Correct answer: B. Implement a startupProbe with a failureThreshold of 30 and a periodSeconds of 5 to allow up to 150 seconds for initialization

    A startup probe disables liveness and readiness checks until it succeeds, providing a dedicated window for initialization without affecting long-term monitoring.

  105. Question 105 of 597You are managing a secure web API container that requires custom authentication headers for its health check endpoint. The liveness probe must target the '/healthz' path on port 8443 and include a header named 'X-Internal-Token' with a value retrieved from a Secret. If the probe does not receive a 200 OK response with the correct header, the container should be restarted. How should the livenessProbe be configured in the YAML manifest?

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

    Show answer & explanation

    Correct answer: D. Use an httpGet probe with the path, port, and an httpHeaders array containing the name and value of the token.

    An httpGet probe natively supports custom HTTP headers, allowing you to pass authentication tokens directly during health checks. While an exec probe using curl could technically work, it introduces unnecessary operational overhead and relies on external binaries inside the container image.

  106. Question 106 of 597You are updating a critical 'api-gateway' deployment which currently has 10 replicas. To maintain high availability during the update, the business requires that at least 8 replicas remain available at all times. Additionally, to avoid overloading the underlying nodes, no more than 13 replicas should exist in total at any point during the rollout. How should the 'strategy' section of the Deployment be configured?

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

    Show answer & explanation

    Correct answer: C. Set maxUnavailable to 2 and maxSurge to 3 within the RollingUpdate strategy block of the Deployment manifest.

    Setting maxUnavailable to 2 ensures at least 8 pods remain available during the rollout. Setting maxSurge to 3 guarantees that the total number of pods never exceeds 13, satisfying both high availability and resource constraints.

  107. Question 107 of 597A developer is reporting that their application keeps restarting because the internal cache takes 2 minutes to populate. Currently, the Pod is marked as unhealthy by the liveness probe after 30 seconds, triggering a container kill and restart cycle. You need to ensure the application isn't killed while it's still initializing, but also remains unavailable for traffic until the cache is fully ready.

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

    Show answer & explanation

    Correct answer: C. Configure a startupProbe with a long failureThreshold and a readinessProbe for traffic control

    A startupProbe protects slow-starting applications by disabling liveness checks until initialization completes. Coupling it with a readinessProbe ensures the application receives traffic only when fully prepared, preventing premature container restarts.

  108. Question 108 of 597You need to process a queue of 50 work items using a Kubernetes Job. To speed up the process, you want to ensure that exactly 5 Pods are running at any given time until all 50 items are processed successfully. If a Pod fails, it should be replaced, and the Job should only be considered complete once 50 successful completions are recorded.

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

    Show answer & explanation

    Correct answer: D. Set completions to 50 and parallelism to 5 within the Job's spec section

    The Kubernetes Job controller natively handles parallel batch processing using the completions and parallelism fields. Setting parallelism to 5 maintains the desired workload concurrency until 50 successful completions are recorded.

  109. Question 109 of 597In a shared development cluster, several teams are deploying applications into the 'sandbox' namespace. Occasionally, a poorly configured application consumes all the available memory on a node, causing the Kubelet to evict critical pods from other teams. You need to implement a policy that ensures every container in the 'sandbox' namespace has a memory limit of 512Mi even if the developer does not specify one in their Pod manifest.

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

    Show answer & explanation

    Correct answer: C. Create a LimitRange object in the 'sandbox' namespace and specify the 'default' memory limit for containers.

    A LimitRange is the correct Kubernetes mechanism to enforce default resource limits at the container level. While a ResourceQuota restricts total namespace consumption, it does not automatically inject missing memory limits into individual pod manifests.

  110. Question 110 of 597An engineer is investigating an 'auth-service' deployment stuck in 'CreateContainerConfigError'. The pod is configured to mount a secret named 'api-credentials' as a volume. The engineer suspects the secret might be missing or incorrectly named. What is the most effective command to verify the exact reason for the failure and the state of the secret dependency?

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

    Show answer & explanation

    Correct answer: C. Run 'kubectl describe pod [pod-name]' and check the Events section for mount failures

    The kubectl describe pod command outputs a detailed Events section that explicitly states why a container failed to start. You can quickly spot volume mount errors or missing secret dependencies there without needing application logs.

  111. Question 111 of 597A retail application experiences sudden spikes in traffic during holiday sales. You want to implement an automatic scaling mechanism that increases the number of replicas when the average CPU utilization across all pods in the 'orders' deployment exceeds 70%. You also want to ensure that the scaling doesn't happen too rapidly to avoid 'flapping' during minor fluctuations. Which Kubernetes resource should be configured to manage this behavior?

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

    Show answer & explanation

    Correct answer: C. Create a HorizontalPodAutoscaler (HPA) targeting the 'orders' deployment with a targetAverageUtilization of 70 and appropriate stabilization windows.

    A HorizontalPodAutoscaler automatically scales the number of pods based on observed CPU utilization. Configuring its behavior field with stabilization windows prevents rapid scaling actions, effectively avoiding flapping during minor metric fluctuations.

  112. Question 112 of 597A web application needs to connect to an external database that requires a complex custom authentication protocol and local caching of query results. To keep the main application code simple and clean, you decide to use a multi-container pod pattern where a secondary container handles the authentication and caching, presenting a simple localhost interface to the main application. Which multi-container pattern is being described here?

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

    Show answer & explanation

    Correct answer: C. The Ambassador pattern, which acts as a proxy to represent an external service as if it were a local service.

    The Ambassador pattern acts as a dedicated proxy to simplify communication with complex external services. The main application connects to this helper container on localhost, entirely abstracting away the custom authentication and caching logic.

  113. Question 113 of 597A web application requires a sensitive database password and a TLS certificate to initialize correctly. These credentials are stored in Kubernetes Secrets named db-pass and site-tls. For security and architectural reasons, the password must be injected as an environment variable called DB_PASSWORD, while the certificate files must be accessible to the application as files in the /etc/tls directory. Which configuration strategy should be implemented?

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

    Show answer & explanation

    Correct answer: C. Use secretKeyRef to map the password to an environment variable and define a volume of type secret to mount at /etc/tls

    Using secretKeyRef maps a specific secret key directly into an environment variable for the container. Mounting a secret volume separately exposes the certificate files securely into the specified directory without hardcoding sensitive data.

  114. Question 114 of 597Your company is running a mission-critical web application on Kubernetes. During updates, you must ensure that the application never drops below 100% of its desired replica count to handle peak traffic. At the same time, the cluster has limited resource overhead, so you cannot have more than 2 extra Pods running at any given time during the rollout of a new version. You need to configure the 'strategy' field of the Deployment.

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

    Show answer & explanation

    Correct answer: C. Configure a RollingUpdate with maxSurge set to 2 and maxUnavailable set to 0 to maintain full capacity during the update.

    Setting maxUnavailable to 0 maintains full capacity, while maxSurge to 2 strictly limits extra pods. Allowing unavailable pods is the strongest distractor, but it breaks the required capacity rule.

  115. Question 115 of 597You are troubleshooting a legacy Java application deployed in the 'production' namespace. The application occasionally enters a 'zombie' state where the process is still running, but the internal HTTP server stops responding to requests due to a localized deadlock. When this happens, the container does not crash, but the application becomes useless. To automate recovery, you decide to implement a probe. The application exposes a health check endpoint at '/healthz' on port 8080. Which probe configuration is most appropriate to ensure the container is automatically restarted when it enters this specific failed state?

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

    Show answer & explanation

    Correct answer: D. Define a Liveness Probe using an httpGet request to port 8080 on the /healthz path.

    A liveness probe using HTTP GET accurately restarts containers stuck in deadlock states. A readiness probe is the strongest distractor, but it merely stops traffic instead of restarting.

  116. Question 116 of 597A development team is deploying a Node.js microservice that requires a specific database schema to be present in an external PostgreSQL instance. To ensure the application does not start with an incompatible schema, a migration script must be executed successfully before the main application container begins its execution. If the migration script fails, the entire Pod must stop its startup process and report the failure. Which Kubernetes feature is best suited for this requirement?

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

    Show answer & explanation

    Correct answer: B. Utilize an initContainer in the Pod spec to run the database migration script before the main container

    An initContainer runs to completion before the main container, blocking startup if it fails. A sidecar is the strongest distractor, but it runs concurrently instead of sequentially.

  117. Question 117 of 597A data analysis team uses a CronJob to run a heavy reconciliation script every hour. Recently, they noticed that if a job takes longer than 60 minutes, a second job starts while the first is still running, leading to database lock contention and corrupted reports. You must ensure that no new job is started if a previous instance is still active, and any missed executions should be ignored.

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

    Show answer & explanation

    Correct answer: A. Set the concurrencyPolicy to Forbid in the CronJob specification to prevent overlapping executions.

    Setting concurrencyPolicy to Forbid correctly prevents overlapping jobs from running simultaneously. Changing schedule frequency is the strongest distractor, but it fails under delays.

  118. Question 118 of 597A legacy binary is running in a pod and writes its logs to a local file at /var/log/app.log. The cluster's logging infrastructure only collects logs from the standard output (stdout) and standard error (stderr) streams of the containers. You need to ensure these file-based logs are captured by the cluster logging agent without modifying the legacy application code. What is the standard Kubernetes pattern to achieve this?

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

    Show answer & explanation

    Correct answer: B. Add a sidecar container to the Pod that runs a tail -f command on the log file, sharing the log directory via an emptyDir volume.

    Adding a sidecar container that streams the log file to stdout makes the logs visible to standard Kubernetes logging tools. Do not use hostPath or persistent volumes, as they bypass container stdout and are not collected by node-level logging agents.

  119. Question 119 of 597You have a ConfigMap named 'global-settings' that contains 50 different configuration keys. You need to deploy a specific Pod that only requires one of these keys, named 'proxy-config.json'. This file must be mounted at the path '/etc/app/proxy-config.json' inside the container. Crucially, other files already existing in the '/etc/app/' directory of the container image must not be hidden or overwritten by the mount. How should this be configured?

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

    Show answer & explanation

    Correct answer: C. Use the 'volumes.configMap.items' field to select the key and 'volumeMounts.subPath' to mount only that file.

    Using the volumeMounts subPath property mounts a single file from a ConfigMap without obscuring existing application files. Mounting a ConfigMap directly to the directory masks the entire folder, which would break the container image defaults.

  120. Question 120 of 597A database application running in your cluster is running out of disk space on its mounted volume. The underlying StorageClass supports dynamic volume expansion (allowVolumeExpansion: true). You need to increase the available storage for this specific application without deleting the existing PersistentVolumeClaim or losing the data currently stored on the volume.

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

    Show answer & explanation

    Correct answer: C. Edit the existing PersistentVolumeClaim and increase the storage value in the resources.requests section

    Increasing the requested storage value on an existing PersistentVolumeClaim triggers dynamic volume expansion if the StorageClass permits it. Deleting the PVC would destroy the data, while manual resizing bypasses Kubernetes reconciliation.

  121. Question 121 of 597You are deploying a microservice named 'report-generator' that depends on a database. Before the 'report-generator' container starts, it must verify that the database schema is at the correct version. If the schema is outdated, a migration script must be executed. You want to ensure that the main application container only starts if the migration script completes successfully, and you want to keep the migration logic separate from the application code.

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

    Show answer & explanation

    Correct answer: C. Utilize an Init Container to run the database migration script, ensuring the Pod waits for its successful completion before starting the main container.

    Init containers run to completion before the main application container starts, blocking startup until the migration succeeds. Jobs lack this strict lifecycle coupling, and readiness probes incorrectly handle initialization tasks instead of traffic routing.

  122. Question 122 of 597A microservices architecture consists of a 'frontend' deployment and a 'backend' deployment in the same 'app-prod' namespace. For security compliance, the organization requires that the 'backend' pods must only accept incoming traffic from the 'frontend' pods on port 9000. All other traffic from within the cluster or from other pods in the same namespace should be blocked. Which Kubernetes resource must be created to enforce this specific network isolation?

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

    Show answer & explanation

    Correct answer: D. A NetworkPolicy with an ingress rule allowing traffic from pods labeled 'app: frontend' on port 9000.

    NetworkPolicy resources use label selectors to define precise ingress and egress rules for pod communication. Ingress and Service resources lack native layer three or four firewall capabilities needed for this internal namespace isolation.

  123. Question 123 of 597A financial services company is managing a high-availability API currently running 20 replicas of version 'v1' through a Deployment named 'payment-api'. To maintain strict performance Service Level Agreements (SLAs), the operations team must ensure that at least 15 replicas are always operational during any update process. Simultaneously, to avoid overloading the underlying node resources, no more than 25 total replicas should ever exist at any given time during the rollout. Which strategy configuration should be applied to the Deployment manifest to meet these constraints?

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

    Show answer & explanation

    Correct answer: B. Set the RollingUpdate strategy with maxSurge: 5 and maxUnavailable: 5.

    Configuring maxSurge and maxUnavailable to absolute integers safely dictates the exact replica counts allowed during rollouts. Using percentage values is risky here because fractional rounds up, violating the strict minimum availability constraint.

  124. Question 124 of 597A legacy HR application only supports unencrypted HTTP traffic. However, the organization's security mandate requires all data in transit to be encrypted using TLS. To comply without modifying the legacy application code, you decide to deploy a sidecar container running 'stunnel' or Nginx to handle SSL termination. The sidecar will listen for HTTPS traffic on port 443 and proxy it to the legacy app on port 8080 over localhost. What is a critical requirement for this pattern to work?

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

    Show answer & explanation

    Correct answer: C. Both containers must share the same network namespace and communicate over the 127.0.0.1 loopback address.

    Containers within the same pod inherently share the exact same network namespace and loopback interface. This localhost communication is required for the proxy to forward traffic internally without complex routing configurations or host ports.

  125. Question 125 of 597A sophisticated data analytics application requires a warm-up period after the container starts to load 5GB of reference data into local memory. During this warm-up phase, which lasts about 3 minutes, the application is technically 'running' and passing process checks, but it cannot yet process incoming API requests. If traffic is sent prematurely, the application will return 503 errors and potentially crash due to resource contention. You need to configure the Pod to ensure it does not receive traffic until the memory load is complete.

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

    Show answer & explanation

    Correct answer: C. Implement a Readiness Probe that checks a specific health endpoint which only returns a 200 OK status once the data is fully loaded into memory.

    A readiness probe controls traffic routing by removing unready pods from service endpoints until the endpoint succeeds. Liveness probes only manage container restarts and do not prevent premature traffic delivery during initialization.

  126. Question 126 of 597A custom Python application is running in a pod and occasionally becomes unresponsive due to internal thread deadlocks. While the process remains running (the PID exists), it stops processing requests. You have a script at /app/health_check.py that returns an exit code of 0 if the app is healthy and non-zero otherwise. How should you configure the pod to automatically restart when the deadlock occurs?

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

    Show answer & explanation

    Correct answer: D. Set up a LivenessProbe with an 'exec' action that runs 'python /app/health_check.py' to trigger a container restart upon failure.

    A liveness probe using an exec action runs the diagnostic script and restarts the container if it returns a non-zero exit code. Readiness probes only remove the pod from service endpoints without triggering the required self-healing restart.

  127. Question 127 of 597A mission-critical transaction processing application is running in the finance-prod namespace. During peak hours, several Pods of this application are being terminated by the Linux Out-of-Memory (OOM) killer, even though the total cluster memory appears sufficient. Upon investigation, you discover that several BestEffort and Burstable Pods from a testing namespace on the same nodes are consuming excess memory. To ensure the finance-prod Pods have the highest priority and are the last to be killed in case of resource contention, you must modify their resource specifications to change their Quality of Service (QoS) class. What is the most effective configuration to achieve this goal?

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

    Show answer & explanation

    Correct answer: A. Set the memory requests and limits to the exact same value for all containers within the Pod to achieve a Guaranteed Quality of Service class.

    Matching memory requests and limits exactly grants the Guaranteed Quality of Service class, protecting pods from system OOM kills longer. PriorityClasses manage scheduling and eviction but do not change the Quality of Service during memory pressure.

  128. Question 128 of 597You are managing a payment-processing pod that must communicate with an internal database pod named db-prod on port 5432. For security compliance, you must ensure that the payment-processing pod cannot initiate any other outbound connections to the internet or other pods in the cluster, except for DNS resolution on port 53. Which NetworkPolicy configuration strategy achieves this level of isolation?

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

    Show answer & explanation

    Correct answer: A. Define an Egress NetworkPolicy with two rules: one targeting pods with the db-prod label on port 5432, and another allowing port 53 for DNS.

    An egress NetworkPolicy isolates outbound traffic by strictly defining allowed destinations, implicitly denying everything else. Option B fails because it configures ingress on the database rather than restricting the source pod's outbound connections.

  129. Question 129 of 597You are exposing a backend application through a ClusterIP Service. The application container is listening on port 8443 (HTTPS), but the frontend developers expect to reach the service at backend-service on port 443. You need to configure the Service manifest so that traffic arriving on the standard HTTPS port is correctly routed to the application's internal port.

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

    Show answer & explanation

    Correct answer: A. Set the service port to 443 and the targetPort to 8443 within the Service spec ports array

    Mapping the service port to 443 and the targetPort to 8443 handles the translation between the exposed cluster port and the container port. Option C is wrong because the container port must match where the application is actually listening.

  130. Question 130 of 597You are managing a Deployment named 'catalog-service' which is currently running 10 replicas. You need to perform a rolling update to a new image version. The service is under heavy load, so you must ensure that at least 8 replicas are always available to handle traffic during the update. At the same time, the cluster has tight resource constraints, so you cannot exceed a total of 12 pods (including both old and new versions) at any point during the rollout.

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

    Show answer & explanation

    Correct answer: D. Define a RollingUpdate strategy where maxUnavailable is set to 2 and maxSurge is set to 2 to meet both capacity and resource constraints.

    Setting maxUnavailable to 2 ensures at least 8 replicas stay available, and maxSurge to 2 limits the maximum total pods to 12. Option A violates the resource constraint by allowing up to 13 total pods during the rollout.

  131. Question 131 of 597A mission-critical financial application requires a specific configuration file to be dynamically generated and verified before the main container starts. The verification script checks for the presence of a security certificate and validates the file structure. If the verification fails, the pod should not enter the Running state, and the main application container should not attempt to start to prevent potential security breaches. How should this pre-start validation logic be implemented in the Pod specification?

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

    Show answer & explanation

    Correct answer: B. Define an initContainer that runs the verification script and shares a volume with the main application container.

    An init container runs to completion before the main application container starts, blocking startup if validation fails. Option D is incorrect because a postStart hook executes concurrently with the main process, failing to prevent startup.

  132. Question 132 of 597A specific project team in your organization has been consuming excessive CPU resources, causing other teams' workloads to stay in a Pending state. You are tasked with enforcing a strict limit of 4 CPU cores and 8Gi of memory for all Pods combined within the research-lab namespace. You need to ensure that no new Pods can be created if they exceed these cumulative limits.

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

    Show answer & explanation

    Correct answer: A. Create a ResourceQuota object in the research-lab namespace defining hard limits for requests.cpu and requests.memory

    A ResourceQuota sets hard limits on total aggregate resource consumption across all pods within a namespace. Option C fails because LimitRange objects enforce constraints on individual containers rather than namespace-wide totals.

  133. Question 133 of 597A security audit requires all Pods in the 'finance-gateway' namespace to follow the principle of least privilege. One specific requirement is that the container's root filesystem must be completely immutable to prevent attackers from installing malicious software or modifying configuration files at runtime. However, the application still needs to write temporary log files to the '/var/log/app' directory for its internal operations. How should the Pod be configured to meet these conflicting requirements?

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

    Show answer & explanation

    Correct answer: C. Set readOnlyRootFilesystem: true in the SecurityContext and mount an EmptyDir volume at /var/log/app.

    Setting readOnlyRootFilesystem to true ensures immutability, while mounting an EmptyDir at the specific log path provides required writable storage. Option B is invalid because Pod Security Policies were removed in modern Kubernetes versions.

  134. Question 134 of 597A critical backend service written in Python occasionally encounters a localized deadlock where the web server process remains active, but the internal request handler stops processing incoming traffic. The application exposes a health status on a local Unix socket at /var/run/app.sock. You need to configure the pod to automatically restart if the socket becomes unresponsive for more than 3 consecutive checks, with checks occurring every 10 seconds.

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

    Show answer & explanation

    Correct answer: B. Define a Liveness Probe using an exec command that pings the Unix socket and set failureThreshold to 3.

    A liveness probe using an exec handler runs custom commands like a Unix socket ping to restart deadlocked containers. Option C fails because httpGet handlers do not support local Unix socket paths in Kubernetes.

  135. Question 135 of 597Your on-premises Kubernetes cluster lacks a cloud LoadBalancer. You must expose a 'data-receiver' service to a legacy external system that can only reach the cluster via a static IP and a specific port. The service should be accessible on a port between 30000 and 32767 on every node's IP address. Which Service type and configuration should be applied?

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

    Show answer & explanation

    Correct answer: A. Service type NodePort with a specific nodePort value defined in the ports section

    A NodePort service exposes the application on a static port across all cluster nodes, making it ideal for environments without cloud load balancers. Option D is invalid because the LoadBalancer type requires external cloud integration.

  136. Question 136 of 597You are configuring access for a cloud-native application suite. The inventory service should be reached by external clients at the URL api.example.com/inventory and the orders service should be reached at api.example.com/orders. Both services are currently exposed internally on port 80. You have an Ingress controller installed and need to create an Ingress resource to route traffic appropriately. Which configuration structure is required?

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

    Show answer & explanation

    Correct answer: D. An Ingress resource with a single host 'api.example.com' containing multiple paths, each mapping to its respective service and port

    A single Ingress host can define multiple paths to efficiently route HTTP traffic to different backend services. Option C is incorrect because consolidating paths into one resource is the standard method for path-based routing.

  137. Question 137 of 597You are deploying a legacy Java application that requires several environment variables to be set for database connectivity. Instead of hardcoding these values in the deployment manifest, you have been provided with a properties file. You need to create a Kubernetes object from this file and inject all the key-value pairs into the application container as environment variables at once.

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

    Show answer & explanation

    Correct answer: D. Create a ConfigMap from the properties file and use the envFrom field in the container specification to load all values.

    The envFrom field automatically populates environment variables from an entire ConfigMap, streamlining bulk configurations. Option A is less efficient because it requires mapping individual keys using configMapKeyRef.

  138. Question 138 of 597A containerized application runs as a non-root user with UID 2000 and needs to write to a persistent volume mounted at /var/app/data. The application fails because the volume is mounted with root ownership (UID 0) by default. You need to ensure the volume is writable by the application without running the container as root. Which securityContext setting at the Pod level should be used?

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

    Show answer & explanation

    Correct answer: B. Set the fsGroup field to 2000 within the pod-level securityContext to manage volume permissions

    Setting fsGroup to 2000 in the pod securityContext chowns mounted volume files so the non-root user can write. Avoid runAsUser 0, which violates the non-root requirement and defeats the security purpose.

  139. Question 139 of 597You are deploying a web application that stores its configuration in a Kubernetes ConfigMap. The application is designed to watch for changes in its configuration file and reload settings dynamically without a restart. You need to ensure that when the ConfigMap is updated via the API, the changes are eventually reflected inside the running Pod's filesystem so the application can detect the update and apply the new configuration.

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

    Show answer & explanation

    Correct answer: C. Mount the ConfigMap as a volume in the Pod specification so that the kubelet automatically updates the projected files when the ConfigMap changes.

    Mounting the ConfigMap as a volume lets the kubelet automatically update the projected files so the application can detect changes. Environment variables are only set at startup, so envFrom fails the dynamic reload requirement.

  140. Question 140 of 597A Java-based microservice takes approximately 120 seconds to load its configuration from a remote server and initialize its internal cache. During this startup phase, the process is active but cannot serve traffic. If you use a Readiness probe, the pod remains unready for a long time. If you use a Liveness probe with a short initial delay, the container is killed and restarted before it can finish initializing. You need a way to protect the container during its long startup period.

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

    Show answer & explanation

    Correct answer: C. Implement a Startup probe that disables Liveness and Readiness checks until the container has successfully passed its initial boot sequence.

    A Startup probe suspends Liveness and Readiness checks until it succeeds, protecting slow booting containers from restarts. While increasing the Liveness delay works, it risks false restarts if the container crashes before the delay expires.

  141. Question 141 of 597Your team is deploying a Java-based microservice that takes approximately 90 seconds to load its internal cache and warm up its connection pool. During this initialization phase, the application process is running, but it cannot handle incoming HTTP requests. If traffic is sent to the pod during this time, users receive connection timeouts. You need to configure the Pod so that the Service only routes traffic to it once the /health endpoint returns a 200 OK status. Which configuration should be applied?

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

    Show answer & explanation

    Correct answer: C. Implement a readinessProbe with an httpGet check on the /health path to ensure the pod is only added to the service endpoints when ready.

    A readinessProbe with an httpGet on the /health path keeps the Pod out of Service endpoints until it passes. The Liveness probe only controls restarts and cannot prevent traffic from routing to the uninitialized Pod.

  142. Question 142 of 597Your engineering team is performing a manual canary release for a new version of the 'order-service' microservice. You currently have a Deployment named 'order-service-v1' running with 10 replicas. You have created a second Deployment named 'order-service-v2' with 2 replicas. Both versions must receive traffic from the same Service named 'order-internal-svc'. During testing, you notice that 'v2' is receiving significantly more traffic than expected relative to its replica count. You need to ensure traffic is distributed proportionally across all running Pods.

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

    Show answer & explanation

    Correct answer: D. Modify both Deployments to use identical labels for the 'app' key while ensuring the Service selector targets that specific 'app' label.

    Using a common app label across both Deployments allows the Service to balance traffic evenly across all matching Pods proportionally. The traffic imbalance indicates the v2 Pods likely have a different or missing label included in the selector.

  143. Question 143 of 597Your organization is hosting a multi-tenant application where the 'frontend' service in the 'web' namespace needs to communicate with the 'api-service' in the 'backend' namespace. A strict network isolation policy is in place. You need to create a resource that allows only the 'frontend' pods (labeled 'app: frontend') from the 'web' namespace to access the 'api-service' pods on port 8080 while blocking all other ingress traffic from any other source.

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

    Show answer & explanation

    Correct answer: B. Create a NetworkPolicy in the 'backend' namespace with an ingress rule selecting the 'web' namespace and pods with the label 'app: frontend'.

    Applying a NetworkPolicy in the backend namespace with both pod and namespace selectors restricts ingress strictly to frontend Pods. The policy must target the destination namespace to effectively control incoming traffic from the web namespace.

  144. Question 144 of 597A custom reporting application running in the analytics namespace needs to list all existing Pods in the same namespace to generate a resource usage report. When the application attempts to call the Kubernetes API using the default credentials provided in the Pod, it receives an error: pods is forbidden: User system:serviceaccount:analytics:default cannot list resource pods in API group. You must resolve this using the principle of least privilege. What is the most secure way to grant this access?

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

    Show answer & explanation

    Correct answer: D. Create a Role that allows the list verb on pods, and create a RoleBinding to associate this Role with a new ServiceAccount used by the Pod.

    Creating a dedicated ServiceAccount bound to a namespace scoped Role restricts access strictly to listing pods. Modifying the default ServiceAccount with broad ClusterRoleBindings violates least privilege and expands the attack surface unnecessarily.

  145. Question 145 of 597A company is migrating its web portal to Kubernetes and needs to expose two separate services: 'orders-svc' and 'inventory-svc'. Both services must be reachable via a single external IP address on port 80. Traffic sent to 'portal.com/orders' should go to 'orders-svc', and traffic sent to 'portal.com/inventory' should go to 'inventory-svc'. Both services are of type ClusterIP.

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

    Show answer & explanation

    Correct answer: A. Create an Ingress resource with two paths defined under a single host, each pointing to their respective backend services.

    An Ingress resource provides Layer 7 routing, mapping distinct URL paths to separate ClusterIP services behind one IP. LoadBalancer and NodePort services operate at Layer 4 and cannot route traffic based on the URL path natively.

  146. Question 146 of 597You are tasked with isolating the sensitive-data pod in the backend namespace. This pod needs to initiate connections to an external legacy API located at a specific IP address 192.168.1.50 for synchronization purposes. However, to prevent lateral movement within the cluster, the pod must be strictly prohibited from initiating any other outbound traffic to any other pods or services in the cluster. How should you define the NetworkPolicy to achieve this egress control?

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

    Show answer & explanation

    Correct answer: C. Create an Egress policy with a single rule allowing traffic to the specific ipBlock of 192.168.1.50/32 and no other rules

    An egress policy with a single allow rule for a specific IP block implicitly denies all other outbound traffic. Do not confuse this with an ExternalName service, which handles internal routing to an external name without restricting pod egress.

  147. Question 147 of 597A batch processing job is designed to handle large datasets and is known to encounter intermittent network failures. The business logic dictates that if the job fails due to an error, it should be retried automatically by the Kubernetes controller. However, to prevent wasting resources on permanently broken data, the job should stop trying and be marked as failed if it does not succeed after 5 total execution attempts. How should the Job manifest be configured?

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

    Show answer & explanation

    Correct answer: B. Set the backoffLimit field to 4 in the Job specification to allow for a maximum of 5 attempts including the first run

    The backoff limit defines the number of retries before a job is marked as failed. A value of 4 allows 1 original run plus 4 retries, totaling 5 attempts, whereas the completions field dictates successful finishes.

  148. Question 148 of 597The deployment 'web-app' currently runs with 10 replicas. During an update to a new image, the team must ensure that at least 8 replicas are always available to handle traffic, and the total number of pods in the cluster for this deployment never exceeds 12. Which rolling update 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 to 20% and maxSurge to 20% within the rollingUpdate strategy block

    Setting maximum unavailable and maximum surge to 20% restricts unavailable replicas to 2 and surges to 2. This guarantees 8 replicas remain available while capping the total at 12 pods during the rollout.

  149. Question 149 of 597A mission-critical payment processing system consists of a backend deployment and a database pod in the same namespace. To comply with strict internal security audits, you must ensure that the database pod only accepts incoming TCP traffic on port 5432 from pods specifically labeled with 'app: payment-api'. All other incoming traffic, including traffic from other pods in the same namespace or from external sources, must be explicitly denied to prevent lateral movement.

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

    Show answer & explanation

    Correct answer: B. Define a NetworkPolicy with an ingress rule that selects pods with the 'app: payment-api' label and specifies port 5432.

    A NetworkPolicy isolates a selected pod by implicitly denying all ingress unless explicitly allowed. By specifying the payment API label and port 5432 in the ingress rule, only matching traffic is permitted.

  150. Question 150 of 597A high-availability banking portal requires that its three replicas are never scheduled on the same worker node to prevent a single node failure from taking down the entire service. The infrastructure consists of five distinct nodes across two availability zones. You need to configure the deployment spec to enforce this constraint strictly during scheduling so that no two pods from this deployment ever share a node.

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

    Show answer & explanation

    Correct answer: B. Use podAntiAffinity with requiredDuringSchedulingIgnoredDuringExecution specifying the app label

    Using required pod anti-affinity strictly prevents the scheduler from placing multiple pods with the same label on one node. Preferred anti-affinity acts only as a soft hint and will not strictly guarantee distribution.

  151. Question 151 of 597An enterprise application deployment named order-service is failing because the application starts faster than the backend SQL database. The application does not have built-in retry logic and crashes immediately if it cannot establish a connection. To prevent this, you need to implement a mechanism that ensures the main application container only starts once the database is reachable on port 5432 at the address db-service.internal. Which of the following configurations is the most appropriate for this scenario?

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

    Show answer & explanation

    Correct answer: C. Include an initContainer in the Pod specification that uses a busybox image to run a network check loop until the database port is open.

    An init container runs to completion before the main application container starts, blocking startup until the database is reachable. Liveness and readiness probes manage running containers but do not delay initial startup.

  152. Question 152 of 597A DevOps engineer is hardening a containerized Python application that processes user-uploaded images. The container must not run as the root user for security reasons. Additionally, the application requires the capability to bind to a privileged port (e.g., port 443) and needs to ensure that its filesystem is read-only, except for a specific temporary directory used for image processing (/tmp/uploads). You need to define the correct SecurityContext settings.

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

    Show answer & explanation

    Correct answer: C. Apply runAsUser: 1000, readOnlyRootFilesystem: true, and add the NET_BIND_SERVICE capability in the securityContext of the container.

    Setting a non-root user and a read-only root filesystem meets baseline security requirements. Adding the NET_BIND_SERVICE capability explicitly permits the non-root process to bind to privileged ports like 443.

  153. Question 153 of 597You are configuring an Ingress resource to route traffic for a corporate portal. The requirement is that all requests starting with '/static' must be sent to the 'assets-service', while all other requests (the catch-all) should be directed to the 'frontend-service'. You are using a controller that supports the 'pathType' field. Which configuration ensures that '/static/images/logo.png' is correctly routed to the assets-service?

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

    Show answer & explanation

    Correct answer: A. Set the path to '/static' with a pathType of 'Prefix' for the assets-service.

    Prefix path type matching routes any request that begins with the defined path. Exact path type would require a perfectly matching URL, and ImplementationSpecific relies on custom controller logic.

  154. Question 154 of 597An application requires a specific configuration file, 'extra-settings.json', to be located in the directory '/app/config/'. This directory is already populated with several other system-critical files during the image build process. You have the 'extra-settings.json' stored in a ConfigMap. You need to mount this file into the directory without deleting or hiding the existing files already present in '/app/config/'.

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

    Show answer & explanation

    Correct answer: B. Utilize the 'subPath' property within the 'volumeMounts' section to map the specific key from the ConfigMap to the exact file path.

    Using the subPath property mounts a single file from a volume without obscuring existing files in the target directory. A standard volume mount would hide the original directory contents.

  155. Question 155 of 597A high-performance trading platform is deploying a new microservice called trade-validator in a production cluster that hosts multiple other workloads. During periods of extreme market volatility, the nodes hosting the trade-validator pods often experience severe resource contention. Even though the pods have memory and CPU requests defined, they are frequently evicted by the Kubelet to reclaim resources for other system processes because the limits are either not defined or do not match the requests. To prevent these critical evictions and ensure the highest scheduling and runtime stability, the engineering team must ensure the pods are assigned the Guaranteed Quality of Service class. Which of the following configuration strategies must be implemented in the pod specification?

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

    Show answer & explanation

    Correct answer: B. Configure both memory and CPU requests and limits to the exact same values for every container within the pod specification.

    Assigning identical CPU and memory requests and limits to every container grants the Guaranteed Quality of Service class. This provides the highest protection against eviction, while a PriorityClass only affects scheduling.

  156. Question 156 of 597You are configuring an Ingress resource to host a multi-service web application. Requests to 'portal.example.com/shop' must be routed to the 'shopping-service' on port 80. Requests to 'portal.example.com/admin' must be directed to the 'admin-service' on port 8080. Additionally, all traffic to 'portal.example.com' must be encrypted via HTTPS using a certificate stored in a Secret named 'portal-certs'.

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

    Show answer & explanation

    Correct answer: D. Define a single Ingress with a 'tls' section referencing the secret and 'rules' containing multiple paths under the same host.

    Defining a single Ingress with a tls section and multiple path rules correctly handles routing and HTTPS termination. Creating separate Ingress resources for the same host often causes controller conflicts, making a single resource the required approach.

  157. Question 157 of 597Your organization is migrating a legacy monolithic application that needs to communicate with an external cloud-based logging service. The logging service requires a complex, custom-built authentication handshake and payload encryption that the legacy application cannot perform. To avoid modifying the legacy code, you decide to use a multi-container Pod pattern where a helper container handles all the external communication, authentication, and encryption details on behalf of the legacy app.

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

    Show answer & explanation

    Correct answer: A. Configure an Ambassador container that acts as a local proxy, allowing the legacy app to send logs to localhost while the proxy handles authentication.

    The Ambassador container pattern acts as a local proxy, handling complex external authentication so the main app connects only to localhost. A standard sidecar simply extends functionality, whereas an Ambassador specifically brokers outside connections.

  158. Question 158 of 597A high-performance computing task requires processing a static dataset of 500GB that is updated once a week. Because the dataset is too large to include in the container image and is shared by multiple concurrent pods, you must ensure that each pod can access the data locally at /mnt/data. The storage solution must be persistent even if all processing pods are deleted, but it does not need to be accessible from outside the cluster.

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

    Show answer & explanation

    Correct answer: A. Provision a PersistentVolume (PV) and a PersistentVolumeClaim (PVC) with ReadWriteMany access mode to mount the volume into all pods.

    PersistentVolumes and PersistentVolumeClaims provide storage with a lifecycle independent of pods, and ReadWriteMany access allows concurrent mounting. The hostPath and emptyDir options fail the persistence requirement when nodes or pods are recycled.

  159. Question 159 of 597An engineering team is deploying a distributed data processing application in a Kubernetes cluster. The main application container requires a specific configuration schema to be present in a local directory before it can start. However, this schema is dynamically generated by a specialized tool that takes about 30 seconds to run and requires different environment variables than the main application. The team wants to ensure the main container only starts once the schema file is successfully created in the shared volume. Which design pattern should be implemented to handle this dependency correctly?

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

    Show answer & explanation

    Correct answer: D. Define an Init Container in the Pod spec to run the specialized tool and write the schema to a shared EmptyDir volume.

    Init containers run sequentially and must complete successfully before the main application containers start. Using a postStart hook runs concurrently with the main container, creating a race condition, whereas an init container guarantees the dependency is met.

  160. Question 160 of 597A legacy application writes its logs to a file located at /var/log/app.log instead of stdout. To integrate with the cluster's Fluentd-based logging system, you need to deploy a sidecar container in the same Pod that reads this file and streams the content to its own standard output. Both containers must access the same file location.

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

    Show answer & explanation

    Correct answer: C. Use an emptyDir volume mounted at /var/log in both the application and the sidecar containers

    An emptyDir volume provides a temporary shared disk that both containers in the same Pod can mount to read and write files. A persistent volume is unnecessary for temporary logs, and sharing the process namespace is less clean.

  161. Question 161 of 597A batch processing job must handle 50 work items. To minimize processing time, the team wants to run 5 instances of the processing logic concurrently. The Job must ensure exactly 50 successful completions before it is considered finished. If an instance fails, it should be retried. Which Job specification fields should be configured to meet these concurrency and completion goals?

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

    Show answer & explanation

    Correct answer: D. Set completions to 50 and parallelism to 5 in the Job's spec section

    The completions field defines the total successful pod finishes required, while parallelism controls the active pods at once. Replicas are used for Deployments, not run-to-completion batch Jobs.

  162. Question 162 of 597A development team is working in a shared namespace called 'dev-sandbox'. Recently, some resource-heavy containers have been causing node pressure, leading to the eviction of smaller, critical management Pods. You have been asked to implement a solution that limits the total amount of CPU and Memory that all Pods combined can consume in this namespace, and also ensures that every new Pod created without explicit limits receives a default set of resource constraints.

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

    Show answer & explanation

    Correct answer: B. Create a ResourceQuota to limit total namespace usage and a LimitRange to provide default requests and limits for individual containers.

    A ResourceQuota caps the total aggregate resources consumed within a namespace, while a LimitRange applies default bounds to individual containers. PriorityClasses only handle eviction order during node pressure and do not restrict total namespace limits.

  163. Question 163 of 597A corporate security policy mandates that no container should ever run with administrative privileges or as the root user. You are deploying a web server that by default runs as UID 0. You need to modify the Pod specification to force the container to run as user 1001 and prevent it from ever gaining root access through privilege escalation.

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

    Show answer & explanation

    Correct answer: A. Add a securityContext block with runAsUser set to 1001 and allowPrivilegeEscalation set to false

    The securityContext block directly enforces runtime constraints, letting you set the user ID and disable privilege escalation. Rebuilding the image fails because Kubernetes configurations must override image defaults to guarantee the security policy at runtime.

  164. Question 164 of 597A developer is deploying a Pod that runs as a non-root user (UID 1000). The container needs to write logs to a PersistentVolume mounted at '/var/log/app'. However, the volume is provisioned with root-only write permissions by the storage provider, causing the application to fail with 'Permission Denied'. You cannot change the underlying storage provider settings. Which securityContext setting should be applied at the Pod level to resolve this?

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

    Show answer & explanation

    Correct answer: D. Set fsGroup: 2000 in the Pod securityContext to change the ownership of the mounted volume to a specific group.

    Setting fsGroup in the pod securityContext instructs Kubernetes to modify the mounted volume ownership, granting access to the specified group. Using privileged mode or root introduces severe security risks and violates standard container hardening practices.

  165. Question 165 of 597Your organization is migrating a legacy suite of web services to Kubernetes. You need to expose three different internal Services: 'orders-svc' on port 80, 'catalog-svc' on port 80, and 'identity-svc' on port 80. The requirement is to use a single public LoadBalancer IP address. Traffic must be routed based on the URL path: '/orders' should go to 'orders-svc', '/catalog' to 'catalog-svc', and any other traffic should be directed to 'identity-svc'. Which Kubernetes resource and configuration should be used?

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

    Show answer & explanation

    Correct answer: D. An Ingress resource with path-based rules for /orders and /catalog, and a defaultBackend set to 'identity-svc'.

    An Ingress resource manages Layer 7 routing, letting you map specific URL paths to different backend services. The defaultBackend property catches any traffic that does not match your explicit path rules, solving the fallback requirement perfectly.

  166. Question 166 of 597A high-traffic web application currently runs 10 replicas under a Deployment named web-prod. You want to test a new version of the application, v2, by sending approximately 10% of the live traffic to it using a canary deployment strategy. You create a new Deployment named web-canary with 1 replica using the v2 image. Both deployments are in the same namespace. How can you ensure the existing Service named web-service distributes traffic across both versions without modifying the Service configuration?

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

    Show answer & explanation

    Correct answer: A. Update the labels of the web-canary pods to match the selector defined in the web-service and ensure the pod labels are identical to web-prod.

    Matching pod labels to the existing service selector naturally balances traffic proportionally based on pod count. The Ingress option requires modifying routing rules and creating separate services, which violates the stated restriction.

  167. Question 167 of 597A payment-processing microservice named 'secure-pay' in the 'finance-prod' namespace must be restricted for security reasons. Policy dictates that this microservice can only initiate outbound connections to a specific external gateway at the IP 198.51.100.24 on port 443. All other egress traffic to any destination, internal or external, must be blocked. Which NetworkPolicy configuration achieves this goal?

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

    Show answer & explanation

    Correct answer: A. An Egress policy with an empty podSelector and an allow rule for the specific IP block and port

    A NetworkPolicy is additive, so defining an egress rule for the specific IP and port implicitly blocks all other outbound traffic. NetworkPolicy does not support explicit deny rules, making the sequential rule option invalid.

  168. Question 168 of 597An application requires a configuration file named app-config.yaml to be present in the directory /etc/myapp/. However, this directory already contains other critical files generated at runtime. When you try to mount a ConfigMap to this path using the volumeMounts.mountPath field, the existing files in /etc/myapp/ disappear. How can you mount the single file from the ConfigMap without overwriting the rest of the directory content?

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

    Show answer & explanation

    Correct answer: B. Use the subPath property within the volumeMounts section to mount only the specific key from the ConfigMap to the desired file path.

    The subPath property mounts a single file from a volume without masking the existing files in the target directory. Standard volume mounts always overlay the entire directory, which is why your runtime files disappear.

  169. Question 169 of 597A legacy monitoring agent is deployed as a container within a Pod. This agent communicates using an unencrypted protocol on port 8080 and cannot be modified to support encryption. For compliance reasons, all traffic leaving the Pod must be encrypted using TLS. You decide to use a sidecar container to act as a local proxy that handles the encryption before the traffic reaches the network. Which configuration ensures the legacy application traffic is properly intercepted and encrypted?

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

    Show answer & explanation

    Correct answer: D. Set the legacy agent to send traffic to localhost on port 443 where the sidecar container is listening and encrypting

    Containers in the same pod share a network namespace, so routing localhost traffic to the proxy port works seamlessly. This intercepts the payload locally, allowing the sidecar to encrypt the outbound traffic.

  170. Question 170 of 597You are configuring an Ingress resource to manage traffic for a SaaS platform. The requirement is that traffic sent to 'app.example.com/api' must be routed to a Service named api-service on port 8080, while traffic sent to 'app.example.com/static' must be routed to a Service named assets-service on port 80. Both services are in the same namespace. Which Ingress configuration structure is correct for this requirement?

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

    Show answer & explanation

    Correct answer: D. Use a single Ingress resource with a host 'app.example.com' and a list of paths under the 'http' section, each mapping to its respective service.

    A single Ingress resource efficiently handles multiple paths for a single host by mapping each path to a specific backend. Creating multiple Ingress resources for the same host often causes controller conflicts and unnecessary routing complexity.

  171. Question 171 of 597An application pod named 'report-worker' in the 'analytics' namespace needs to be able to list all other pods in the same namespace to coordinate a distributed task. When the application starts, it receives a '403 Forbidden' error from the Kubernetes API. You need to resolve this by providing the pod with the minimum necessary permissions following security best practices.

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

    Show answer & explanation

    Correct answer: C. Create a Role with 'list' permissions for 'pods', a ServiceAccount for the worker, and a RoleBinding to link them.

    Creating a dedicated ServiceAccount bound to a namespace Role via a RoleBinding grants strictly scoped API access. Assigning cluster-admin grants excessive permissions, violating security best practices and creating dangerous cluster-wide risks.

  172. Question 172 of 597A security administrator requires that the processor container in the compliance namespace is hardened to mitigate potential privilege escalation. The application must run with a specific non-root user ID 1001, and the container should be prevented from gaining more privileges than its parent process. Additionally, the root filesystem should be mounted as read-only to ensure integrity. Which configuration block should be added to the container specification to meet these requirements?

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

    Show answer & explanation

    Correct answer: C. Define a securityContext with runAsUser 1001, allowPrivilegeEscalation set to false, and readOnlyRootFilesystem set to true

    The securityContext configures runtime security at the pod or container level, directly enforcing the required user ID, blocking privilege escalation, and mounting the root filesystem as read-only. PodSecurityPolicy was removed and is no longer valid.

  173. Question 173 of 597A data processing task is implemented as a Kubernetes Job. This task is prone to occasional network timeouts, but it is idempotent and can be safely retried. Your management wants to ensure that the Job is not abandoned after the first failure but also wants to prevent it from running indefinitely if there is a permanent bug. It should stop attempting and mark the task as failed after 5 total unsuccessful attempts. Which Job parameter must be set?

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

    Show answer & explanation

    Correct answer: D. Configure 'backoffLimit: 4' in the Job specification to allow for 4 retries (total of 5 attempts) before the Job is considered failed.

    The backoffLimit specifies the number of retries before a Job fails. Setting it to 4 allows the initial attempt plus four retries, resulting in exactly five total attempts. The activeDeadlineSeconds limits duration, not attempt counts.

  174. Question 174 of 597A data processing company uses a Kubernetes Job to run heavy extract-transform-load (ETL) tasks. The Job is configured to process 100 data chunks in total. To optimize performance, the team wants to ensure that 10 chunks are being processed simultaneously at any given time. If a single task fails, it should be retried up to 5 times before the entire Job is marked as failed. Which set of parameters should be configured in the Job manifest to achieve this behavior? Correct answer

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

    Show answer & explanation

    Correct answer: A. Set completions: 100, parallelism: 10, and backoffLimit: 5.

    The completions, parallelism, and backoffLimit fields directly map to total chunks, simultaneous workers, and failure retries. Other options confuse these parameters or introduce unrelated concepts like CronJobs and active deadlines.

  175. Question 175 of 597A financial institution is deploying a high-security transaction processing application. The infrastructure team has designated a specific set of worker nodes with hardware-level encryption as dedicated resources for this application. These nodes are marked with a Taint 'security=high:NoSchedule' to prevent regular workloads from using them. You need to configure the 'transaction-processor' Deployment so that its Pods are allowed to run on these nodes and specifically prefer them over any other available hardware in the cluster. Correct answer

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

    Show answer & explanation

    Correct answer: A. Add a Toleration for the security taint and implement a nodeAffinity rule with a requiredDuringSchedulingIgnoredDuringExecution constraint.

    Tolerations allow pods to be scheduled on tainted nodes, while nodeAffinity enforces placement based on specific hardware labels. This combination ensures strict targeting compared to the more basic nodeSelector.

  176. Question 176 of 597An engineering lead requires that during the update of the web-portal deployment, which currently runs 10 replicas, the update process must be strictly controlled. The total number of pods during the transition must never exceed 12 to avoid over-provisioning node resources, and the number of available pods must never drop below 9 to maintain service availability. 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: D. Specify a strategy with maxSurge set to 2 and maxUnavailable set to 1 in the RollingUpdate configuration block

    MaxSurge controls how many pods exceed the desired count, so two allows exactly twelve. MaxUnavailable dictates the drop ceiling, so one keeps nine pods available. Other percentages or values violate the stated resource constraints.

  177. Question 177 of 597An engineering team is deploying a clustered database using a Kubernetes StatefulSet. Each member of the cluster requires a stable, predictable network identity (e.g., mongodb-0.mongodb-service) to perform internal synchronization and leader election. Unlike standard microservices, these database instances must be able to discover each individual peer's IP address directly rather than being load-balanced by a virtual IP. Which configuration is required to achieve this specific networking requirement for the database cluster?

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

    Show answer & explanation

    Correct answer: C. Create a Headless Service by setting the clusterIP field to None in the Service specification.

    A Headless Service, created by setting clusterIP to None, skips assigning a virtual IP. DNS returns individual Pod IPs instead, enabling direct peer discovery required for StatefulSet databases. Standard Services blindly load-balance traffic.

  178. Question 178 of 597A financial services company is migrating its client-portal frontend application to a Kubernetes cluster. The application must interact with an on-premises legacy SOAP backend that requires strict MTLS authentication and utilizes a proprietary encryption protocol for all payloads. To simplify the application code and avoid embedding complex security libraries within the frontend container, the engineering team decides to implement a pattern where the frontend communicates with a local proxy on localhost. This proxy handles all encryption, decryption, and MTLS handshakes before forwarding requests to the on-premises backend. Which architectural pattern is being implemented to provide this abstraction layer within the Pod?

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

    Show answer & explanation

    Correct answer: B. Utilizing an ambassador container that acts as a local proxy to handle complex communication with the external legacy system

    The ambassador pattern is specifically designed to provide a local proxy for the main container to reach external services. This abstracts the complexity of mutual TLS and proprietary encryption away from the primary application code.

  179. Question 179 of 597Your company uses an Ingress controller to expose several services. You need to configure a single Ingress resource that routes traffic coming to 'api.example.com/v1' to a service named 'api-v1-service' and traffic coming to 'api.example.com/v2' to 'api-v2-service'. Both services operate on port 80. How should the 'rules' section of the Ingress manifest be structured to achieve this path-based routing?

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

    Show answer & explanation

    Correct answer: D. Use a single rule with the host 'api.example.com' and a list of two paths under the 'http' section, each pointing to their respective service.

    An Ingress rule for a specific host can contain multiple paths under the paths section. Each path specifies a path type and a backend, which is the standard for path-based routing.

  180. Question 180 of 597You are managing a microservices-based application where a 'payment-service' and a 'logger-service' reside in the same namespace. Corporate security policy dictates that the 'payment-service' should only be able to receive traffic from the 'frontend' pod and must be completely blocked from communicating with or receiving traffic from the 'logger-service'. No NetworkPolicies currently exist in the namespace. What is the first step to implement this isolation?

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

    Show answer & explanation

    Correct answer: A. Apply a NetworkPolicy that selects the payment-service pods and defines an ingress rule allowing only pods with the label 'app=frontend'.

    Network policies act as a firewall for pods. By creating a policy that selects the payment service and only allows traffic from pods labeled app=frontend, all other internal traffic is implicitly denied.

  181. Question 181 of 597Your organization wants to implement a Blue-Green deployment strategy for a stateless API. Version blue is currently receiving traffic via a Service named api-service using the label version: blue. You have deployed version green and verified its functionality. You now need to switch 100% of the production traffic to the green version with minimal downtime by modifying the existing Service manifest.

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

    Show answer & explanation

    Correct answer: A. Update the selector in the Service manifest to match the labels of the green deployment

    Changing the service selector is the standard way to perform a blue-green switch in Kubernetes. Traffic is immediately routed to the new pods without changing the service IP.

  182. Question 182 of 597An application named 'secure-processor' needs to access two different types of sensitive information: a static API key that rarely changes and a temporary session token that is rotated every 15 minutes by an external security vault. The security team insists that the session token must never be stored on the node's physical disk and should only exist in memory. What is the most secure and efficient way to provide these two pieces of data to the container?

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

    Show answer & explanation

    Correct answer: A. Store the API key in a Secret and mount it as a volume, and use a CSI driver (like HashiCorp Vault) to mount the session token as an in-memory volume.

    Secrets are intended for sensitive data and are backed by temporary storage in modern Kubernetes. Using a specialized driver for the rapidly rotating token ensures it is fetched directly from the vault and never touches the disk.

  183. Question 183 of 597Your team is managing a production Deployment named 'api-gateway' which currently runs 10 replicas. Due to strict Service Level Objectives (SLOs), the application must always have at least 80% of its desired capacity available during a rolling update. Additionally, the cluster has limited resource quotas, so the Deployment cannot exceed more than 120% of its desired replica count at any point during the update process. Which strategy configuration parameters must be applied to meet these constraints?

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

    Show answer & explanation

    Correct answer: D. Set maxUnavailable to 2 and maxSurge to 2 in the strategy section.

    Setting max unavailable to 2 ensures at least 8 pods are running, meeting the 80% availability requirement. Setting max surge to 2 allows up to 12 pods total, perfectly matching the resource constraints.

  184. Question 184 of 597Your organization is updating a mission-critical deployment named payment-api which currently has 10 replicas. The update must strictly adhere to an availability policy where 100% of the required capacity (10 replicas) must be available at all times during the rolling update. Additionally, the cluster has limited spare resources, so you want to ensure that no more than 3 extra pods are created during the process. Which strategy configuration meets these requirements?

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

    Show answer & explanation

    Correct answer: C. Set maxSurge to 3 and maxUnavailable to 0 in the deployment's rollingUpdate strategy section.

    Setting max unavailable to 0 ensures that the current number of available pods never drops below the desired count. Setting max surge to 3 allows the deployment to start 3 new pods before stopping old ones.

  185. Question 185 of 597A legacy application writes raw log files to a local directory at /mnt/data/logs. These logs must be processed by a sidecar container that converts them to JSON and sends them to a central server. Both containers run in the same Pod and need shared access to the logs without persisting them on the host node's physical disk after the Pod is deleted. What is the most efficient volume configuration?

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

    Show answer & explanation

    Correct answer: A. Define an emptyDir volume and mount it at /mnt/data/logs in both the app and sidecar containers

    An empty directory volume is created when a pod is assigned to a node and exists as long as that pod is running. It is the standard way for containers in a pod to share files locally without persisting data.

  186. Question 186 of 597A high-performance computing company needs to ensure that their 'data-cruncher' workloads are only scheduled on nodes equipped with NVMe storage. These specific nodes have been labeled with 'storage-type=nvme'. However, other generic workloads should not be prevented from using these nodes if they are idle, but the 'data-cruncher' must specifically target them. Which configuration provides the most appropriate scheduling constraint for this requirement?

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

    Show answer & explanation

    Correct answer: C. Use a nodeSelector in the Pod specification with the key-value pair storage-type: nvme to force the scheduler to select these specific nodes.

    A node selector is the simplest and most effective way to constrain pods to nodes with particular labels. It ensures the data cruncher only lands on NVMe nodes without blocking other pods.

  187. Question 187 of 597You are managing a multi-tier application in a namespace called 'production'. To comply with internal security audits, you must implement a network isolation policy. The requirement states that the 'backend-db' Pods should only accept incoming traffic on port 5432 from Pods labeled 'app: api-gateway' within the same namespace. All other incoming traffic from other Pods or other namespaces must be blocked. You are tasked with creating the NetworkPolicy to enforce this restriction.

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

    Show answer & explanation

    Correct answer: B. Define an Ingress NetworkPolicy for the backend-db pods with a podSelector matching 'app: api-gateway' and a specified port of 5432.

    An ingress NetworkPolicy applied to the backend-db pods whitelists specific traffic sources. By defining a podSelector matching the api-gateway and restricting the port, you automatically block all non-matching traffic from other pods or namespaces.

  188. Question 188 of 597The testing namespace in your cluster frequently consumes all available CPU cores, causing scheduling delays for mission-critical pods in the production namespace. You need to enforce a strict policy that limits the total CPU request for all pods combined in the testing namespace to 4 cores and total memory to 8Gi, without manually editing every individual pod manifest. Which Kubernetes object should be created in the testing namespace?

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

    Show answer & explanation

    Correct answer: D. A ResourceQuota object that specifies hard limits for requests.cpu and requests.memory at the namespace level

    A ResourceQuota successfully restricts aggregate resource consumption per namespace. LimitRange is the strongest distractor, but it sets default bounds for individual containers rather than capping total usage.

  189. Question 189 of 597A microservice requires a configuration directory containing several files: settings.conf, proxy.json, and logging.properties. These files are managed by a central team and updated frequently via a ConfigMap. You must ensure that these files are available at the path /etc/app/config inside the container, and that updating the ConfigMap eventually updates the files in the container without a pod restart.

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

    Show answer & explanation

    Correct answer: A. Mount the ConfigMap as a volume at the specified mountPath within the container specification

    Mounting a ConfigMap as a volume correctly projects files into the container and automatically updates them. Environment variables are the strongest distractor, but they require a pod restart to reflect updates.

  190. Question 190 of 597A Python Flask application is deployed in a production namespace and relies on a persistent connection to a Redis cache. Occasionally, the connection to the cache is lost due to transient network issues, causing the application to return HTTP 500 errors while the process remains running. The infrastructure team requires a mechanism to automatically restart the container if it can no longer communicate with Redis using a health check script at /app/check_redis.py. How should this be implemented in the Pod specification?

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

    Show answer & explanation

    Correct answer: A. Configure a livenessProbe using the exec field to run the /app/check_redis.py script within the container

    A liveness probe correctly detects broken states and triggers automatic container restarts. A readiness probe is the strongest distractor, but it only removes traffic without restarting.

  191. Question 191 of 597You are deploying a legacy web application that only communicates over unencrypted HTTP. A new security requirement mandates that all traffic leaving the pod to an external API must be encrypted using mTLS. To avoid modifying the legacy code, you decide to use a proxy container that will run in the same pod, listen for local HTTP traffic from the app, and forward it as HTTPS to the external service.

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

    Show answer & explanation

    Correct answer: A. Configure an Ambassador container in the Pod to act as a local proxy for outgoing traffic and handle the encryption logic.

    The Ambassador pattern correctly acts as a local proxy to handle outgoing traffic encryption. An initContainer is the strongest distractor, but it only runs before startup, not alongside.

  192. Question 192 of 597An enterprise financial application generates operational metrics in a proprietary binary format and sends them to a local Unix socket. The monitoring team requires these metrics to be available in Prometheus-compatible text format for the central observability platform. You need to implement a solution that bridges this gap without modifying the original application source code or its container image, ensuring the transformation logic is decoupled from the business logic.

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

    Show answer & explanation

    Correct answer: A. Implement an Adapter container within the same Pod that reads from the Unix socket and exposes a web endpoint with Prometheus metrics.

    The Adapter pattern successfully translates non-standard outputs into a format external systems expect. A generic sidecar is the strongest distractor, but it lacks the specific translation role.

  193. Question 193 of 597A development team is deploying a microservice that generates massive amounts of data in a short time. They have noticed that their Pods are frequently being terminated with an 'OOMKilled' status. Upon inspection, the containers have a memory limit of 512Mi, but the application occasionally peaks at 600Mi during data bursts. The team wants to allow the application to occasionally exceed its requested memory during bursts if the node has capacity, but still enforce a hard limit to prevent node instability. How should the resources be configured in the Pod spec?

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

    Show answer & explanation

    Correct answer: A. Set memory requests to 512Mi and memory limits to 1Gi.

    Setting memory requests lower than limits allows bursting while maintaining a hard cap. Removing limits is the strongest distractor, but it risks node instability without bounds.

  194. Question 194 of 597A high-traffic e-commerce platform is performing a rolling update of its payment-processing deployment which currently runs 10 replicas. To ensure high availability and prevent resource exhaustion on the cluster nodes during the transition, the DevOps team has specified that at least 80% of the desired capacity must be available at all times, and the total number of pods during the update should not exceed 130% of the desired count.

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

    Show answer & explanation

    Correct answer: A. Define a RollingUpdate strategy where maxUnavailable is 2 and maxSurge is 30%.

    Setting maxUnavailable to 2 keeps eight pods available, satisfying the 80 percent minimum. Setting maxSurge to 30 percent allows up to 13 pods total, preventing the exact 3-pod limit from being misunderstood as an absolute cap.

  195. Question 195 of 597A security-hardened environment hosts a data-crunching microservice that processes sensitive information in an isolated namespace. During a recent audit, the security team discovered that the default ServiceAccount token is automatically mounted at /var/run/secrets/kubernetes.io/serviceaccount within the pod's containers. Since this microservice performs purely local data transformations and never needs to interact with the Kubernetes API server, having this token present poses an unnecessary security risk. You are required to modify the Pod specification to prevent the automatic mounting of these credentials across all containers in the Pod to adhere to the principle of least privilege.

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

    Show answer & explanation

    Correct answer: A. Set the field automountServiceAccountToken to false at the Pod level specification.

    Setting automountServiceAccountToken to false at the Pod level cleanly prevents the default API credentials from being mounted. Overwriting the path with an emptyDir is a hacky workaround that fails to follow Kubernetes security best practices.

  196. Question 196 of 597Your engineering team is deploying a new version of a legacy banking application that requires a specific database schema migration to be completed before the main application container starts. If the migration fails, the application container should not attempt to start to avoid data corruption. The migration script is packaged as a separate container image. How should you structure your Pod manifest to ensure this strict sequence is followed in a production environment? Correct answer

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

    Show answer & explanation

    Correct answer: A. Define the migration container within the initContainers section of the Pod specification to ensure it completes successfully before the app container starts.

    Init containers run to completion before app containers start, guaranteeing the migration finishes first. If it fails, the pod aborts, which prevents data corruption. Liveness probes or sidecars do not gate startup in this strict sequence.

  197. Question 197 of 597Your team needs to provide a large configuration file (over 1MB) containing environment-specific parameters to a web server pod. This file is not sensitive and needs to be updated occasionally without rebuilding the container image. The web server expects the file to be available at /etc/config/settings.conf. Which method is most appropriate for delivering this configuration while allowing the pod to see updates without a full restart?

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

    Show answer & explanation

    Correct answer: B. Store the file content in a ConfigMap and mount it as a volume at /etc/config/ in the Pod specification.

    ConfigMaps handle non-sensitive configuration data and bypass the 1MB limit typical of environment variables. When mounted as a volume, Kubernetes automatically updates the files without requiring a full pod restart, perfectly meeting all requirements.

  198. Question 198 of 597An enterprise financial application generates raw transaction logs in a proprietary binary format and writes them to a shared volume. The centralized logging infrastructure used by the compliance team only ingests logs in JSON format via a Fluentd-compatible agent. You need to implement a solution that sits alongside the main application to perform this data conversion in real-time without modifying the core application code or its container image. Correct answer

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

    Show answer & explanation

    Correct answer: A. Deploy a Sidecar container using the Adapter pattern to transform proprietary logs into JSON before they are sent to the logging agent.

    The sidecar adapter pattern modifies or filters data from a shared volume without altering the main application. An init container runs only before startup, so it cannot continuously convert real-time logs during the application lifecycle.

  199. Question 199 of 597A sensitive data-processing Pod named 'batch-exporter' is deployed in the 'secure-processing' namespace. To comply with corporate networking policies, this Pod must be restricted from initiating any outbound traffic to the public internet, except for a specific external backup server located at the IP address 203.0.113.50. All other egress traffic to the internal cluster and external networks must be blocked. Which NetworkPolicy configuration achieves this requirement?

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

    Show answer & explanation

    Correct answer: D. An Egress policy with a single rule containing an ipBlock that specifies 203.0.113.50/32.

    An Egress policy restricts outbound traffic and acts as a whitelist. By specifying only the target ipBlock, all other traffic is implicitly denied. Ingress policies control incoming traffic, not outbound connections.

  200. Question 200 of 597An application pod 'order-processor' takes a long time (about 2 minutes) to initialize its internal database cache. During this time, the application process is running, but it cannot yet handle requests or pass a liveness check. If a liveness probe starts too early, it might kill the container before it finishes warming up. What is the most modern and appropriate way to handle this in Kubernetes?

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

    Show answer & explanation

    Correct answer: C. Configure a Startup Probe with a failureThreshold and periodSeconds that cover the 2-minute window

    Startup probes disable liveness and readiness checks until the application fully initializes, preventing the kubelet from prematurely restarting slow-starting containers. Setting a high initialDelaySeconds on a liveness probe is a legacy workaround that fails if application startup times vary or take longer than expected.

  201. Question 201 of 597You are managing a sensitive financial application in the 'finance-app' namespace. The architecture includes a 'frontend' deployment, a 'backend' deployment, and a 'postgres-db' deployment. To comply with security audits, you must implement a NetworkPolicy that ensures the 'postgres-db' pod only accepts incoming traffic on TCP port 5432 from the 'backend' pods. All other traffic from the same namespace or external namespaces must be blocked. How should the NetworkPolicy for the database be structured?

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

    Show answer & explanation

    Correct answer: A. Define an Ingress policy for the 'postgres-db' pods with a podSelector matching the backend and a ports section for TCP 5432.

    An ingress network policy isolating the database pods explicitly permits traffic only from the backend pods on port 5432. Defining an empty podSelector would inadvertently allow traffic from all pods in the namespace, violating the strict security requirement.

  202. Question 202 of 597You are deploying a security-sensitive application that produces operational metrics in a legacy text format. A central monitoring system requires these metrics to be converted into a specific JSON format before transmission. You must implement this transformation without altering the primary application image. Which multi-container design pattern should you apply to fulfill this requirement while ensuring the transformation logic resides in the same Pod?

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

    Show answer & explanation

    Correct answer: D. Implement an Adapter container that reads the legacy log files from a shared volume and serves them in the required JSON format via a local endpoint.

    The adapter pattern standardizes output by transforming a legacy application format into a required interface, like JSON. This specialized sidecar handles the translation logic without modifying the primary container image, unlike init containers which only run during startup.

  203. Question 203 of 597A web application occasionally experiences a localized failure where the main process enters a deadlock. In this state, the container remains running and the process is visible in the task list, but it fails to respond to any incoming HTTP requests on port 8080. You need to configure a mechanism that automatically detects this deadlock and restarts the container to restore service availability.

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

    Show answer & explanation

    Correct answer: A. Define a Liveness Probe that performs an HTTP GET request against the /healthz endpoint on port 8080

    An HTTP liveness probe detects application deadlocks and automatically restarts the unresponsive container to restore service. A readiness probe would only remove the pod from service endpoints, but it would not initiate a restart to fix the underlying deadlock.

  204. Question 204 of 597A distributed processing application requires a Redis cache to be fully reachable and responding to pings before the main 'worker' container starts. If the worker starts before Redis is ready, it enters a fatal crash state and requires a manual restart of the entire Pod because it doesn't handle connection retries internally. How can you automate this dependency check within the Pod?

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

    Show answer & explanation

    Correct answer: B. Define an InitContainer that runs a shell script to loop until the Redis service hostname is resolvable and reachable

    An init container runs to completion before the main application container starts, making it perfect for blocking startup until dependencies are ready. Sidecar containers run concurrently, which would not prevent the main worker from crashing if Redis is unavailable.

  205. Question 205 of 597A security architect requires that a multi-container Pod in the compliance namespace, which runs as a non-root user with UID 5000, must be able to write to a shared PersistentVolumeClaim. The volume is mounted at /data, but the underlying storage system assigns owner permissions to root by default, preventing the application from writing files. You need to ensure the Pod can write to the volume without running as root. Which configuration should you apply?

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

    Show answer & explanation

    Correct answer: A. Set the fsGroup field within the Pod SecurityContext to 5000 to allow the volume to be owned by that group

    Setting the fsGroup in the pod security context ensures the kubelet automatically adjusts volume ownership, allowing the non-root user to write files. Using privileged mode or temporarily running as root violates security requirements.

  206. Question 206 of 597A microservices application consists of a web frontend and a backend API. The backend API requires a database schema migration to be completed before the application logic can safely start processing requests. The migration is handled by a separate script included in the container image. You need to ensure that the main application container in the Pod does not start until the migration script has successfully finished its execution.

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

    Show answer & explanation

    Correct answer: A. Define an InitContainer in the Pod spec that runs the migration script and exits with a zero status code

    Init containers run sequentially to completion before the main application container starts, ensuring database migrations finish safely. A postStart hook executes concurrently with the main application, creating a race condition if it runs at the same time.

  207. Question 207 of 597Cross-Namespace Network Isolation. Your organization has a strict security mandate for a multi-tenant cluster. A microservice named 'billing-app' located in the 'finance' namespace must be allowed to receive incoming traffic from the 'frontend-proxy' Pod located in the 'public-facing' namespace on port 8080. All other traffic from any other namespace, including other Pods within the 'finance' namespace that are not specifically authorized, must be blocked. How should you structure the ingress rule in your NetworkPolicy?

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

    Show answer & explanation

    Correct answer: B. Define a NetworkPolicy in the finance namespace using an ingress rule that combines a namespaceSelector for 'public-facing' and a podSelector for 'frontend-proxy'.

    To allow traffic from specific pods in another namespace, combine namespaceSelector and podSelector inside the same rule element. Leaving out the namespaceSelector would incorrectly allow traffic from matching pods in any namespace.

  208. Question 208 of 597A security audit has identified that all Pods in the public-facing namespace have a ServiceAccount token mounted by default at /var/run/secrets/kubernetes.io/serviceaccount. Your frontend application does not need to communicate with the Kubernetes API server at all. You need to implement a change to the Pod specification to prevent this token from being mounted, thereby reducing the potential impact of a container compromise.

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

    Show answer & explanation

    Correct answer: A. Set the automountServiceAccountToken field to false in the Pod spec or the ServiceAccount resource

    Setting automountServiceAccountToken to false explicitly prevents the kubelet from injecting API credentials. Deleting the default ServiceAccount is not allowed, as Kubernetes automatically manages it.

  209. Question 209 of 597A multi-tenant SaaS application uses an Ingress controller to route traffic to different customer backends. Two customers, 'Alpha' and 'Beta', require their own custom SSL certificates for alpha.saas.com and beta.saas.com respectively. You have created two Secrets: 'alpha-tls' and 'beta-tls' in the same namespace. How must the Ingress resource be configured to support both certificates using SNI (Server Name Indication)?

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

    Show answer & explanation

    Correct answer: D. Specify a 'tls' list in the Ingress spec with two entries, each mapping the specific 'hosts' to their respective 'secretName'.

    The Ingress tls field accepts an array of host and secret pairs, enabling SNI for multiple domains. Using two separate Ingress resources is unnecessary and misses the benefit of consolidating routing rules.

  210. Question 210 of 597You are deploying an Ingress resource to manage traffic for your company's payment portal. The portal must be accessible via HTTPS at 'payments.example.com'. You have already created a Kubernetes Secret named 'tls-secret' containing the valid certificate and private key in the same namespace as the Ingress and the backend Service. How must the Ingress resource be configured to enable TLS termination for this specific host?

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

    Show answer & explanation

    Correct answer: A. Define a 'tls' block in the Ingress spec containing the 'hosts' list with 'payments.example.com' and the 'secretName' as 'tls-secret'

    The tls section maps hosts to a specific secret containing the private key and certificate. Configuring a sidecar is unnecessary overhead since the Ingress controller is built to handle TLS termination.

  211. Question 211 of 597A network security tool needs to be deployed as a Pod in your cluster. The container needs to run as a non-root user for security compliance, but it specifically requires the ability to capture network packets using raw sockets (NET_RAW) and to modify network interface settings (NET_ADMIN). Standard unprivileged containers do not have these capabilities by default. How should you configure the Pod's security settings to grant only these specific privileges while maintaining the non-root user requirement? Correct answer

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

    Show answer & explanation

    Correct answer: A. Add NET_RAW and NET_ADMIN to the capabilities list within the securityContext of the container specification

    The capabilities field inside securityContext grants fine-grained Linux kernel privileges, so you add only NET_RAW and NET_ADMIN without running as fully privileged. Avoid setting privileged: true, because it completely undermines the non-root compliance requirement.

  212. Question 212 of 597Your organization uses a Kubernetes CronJob to perform financial reconciliation every Sunday at 02:00. Recently, some jobs have been failing due to external API timeouts. For forensic and auditing purposes, the finance team needs to see the logs and status of the last 10 failed jobs. However, the cluster currently only retains the 1 most recent failed job. Which CronJob field must you update to meet this requirement?

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

    Show answer & explanation

    Correct answer: B. Set 'failedJobsHistoryLimit' to 10 in the CronJob spec to prevent the controller from cleaning up failed Job objects too quickly.

    The failedJobsHistoryLimit field explicitly controls how many failed Job objects remain before garbage collection. The successfulJobsHistoryLimit only retains successful executions, which fails the auditing requirement for failed runs.

  213. Question 213 of 597An application pod requires access to a TLS certificate and a private key stored in a Secret named 'web-certs'. For security compliance, the certificate file 'cert.pem' from the Secret must be mounted at the path '/etc/certs/public.crt' and the key file 'key.pem' must be mounted at '/etc/certs/private.key'. No other data from the Secret should be visible or accessible within that directory.

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

    Show answer & explanation

    Correct answer: D. Use a secret volume and define the 'items' field to map the specific keys 'cert.pem' and 'key.pem' to their respective relative paths.

    Using a secret volume with the items array lets you map specific keys to custom relative paths while excluding other files. Mounting the entire Secret would expose sensitive files unnecessarily, violating the strict compliance requirement.

  214. Question 214 of 597A Java-based microservice named legacy-processor takes approximately 45 seconds to load its internal cache from a database before it can handle any traffic. If the application receives requests before this cache is loaded, it returns a 500 Error. However, if the process itself hangs or runs out of memory, it should be restarted immediately. How should the probes be configured to handle this behavior correctly?

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

    Show answer & explanation

    Correct answer: D. Use a StartupProbe with a failureThreshold of 10 and a periodSeconds of 10 to cover the 45-second boot time, followed by Liveness and Readiness probes.

    A StartupProbe protects slow-booting applications by disabling Liveness and Readiness checks until it succeeds. Relying only on initialDelaySeconds is brittle, because actual startup times often vary unpredictably under heavy load.

  215. Question 215 of 597An engineering team is deploying a legacy application that needs to connect to a highly distributed Redis cluster with multiple shards. The application was originally designed to connect only to a single database endpoint and cannot handle complex sharding logic internally. You need to implement a solution within the Kubernetes Pod that intercepts the application outgoing requests and routes them to the correct database shard based on the key, without changing the application code.

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

    Show answer & explanation

    Correct answer: B. Deploy an Ambassador container within the same Pod to act as a local proxy for the database sharding logic

    An Ambassador container acts as a local proxy inside the Pod, handling complex external routing logic like database sharding. This offloads the work from the legacy application without requiring any modifications to its source code.

  216. Question 216 of 597A batch processing Job named 'data-migration' is failing because the container image has a bug that causes a segmentation fault on startup. You notice that the cluster is repeatedly attempting to run this Job, creating new Pods every few seconds, which is exhausting the IP pool of your VPC. You want to limit the number of failed attempts to exactly 4 before Kubernetes stops trying to execute the Job. Which parameter in the Job specification must be configured?

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

    Show answer & explanation

    Correct answer: C. Configure the 'backoffLimit' field in the Job spec to 4 to define the maximum number of retries before the Job is marked as failed

    The backoffLimit field defines the exact number of retries allowed before the Job controller marks it as failed. The activeDeadlineSeconds parameter restricts total execution time but fails to reliably limit the number of failed Pod attempts.

  217. Question 217 of 597A production Pod named worker-pro is experiencing intermittent issues where the main application process becomes unresponsive, but the container remains in a Running state. Standard logs retrieved via the logs command do not provide enough information to diagnose the internal state of the filesystem or current network connections. You need to perform a live inspection of the environment without modifying the existing Pod manifest or forcing a restart of the production workload. Correct answer

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

    Show answer & explanation

    Correct answer: A. Run the kubectl debug command to attach an ephemeral container with a specialized image to the existing Pod instance

    Using kubectl debug to attach an ephemeral container is the standard way to troubleshoot running Pods without modifying their spec. Using exec to install tools directly often fails on distroless images and dangerously alters the production environment.

  218. Question 218 of 597A security audit requires that a specific Pod named 'vault-connector' in the 'finance' namespace should have its root filesystem mounted as read-only to prevent unauthorized modification of the container image at runtime. However, the application still needs to write temporary logs to the directory /var/log/app. Which combination of SecurityContext and Volume settings achieves this requirement?

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

    Show answer & explanation

    Correct answer: D. Set readOnlyRootFilesystem: true in the container securityContext and mount an emptyDir volume at /var/log/app

    Setting readOnlyRootFilesystem to true blocks writes to the root filesystem, while an emptyDir volume provides writable temporary storage for logs. For the exam, remember that a read-only root still needs explicit volume mounts for writable paths.

  219. Question 219 of 597An application pod is configured to run as a non-privileged user with UID 1005 for security compliance. This pod mounts a PersistentVolumeClaim at /data to store transaction logs. However, the application fails to start because it lacks write permissions to the /data directory, which is currently owned by the root user. You must ensure the mounted volume is accessible to the application user without manually changing permissions on the underlying storage nodes.

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

    Show answer & explanation

    Correct answer: D. Define the fsGroup field with the value 1005 within the pod-level securityContext specification

    The fsGroup field in the pod securityContext automatically changes mounted volume ownership to the specified group. Option A only changes the user, but without group ownership of the volume, the user still cannot write to the directory.

  220. Question 220 of 597A specialized network diagnostic tool needs to be deployed as a Pod to monitor packet loss. The container requires the ability to create raw network sockets, which is normally restricted for security reasons. Your organization follows the principle of least privilege and does not allow containers to run as 'privileged'. How should you configure the Pod manifest to grant only the necessary permission?

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

    Show answer & explanation

    Correct answer: D. Modify the container's securityContext by adding 'CAP_NET_RAW' to the 'capabilities' list and ensuring 'allowPrivilegeEscalation' is set to false.

    Adding CAP_NET_RAW to the container securityContext capabilities grants raw socket access without full root privileges. Option C violates the principle of least privilege by making the entire container privileged.

  221. Question 221 of 597You are tasked with exposing a backend management portal via an Ingress resource. The security policy requires that the connection between the client and the Ingress controller must be encrypted using TLS. You have been provided with a certificate file (tls.crt) and a private key (tls.key). You need to ensure the Ingress controller correctly identifies and uses these credentials for the host management.corp.com.

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

    Show answer & explanation

    Correct answer: D. Create a Secret of type kubernetes.io/tls and reference its name in the tls section of the Ingress manifest

    Creating a Secret of type kubernetes.io/tls and referencing it in the Ingress tls block is the standard method for configuring Ingress TLS. Option B fails because ConfigMaps cannot securely store private keys.

  222. Question 222 of 597A data processing company runs a daily cleanup Job to prune old database records. Due to occasional database locks, the Job might fail. The engineering lead requires that the Job should retry failures but give up after 4 failed attempts to prevent infinite loops. Additionally, the Job must not run for longer than 30 minutes (1800 seconds), even if it is still attempting retries. Which Job configuration parameters should be used to meet these two requirements?

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

    Show answer & explanation

    Correct answer: D. Configure backoffLimit: 4 to restrict retries and activeDeadlineSeconds: 1800 to enforce a hard time limit.

    The backoffLimit restricts retry attempts, while activeDeadlineSeconds enforces a hard timeout across the entire Job lifecycle. Option A only restarts containers but does not limit the overall Job retries correctly.

  223. Question 223 of 597A production Pod running a critical API is based on a 'distroless' image, which contains no shell (sh/bash), no package manager, and no troubleshooting tools like curl or netstat. The Pod is experiencing intermittent connection timeouts to a backend service. An administrator needs to inspect the network environment and run 'tcpdump' inside the Pod's network namespace without restarting or modifying the existing Pod. What is the most effective way to accomplish this?

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

    Show answer & explanation

    Correct answer: B. Use 'kubectl debug' to create an ephemeral container using a diagnostic image that shares the target Pod's network namespace.

    Ephemeral containers attached via kubectl debug share the target pod's network namespace. This provides diagnostic tools for distroless images without altering the original deployment or restarting the application.

  224. Question 224 of 597A microservices architecture requires strict network isolation to protect sensitive data. The 'orders-db' Pod in the 'database' namespace should only accept traffic on port 5432 from Pods labeled 'app=web-shop' located in the 'frontend' namespace. You must ensure that no other traffic from any other namespace or local Pod can reach the database. How should you define the ingress rule in the NetworkPolicy? Correct answer

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

    Show answer & explanation

    Correct answer: A. Use a single from element containing both a podSelector and a namespaceSelector to match both criteria simultaneously

    Placing podSelector and namespaceSelector in the same element applies an AND logic. This ensures only pods matching the label within the specific namespace can access the database.

  225. Question 225 of 597A legacy enterprise Java application is being migrated to a Kubernetes cluster. The application takes approximately 180 seconds to initialize its internal cache and start its HTTP listener. Once running, the application is known to occasionally enter a deadlock state where the process is alive but stops responding to all traffic. If a standard Liveness Probe is used with a long initialDelaySeconds, the application is not protected during the startup phase. Which configuration ensures the application is not killed during startup but is restarted if it deadlocks later?

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

    Show answer & explanation

    Correct answer: B. Configure a Startup Probe with a failureThreshold of 30 and a periodSeconds of 10 to allow sufficient time before Liveness Probes take over.

    A Startup Probe disables Liveness Probes until it succeeds, allowing slow applications to boot safely without triggering false restarts. On the exam, remember that failureThreshold multiplied by periodSeconds defines the maximum startup time window.

  226. Question 226 of 597An organization is migrating a microservice named order-processor to Kubernetes. This service needs to communicate with an external Oracle database hosted on-premises, outside the Kubernetes cluster. The database is reachable via the hostname db.internal.company.com. To simplify application configuration and allow for future migration of the database into the cluster, you want to create a Kubernetes Service that acts as a local alias for this external database.

    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 db.internal.company.com

    Creating a Service of type ExternalName correctly provides a local DNS alias for an external resource. This approach avoids manual endpoint management and seamlessly routes internal cluster traffic to the specified external database hostname.

  227. Question 227 of 597Your team is migrating a microservice architecture to Kubernetes. One of the microservices needs to connect to an external Oracle database that is currently hosted on a physical server outside the Kubernetes cluster. The developers want to use the DNS name 'internal-db' in their connection string so that when the database is eventually migrated into the cluster, no code changes are required. Which Kubernetes Service type facilitates this requirement? Correct answer

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

    Show answer & explanation

    Correct answer: A. A Service of type ExternalName with the 'externalName' field set to the FQDN of the external database server.

    An ExternalName Service maps a cluster DNS name to an external DNS name via a CNAME record. This abstraction decouples the application from the backend location, so code remains unchanged if the database moves.

  228. Question 228 of 597A DevOps engineer recently updated a deployment named order-manager from version v1.2 to v1.3. After the update, the application started throwing database connection errors. The engineer tried to fix it by applying a new configuration, which created version v1.4, but the issue persisted. You need to immediately restore the deployment to the stable state it was in at version v1.2, which is stored as revision 1 in the rollout history.

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

    Show answer & explanation

    Correct answer: D. Execute the command kubectl rollout undo deployment order-manager –to-revision=1 to target the specific stable state

    The –to-revision flag reverts a Deployment to a specific historical revision. A standard undo only goes back one revision, which fails here because the immediately preceding revision was also broken.

  229. Question 229 of 597A microservice requires a database password to function. The password is stored in a Kubernetes Secret named 'db-credentials' with the key 'password'. You need to ensure this password is available to the container as an environment variable named 'DATABASE_PASSWORD'. Additionally, if the Secret is updated, you want the Pod to reflect the new value only when it is restarted, without modifying the Deployment YAML again. Which configuration snippet achieves this correctly?

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

    Show answer & explanation

    Correct answer: C. env: – name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: db-credentials key: password

    Using valueFrom with secretKeyRef injects the key as an environment variable during container startup. Mounted volumes update dynamically, but environment variables only reflect Secret updates when the Pod restarts.

  230. Question 230 of 597A shared development namespace is experiencing stability issues because some Pods are deployed without resource requests, leading to CPU starvation for other workloads. You need to ensure that every new Pod created in the 'dev-namespace' is automatically assigned a default CPU request of 100m and a memory request of 128Mi if the developer does not specify them in the manifest. Which object must you create?

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

    Show answer & explanation

    Correct answer: C. Create a LimitRange object in the 'dev-namespace' specifying the default and defaultRequest values for CPU and memory resources.

    A LimitRange sets default compute requests and limits for individual containers in a namespace. A ResourceQuota restricts total namespace consumption but does not assign default values to unconfigured Pods.

  231. Question 231 of 597A developer is troubleshooting a data-processing Pod named batch-job-v2 that consists of two containers: an 'app-container' that processes files and a 'logger-sidecar' that ships logs to a central server. The developer notices that the Pod has been restarted 5 times. You need to inspect the logs of the 'app-container' from the previous failed instance to determine if a specific file-not-found error caused the crash. Which command should you execute?

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

    Show answer & explanation

    Correct answer: C. kubectl logs batch-job-v2 -c app-container –previous

    The –previous flag retrieves logs from the last terminated instance of a container. Omitting the container name fails here because a multi-container Pod requires explicitly specifying the target container.

  232. Question 232 of 597You are modernizing a legacy application by wrapping it in a Kubernetes Pod. The legacy application only supports HTTP and is hardcoded to listen only on localhost (127.0.0.1) at port 8080 for security. You need to expose this application to the rest of the cluster via an HTTPS-enabled sidecar container that acts as a reverse proxy. How do the two containers within the same Pod communicate with each other?

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

    Show answer & explanation

    Correct answer: B. The sidecar container can reach the legacy application by connecting to 127.0.0.1:8080 because they share the same network namespace.

    Containers inside the same Pod share the same network namespace, meaning they interact using localhost. The sidecar can proxy external cluster traffic to the legacy loopback application without code changes.

  233. Question 233 of 597Your organization is deploying a stateful application that runs as a specific non-root user with UID 5000. The application needs to write logs and temporary data to a volume mounted from a PersistentVolume. However, the volume's underlying storage arrives with root permissions, and the application container cannot write to it. You are not allowed to use privileged containers or run as root. Which securityContext setting at the Pod level allows the container to access the volume? Correct answer

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

    Show answer & explanation

    Correct answer: A. Set fsGroup: 6000 under the Pod-level securityContext to allow Kubernetes to change the ownership of the volume.

    Setting fsGroup in the Pod securityContext changes the mounted volume ownership to the specified group. Kubernetes handles this permission change, allowing the non-root UID to write files without privileges.

  234. Question 234 of 597A developer needs to inject 50 different configuration parameters from a ConfigMap named 'app-settings' into a container. The developer wants to ensure that if new parameters are added to the ConfigMap in the future, they are automatically available as environment variables in the container without needing to update the Deployment manifest. Which technique should be used?

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

    Show answer & explanation

    Correct answer: D. Use the envFrom field in the container specification and reference the app-settings ConfigMap via configMapRef.

    Using envFrom with configMapRef populates the environment with all current ConfigMap keys. Listing individual keys is tedious and requires manifest updates whenever new configuration parameters are introduced.

  235. Question 235 of 597Your team is building a client-side microservice that must communicate with a remote legacy banking API. The remote API requires every request to be authenticated via a mutual TLS (mTLS) handshake with a unique certificate. To avoid embedding complex SSL/TLS logic into the microservice code, you decide to use a proxy that handles the authentication and encryption transparently for the application. Which configuration represents this implementation? Correct answer

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

    Show answer & explanation

    Correct answer: A. Deploy an Ambassador container in the same Pod that accepts plain HTTP traffic from the main container on localhost and proxies it to the API using mTLS.

    The Ambassador pattern uses a helper container to proxy outbound requests and offload complex configurations. Because containers share a network namespace, the application sends plain local traffic, which the Ambassador secures.

  236. Question 236 of 597An enterprise legacy application is being containerized. It is designed to listen only on the loopback interface (127.0.0.1) for security reasons and cannot be reconfigured to listen on all interfaces (0.0.0.0). However, the application must be accessible to other microservices within the cluster. You decide to use a Sidecar container pattern to resolve this. What is the technical reason why a Sidecar container can help the legacy application receive traffic from the cluster network?

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

    Show answer & explanation

    Correct answer: D. Containers in the same Pod share the same Network namespace, allowing them to communicate via 'localhost' and share the same IP address

    Containers within a Pod share the same network namespace and IP address. This allows the sidecar to listen on external interfaces and forward incoming cluster traffic to the loopback application locally.

  237. Question 237 of 597A batch processing system needs to handle 100 independent work items. Each item takes about 30 seconds to process. To finish the work quickly without overwhelming the cluster, the system should process 10 items at a time. If a specific task fails, it should be retried up to 5 times before the entire Job is marked as failed. How should the Kubernetes Job manifest be configured to meet these requirements?

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

    Show answer & explanation

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

    Setting completions to 100 and parallelism to 10 properly distributes the workload, while backoffLimit handles the retries. Avoid using Deployments for batch processing, as they lack native completion tracking.

  238. Question 238 of 597A security-sensitive application requires two specific TLS certificate files, 'tls.crt' and 'tls.key', to be present in the /etc/certs directory. These files are stored in a Kubernetes Secret named 'api-certs'. The application is designed to run as a specific user and requires that the secret files be mounted with highly restrictive permissions (read-only for the owner, no permissions for others). How should you configure the Volume and VolumeMount in the Pod specification to meet these security and path requirements?

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

    Show answer & explanation

    Correct answer: D. Mount the Secret using a volume with a defaultMode of 0400 and specify the mountPath as /etc/certs in the volumeMounts section.

    Using defaultMode 0400 restricts file access to the owning user, satisfying the strict security requirement. Environment variables do not mount as files, and hostPath volumes are not recommended for secrets.

  239. Question 239 of 597An analytics company needs to process a batch of 100 historical data files. Each file takes roughly 5 minutes to process, and the entire task must be completed as quickly as possible. The processing script is packaged in a container that takes a file index as an argument. You decide to use a Kubernetes Job to manage this. You want to ensure that exactly 100 successful completions occur and that the cluster processes 10 files simultaneously at any given time. Which combination of Job spec fields should you configure to meet these performance and reliability requirements?

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

    Show answer & explanation

    Correct answer: B. Set the completions field to 100 and the parallelism field to 10 to control the total work and the number of concurrent pods.

    The completions field defines the total successful pods needed, and parallelism dictates how many run concurrently. Swapping the values would create ten completions running one hundred pods at once.

  240. Question 240 of 597A data-processing Pod that writes temporary files to a volume. The container runs as a non-root user with UID 1001. The volume being mounted requires the files to be owned by a specific Group ID (GID 2000) for the storage backend to permit writes. Furthermore, for security reasons, the container must be prevented from ever gaining root privileges through setuid binaries. How should the securityContext be defined?

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

    Show answer & explanation

    Correct answer: A. Set fsGroup to 2000 and runAsUser to 1001 in the Pod's securityContext, and set allowPrivilegeEscalation to false in the container's securityContext.

    Setting fsGroup ensures the mounted storage is writable by the specified group, while allowPrivilegeEscalation blocks setuid exploits. Init containers are less ideal because they require manual permission changes.

  241. Question 241 of 597A microservice named inventory-api is experiencing intermittent failures where it remains in a Running state but stops responding to HTTP requests because of an internal deadlock. The application exposes a health check endpoint at /healthz on port 8080. You need to configure the Pod so that Kubernetes automatically restarts the container whenever this endpoint fails to respond for more than 3 consecutive checks, with each check occurring every 10 seconds.

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

    Show answer & explanation

    Correct answer: D. Configure a Liveness Probe with periodSeconds set to 10 and failureThreshold set to 3

    A Liveness Probe detects deadlocks and triggers a container restart after three failed attempts. A Readiness Probe only removes the Pod from service endpoints, but it does not restart the stuck container.

  242. Question 242 of 597Your organization is moving a web application to Kubernetes, but the SQL database remains on a legacy on-premises server with the static IP 10.50.10.25. You want the application to use the hostname 'db-service' so that when the database is eventually migrated into the cluster, you won't need to change the application's configuration code. How should you expose the external database inside the cluster?

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

    Show answer & explanation

    Correct answer: A. Define a Service with no selector and manually create an Endpoints object pointing to the IP 10.50.10.25

    Creating a selectorless Service with a manual Endpoints object provides a stable internal DNS record for external IPs. Ingress resources are intended for HTTP routing to cluster services, not proxying external databases.

  243. Question 243 of 597You are managing a multi-tenant cluster where the 'payment-prod' namespace contains sensitive transaction APIs and the 'frontend-prod' namespace contains the web interface. To follow the principle of least privilege, you need to ensure that only Pods with the label 'role: web-ui' in the 'frontend-prod' namespace are allowed to communicate with Pods labeled 'role: api' in the 'payment-prod' namespace on port 443. All other traffic from any namespace to the payment APIs must be blocked. Which NetworkPolicy configuration correctly implements this requirement?

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

    Show answer & explanation

    Correct answer: C. A NetworkPolicy in the payment-prod namespace with an Ingress rule combining a namespaceSelector for frontend-prod and a podSelector for role: web-ui.

    Applying an Ingress NetworkPolicy in the target namespace isolates those Pods, and combining selectors restricts access precisely. A podSelector alone would allow traffic from any namespace matching the labels.

  244. Question 244 of 597A high-performance analytics application needs to register its unique Pod IP with an external legacy monitoring system immediately after the container starts. The development team wants to ensure this registration script runs as soon as the main container is created, without modifying the existing application container image or entrypoint script. The script should run in the same context as the application but at the very beginning of its lifecycle.

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

    Show answer & explanation

    Correct answer: A. Configure a postStart lifecycle hook within the container specification to execute the registration script.

    The postStart hook executes immediately after the container is created, handling registration without modifying the image. Init containers run before the main container starts, so they cannot access its environment.

  245. Question 245 of 597A legacy Java application is known to experience occasional internal deadlocks. During these deadlocks, the process continues to run and the TCP port remains open, but the application stops responding to functional requests at the '/health' endpoint. The application takes about 30 seconds to start up. You need to configure a mechanism that automatically restarts the container when it detects this deadlock state while ensuring the application isn't killed during its initial boot phase. Which configuration is most appropriate?

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

    Show answer & explanation

    Correct answer: B. Define a Startup Probe targeting the /health endpoint and a Liveness Probe that starts only after the Startup Probe succeeds

    A Startup Probe protects slow-starting applications by disabling Liveness checks until the container is ready. Relying on initialDelaySeconds requires guessing the exact startup time, risking premature container restarts.

  246. Question 246 of 597A data analytics application requires a large static lookup dataset of approximately 2GB to be downloaded from a secure remote storage and unpacked into a shared directory before the main compute engine starts. The main container is a highly optimized, minimal image that lacks utilities like curl, wget, or tar. You must ensure the main container only starts once the data is fully available and verified in the shared volume at /data/lookup. Which configuration approach satisfies these requirements while following Kubernetes best practices?

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

    Show answer & explanation

    Correct answer: D. Define an initContainer that uses a utility-rich image to download and unpack the data into an emptyDir volume shared with the main application container.

    Init containers run sequentially before the main application, making them perfect for preparing shared volumes with required tools. Sidecars run concurrently, risking application crashes if the data is not yet available.

  247. Question 247 of 597A developer is attempting to deploy a new microservice in the 'development' namespace. The Deployment manifest requests 2 CPU cores and 4Gi of memory for each of its 3 replicas. However, the Pods remain in a 'Pending' state. Upon inspection, you find that the namespace has a ResourceQuota that limits total memory usage to 10Gi. There are already other Pods in the namespace consuming 2Gi of memory. What is the most likely reason the new Pods are not scheduling, and how should it be resolved?

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

    Show answer & explanation

    Correct answer: A. The total memory request (12Gi) plus existing usage (2Gi) exceeds the namespace quota of 10Gi. You should reduce the replicas or the memory requests per Pod.

    The Deployment requests 12Gi of memory, which exceeds the 10Gi namespace quota when combined with the 2Gi already in use. ResourceQuotas strictly enforce total namespace consumption. Increasing node capacity does not override namespace quotas.

  248. Question 248 of 597You are managing a critical web application and need to restrict network traffic for a specific Pod named 'api-server' in the 'prod' namespace. The Pod should only be allowed to communicate with the CoreDNS service in the 'kube-system' namespace for name resolution and to a specific 'database' Pod in the 'data' namespace on port 5432. All other outbound (egress) traffic must be blocked. Which strategy correctly achieves this?

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

    Show answer & explanation

    Correct answer: B. Define an egress NetworkPolicy with two rules: one matching the kube-system namespace and DNS port, and another matching the data namespace and database port.

    Defining an egress network policy with specific namespace and port selectors restricts outbound traffic precisely to DNS and database endpoints. Any egress traffic not explicitly matched by these rules is automatically blocked, ensuring strict network isolation.

  249. Question 249 of 597A legacy stateful application is being deployed via a Deployment controller and uses a PersistentVolumeClaim (PVC) backed by a storage class that only supports the ReadWriteOnce (RWO) access mode. During a rolling update, the new Pods are stuck in a Pending state with the error 'Multi-Attach error' because the old Pods are still holding the volume mount. How should you modify the Deployment strategy to ensure a successful update process?

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

    Show answer & explanation

    Correct answer: D. Configure the strategy type of the Deployment to Recreate to ensure all old Pods are terminated before the new version is scheduled.

    The Recreate strategy terminates all existing Pods before starting the new ones, ensuring the RWO volume is fully released. Remember that RollingUpdate is the default, but it fails here because it tries to run the new Pod concurrently.

  250. Question 250 of 597A data analytics application requires a 2GB lookup table to be present on the local disk before the main process starts. This file must be downloaded from a remote HTTPS server. To keep the production container image lightweight, you decide not to include 'curl' or 'wget' in the main application image. How can you ensure the file is available for the application container at startup using Kubernetes native features?

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

    Show answer & explanation

    Correct answer: B. Add an InitContainer with a lightweight image containing 'wget' to download the file into a shared EmptyDir volume that is also mounted by the main container.

    Init containers run to completion before the main application container starts, making them perfect for setup tasks. By saving the file to a shared EmptyDir volume, the main container immediately accesses the required data.

  251. Question 251 of 597Your organization has a strict security policy that allows the 'order-api' pods in the 'sales' namespace to communicate with an external third-party payment gateway at the specific IP address 203.0.113.10. However, for security compliance, all other egress traffic to the rest of the 203.0.113.0/24 subnet must be strictly blocked to prevent data exfiltration to unauthorized endpoints within that range.

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

    Show answer & explanation

    Correct answer: C. Create a NetworkPolicy with an egress rule using an ipBlock that defines the CIDR 203.0.113.10/32.

    Using an ipBlock set to 203.0.113.10/32 permits traffic only to that single IP address. A default deny egress policy then blocks all other subnet traffic, fulfilling the strict security compliance requirements.

  252. Question 252 of 597A data-intensive microservice in your production environment requires a specific database schema to be initialized and verified before the primary application process can safely start. If the main process starts before the schema is ready, it crashes and enters a CrashLoopBackOff, which disrupts the monitoring alerts. You need to implement a solution that ensures the main container only starts once a schema verification script, located in a different container image, completes successfully. What is the most efficient Kubernetes native approach to handle this dependency?

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

    Show answer & explanation

    Correct answer: D. Define an Init Container in the Pod specification that runs the verification script and completes before the main container starts

    Init containers run sequentially and must complete successfully before the main application containers ever start. Probes do not prevent startup, and sidecars run concurrently, making init containers the correct choice.

  253. Question 253 of 597The platform engineering team is managing a multi-tenant cluster where the 'dev-team-a' namespace has been consuming excessive cloud resources by creating an uncontrolled number of Services of type LoadBalancer, leading to significant cost overruns. You are tasked with implementing a hard limit that restricts the total number of LoadBalancer services that can exist in that namespace to exactly 3.

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

    Show answer & explanation

    Correct answer: B. Apply a ResourceQuota to the namespace with the 'services.loadbalancers' field set to a value of 3.

    ResourceQuotas are used to limit the total number of specific objects within a namespace. LimitRanges constrain individual resource defaults, whereas Network Policies strictly govern pod traffic.

  254. Question 254 of 597Your engineering team is deploying a stateful application that runs as a non-root user with UID 1001 for security compliance. This application needs to write data to a PersistentVolume mounted at /data/db. After deployment, the Pod logs show a 'Permission Denied' error when the application attempts to initialize the database files on the volume. The underlying storage is a standard block device. Which Pod-level configuration must be applied to ensure the container has the necessary write permissions on the mounted volume without changing the container image?

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

    Show answer & explanation

    Correct answer: A. Configure the pod-level securityContext with the fsGroup field set to 1001 to automatically change the ownership of the volume's contents.

    Setting fsGroup in the pod security context automatically alters the mounted volume ownership to match the specified group ID. This grants the non-root application user the necessary write permissions without requiring image changes.

  255. Question 255 of 597You are managing a deployment where the Pod needs to access only two specific configuration files: 'api-keys.json' and 'runtime-opts.conf'. These values are stored in a ConfigMap named 'app-config-data' which contains over 50 other unrelated keys used by different departments. To minimize the attack surface and prevent directory clutter, you must mount only these two specific keys into the directory '/etc/app/config/' inside the container. Which volume configuration should you use?

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

    Show answer & explanation

    Correct answer: A. Mount the ConfigMap as a volume and use the 'items' field to specify only the 'api-keys.json' and 'runtime-opts.conf' keys and their paths

    Using the items field within a ConfigMap volume projection specifically filters and mounts only the designated keys. This cleanly prevents unrelated ConfigMap data from cluttering the application filesystem.

  256. Question 256 of 597An enterprise is migrating a microservice to a Kubernetes cluster while the primary database remains on an on-premises physical server with the DNS record 'db.internal.company.com'. You need to provide the Pods in the cluster with a consistent way to access this database using the internal name 'data-service' without manually managing endpoint IP addresses or modifying the application code. Which Kubernetes resource configuration meets this requirement?

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

    Show answer & explanation

    Correct answer: A. Create a Service of type ExternalName in the same namespace and set the externalName field to 'db.internal.company.com'.

    An ExternalName service acts as a DNS alias, seamlessly routing internal cluster requests to an external domain name. This avoids the manual endpoint maintenance required by headless services.

  257. Question 257 of 597Your organization has a strict isolation policy. A sensitive database application is running in the 'secure-db' namespace. You must ensure that only Pods located in the 'frontend-apps' namespace are allowed to initiate connections to the database on port 5432. All other traffic, including traffic from within the 'secure-db' namespace itself or other namespaces, must be blocked by default. Which NetworkPolicy configuration correctly implements this requirement? Correct answer

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

    Show answer & explanation

    Correct answer: A. A policy in the 'secure-db' namespace with an ingress rule that uses a namespaceSelector matching the 'frontend-apps' labels

    NetworkPolicies are applied in the target namespace to control incoming traffic. A namespaceSelector in the ingress rule restricts access so only pods from frontend-apps can connect. Options using podSelector across namespaces fail without exact labels.

  258. Question 258 of 597You are conducting a canary deployment for a new version of the 'user-profile' service. You want to route approximately 10% of the traffic to the new version (v2) while keeping 90% on the stable version (v1). Both versions are managed by separate Deployments. You decide to use a standard Kubernetes Service to distribute the traffic. How can you achieve this 10/90 split using basic Kubernetes objects?

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

    Show answer & explanation

    Correct answer: C. Label both sets of Pods with 'app=user-profile' and set the v1 Deployment to 9 replicas and the v2 Deployment to 1 replica

    Standard Kubernetes Services balance traffic randomly across all matching pods. Matching labels with a nine-to-one replica ratio naturally yields the desired ten percent split. Services do not support assigning custom weights to multiple selectors.

  259. Question 259 of 597You are managing a microservice named order-api in the production namespace. The security team has requested a NetworkPolicy that restricts all outbound (egress) traffic. The Pods must only be allowed to communicate with the internal CoreDNS service (usually on port 53) and an external payment gateway located at the IP address 203.0.113.15 on port 443. Any other outbound connection must be blocked. Which configuration logic should be used in the egress rule?

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

    Show answer & explanation

    Correct answer: B. Define an egress rule with an ipBlock allowing 203.0.113.15/32 on port 443, and another rule allowing traffic to the kube-system namespace on port 53.

    Egress policies require explicit allowances for all destination IP addresses and ports. Defining an ipBlock for the external gateway and a namespace selector for DNS traffic enforces the required boundaries. Broad allowances violate the strict security request.

  260. Question 260 of 597gRPC Health Probes. A specialized microservice uses gRPC for high-performance communication. During peak hours, the application occasionally experiences an internal thread starvation issue where the gRPC server stops responding to new requests, although the underlying container process remains running. You need to configure a mechanism that ensures Kubernetes automatically restarts the container only when this specific gRPC service becomes unresponsive, without relying on legacy HTTP or shell-based checks. Which configuration approach should you implement in the Pod manifest?

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using the grpc field to specify the port and service name for the built-in Kubernetes gRPC health checking protocol.

    A liveness probe configured with the native grpc field detects unresponsive services and triggers a container restart. Startup probes only safeguard the initialization phase, while readiness probes merely remove pods from service endpoints without restarting them.

  261. Question 261 of 597A specialized microservice requires a specific API key to be passed in an HTTP header for its health check endpoint '/healthz'. If the header 'X-Health-Check-Key' is missing or contains an incorrect value, the application returns a 403 Forbidden status. You must configure the pod to use this endpoint for readiness checks to ensure it only receives traffic when the application logic is fully functional and authenticated.

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

    Show answer & explanation

    Correct answer: D. Use the 'httpGet' handler in the readinessProbe and define the 'httpHeaders' field with the required name and value.

    The httpGet probe natively supports custom headers via the httpHeaders field, passing the required authentication key during checks. A TCP socket probe cannot send HTTP headers, making it unsuitable for an endpoint requiring specific authentication values.

  262. Question 262 of 597Your team is deploying a secure database client Pod that requires a specific TLS certificate to communicate with a remote database. This certificate is stored in a Kubernetes Secret named db-certs. Additionally, the application requires an API_URL environment variable from a ConfigMap named cluster-info. The application container must run as a non-privileged user with UID 1001 to comply with the organizational security policy. How should these requirements be configured in the Pod manifest?

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

    Show answer & explanation

    Correct answer: C. Mount the Secret as a volume, use valueFrom for the environment variable, and set runAsUser to 1001 in the securityContext

    Mounting sensitive files as volumes and injecting non-sensitive variables via valueFrom follows core configuration principles. Setting runAsUser inside the securityContext correctly enforces the required user ID constraint. Hardcoding secrets or running privileged containers violates security standards.

  263. Question 263 of 597A legacy application is migrating to Kubernetes but lacks the ability to handle modern mutual TLS (mTLS) or complex retry logic for its connection to an external payment gateway. You decide to implement a pattern where the main container communicates with a local proxy in the same Pod, which then handles the secure connection and specialized protocols to the external service. Which structural pattern are you using?

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

    Show answer & explanation

    Correct answer: B. The Ambassador pattern used to provide a specialized network proxy for connecting the application to external services

    The Ambassador pattern acts as a local proxy to manage complex external connections like mutual TLS. The Adapter pattern transforms internal output for external systems, while a Sidecar typically provides auxiliary services like centralized logging for the application.

  264. Question 264 of 597A mission-critical 'inventory-manager' service is being updated to a new version. The current infrastructure has very limited extra capacity, so the cluster can only handle a maximum of 2 extra pods during the rollout. However, the business requires that the current capacity of 10 replicas must remain 100% available at all times during the update process to ensure zero performance degradation for customers.

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

    Show answer & explanation

    Correct answer: B. Set maxSurge to 2 and maxUnavailable to 0 in the rollingUpdate strategy of the Deployment.

    Setting maxSurge to 2 permits two extra pods during the rollout, while maxUnavailable set to 0 maintains all existing replicas. If maxUnavailable were set higher, it would violate the strict requirement for continuous availability.

  265. Question 265 of 597Batch Job Deadlines. You are managing a data processing pipeline that uses Kubernetes Jobs to process large video files. Occasionally, the processing logic enters an infinite loop or stalls due to corrupted input data, causing the Job to consume resources indefinitely and preventing subsequent Jobs from starting. You need to ensure that any individual Job pod is terminated and marked as failed if it does not complete its task within 1800 seconds. Which specific field in the Job specification must be configured to enforce this hard timeout?

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

    Show answer & explanation

    Correct answer: D. Set the activeDeadlineSeconds field to 1800 in the Job's spec section to limit the total duration of the Job regardless of how many pods it creates.

    The activeDeadlineSeconds field enforces a hard timeout on the entire Job duration. When this limit is reached, Kubernetes terminates all running pods and marks the Job as failed. Other options fail to stop runaway processes reliably.

  266. Question 266 of 597A Kubernetes Job is configured to process a large dataset. Due to intermittent network instability in the cluster environment, the Pods frequently fail during their first few attempts. You want the Job to keep retrying the execution, but it must give up and mark the entire task as failed if it does not succeed within 8 attempts in total across all pod failures.

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

    Show answer & explanation

    Correct answer: D. Specify the 'backoffLimit' field in the Job specification and set its value to 8.

    The backoffLimit field specifies the number of retries allowed before a Job is marked as failed. Setting it to 8 ensures the task gives up after eight unsuccessful attempts. The completions field controls parallelism rather than failure retries.

  267. Question 267 of 597A high-traffic microservice named order-processor is running in your production cluster with a Deployment and a Service. You have been asked to implement a basic canary deployment where approximately 10% of the traffic is routed to a new version, v2.0.0, while the rest remains on v1.0.0. You want to achieve this using standard Kubernetes Service load balancing features without the assistance of an Ingress controller or a Service Mesh. Which configuration strategy allows you to distribute traffic based on this specific ratio while maintaining the same Service endpoint?

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

    Show answer & explanation

    Correct answer: B. Create a second Deployment for v2.0.0 with the same labels as the v1.0.0 pods and scale the v1.0.0 Deployment to 9 replicas and the v2.0.0 Deployment to 1 replica.

    Kubernetes Services load balance randomly across matching Pod endpoints. Deploying the v2 version with identical labels and scaling it to a 1:9 ratio with v1 guarantees roughly ten percent of traffic. Other strategies cannot guarantee exact traffic ratios.

  268. Question 268 of 597Your organization is implementing a Blue-Green deployment strategy for a critical stateless web service. You have already deployed the new version (Green) as a separate Deployment with the label version: v2, while the current version (Blue) is running with version: v1. Both deployments are currently active in the cluster. You need to perform the final switch so that the existing Service named web-service starts sending 100% of the production traffic to the Green deployment.

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

    Show answer & explanation

    Correct answer: C. Modify the selector of the web-service Service to match the labels of the Green deployment

    Switching the Service selector is the standard method for Blue-Green deployments because it instantly redirects traffic to the new Pods. Deleting the Blue deployment defeats the purpose of maintaining a quick rollback path.

  269. Question 269 of 597A complex data processing application consists of multiple containers. The main application container should only start its execution after a backend database service named 'db-service' is fully reachable on port 5432. You want to implement a robust check that delays the main container startup and ensures the environment is ready without modifying the main application's code.

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

    Show answer & explanation

    Correct answer: A. Add an initContainer with a script that uses a tool like 'nc' or 'pg_isready' to loop until the database port is reachable.

    Init containers run sequentially to completion before the main application containers start. A livenessProbe fails if the database is down, but it needlessly restarts the entire Pod instead of waiting gracefully.

  270. Question 270 of 597A mission-critical Deployment named payment-processor currently runs with 20 replicas. To ensure service stability during a version upgrade, the business requires that at least 80% of the desired replicas remain available at all times. Furthermore, to prevent resource exhaustion on the nodes during the update, the total number of Pods (current + new) must never exceed 125% of the desired replica count. How should the rollingUpdate strategy be configured in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: B. Set maxUnavailable to 20% and maxSurge to 25% within the rollingUpdate strategy section of the Deployment specification.

    Using percentages directly fulfills the requirement and scales appropriately if the replica count changes. Hardcoding the numbers works today but breaks the requirement if the deployment later scales.

  271. Question 271 of 597You are configuring an Ingress resource to expose two different services, 'inventory-svc' and 'billing-svc', under the domain 'internal.example.com'. The security policy requires that all traffic be encrypted using TLS. You have a single Secret named 'example-tls' containing the certificate and private key for the domain. How should the Ingress spec be structured to ensure both services are protected by TLS on the same hostname?

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

    Show answer & explanation

    Correct answer: A. Add a 'tls' block in the Ingress spec with a list containing the 'example-tls' secret name and the 'internal.example.com' host, and define both paths in the rules section.

    A single Ingress can secure multiple paths under the same hostname by referencing the TLS secret once. Splitting the configuration into separate Ingress resources is unnecessary and adds management overhead.

  272. Question 272 of 597Your team is deploying a mission-critical banking API that must maintain 100% availability during updates. The cluster is currently at 95% resource utilization, meaning you cannot spawn additional Pods during the rollout due to node capacity limits. You need to configure the Deployment to ensure that the update replaces existing replicas one by one without ever exceeding the current resource allocation. Which strategy configuration is correct? Correct answer

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

    Show answer & explanation

    Correct answer: A. Configure a RollingUpdate strategy with maxSurge set to 0 and maxUnavailable set to 1

    Setting maxSurge to zero prevents Kubernetes from creating any extra Pods during the rollout, respecting the strict capacity limits. Configuring maxUnavailable to one allows the strategy to terminate an old Pod first, freeing resources for the new one.

  273. Question 273 of 597A machine learning engineering team is deploying a heavy inference workload in a production namespace. The main application container requires 8 CPU cores and 16GB of RAM to process requests efficiently. However, before it can start, an init container must download a 12GB model dataset from a remote object storage. The team is concerned about cluster resource allocation because the init container also requests 8 CPU cores, causing scheduling delays during scale-out events. Which strategy effectively optimizes resource utilization for this Pod?

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

    Show answer & explanation

    Correct answer: D. Set lower resource requests for the init container as Kubernetes calculates Pod scheduling based on the highest of init vs. main containers.

    Kubernetes calculates Pod scheduling based on the maximum of either the init containers or the sum of the app containers. Lowering the init container requests means the main app container dictates the resources, preventing artificial scheduling delays.

  274. Question 274 of 597Controlled Deployment readiness. You are deploying a critical update to a service named 'order-processor'. The application has a complex internal caching mechanism that takes about 45 seconds to warm up after the process starts. If the Deployment sends traffic to the new pods before the cache is warm, the database will be overwhelmed by a surge of requests. You need to ensure the Deployment waits an additional 60 seconds after the readinessProbe succeeds before considering the Pod available and moving to the next replica. Which Deployment field should you use?

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

    Show answer & explanation

    Correct answer: C. Set the minReadySeconds field in the Deployment spec to 60 to specify the minimum time a new Pod must stay in the Ready state before it is considered available.

    The minReadySeconds field ensures a Pod remains ready for a specified duration before the Deployment proceeds. Option B delays health checks but does not guarantee a wait after readiness is achieved.

  275. Question 275 of 597Shared Storage Security. A stateful application consists of three replicas that must all read from and write to a shared persistent volume mounted at /data/shared. The application runs as a non-root user with UID 1050. During testing, you find that the application fails to write to the volume because the volume is mounted with root permissions by default. You must ensure the application has proper write access while maintaining the principle of least privilege. Which SecurityContext setting should you apply at the Pod level?

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

    Show answer & explanation

    Correct answer: B. Configure fsGroup to 1050 in the PodSpec's securityContext to allow Kubernetes to change the ownership of the volume to be accessible by that group ID.

    Setting fsGroup in the pod security context automatically changes the ownership of mounted volumes to the specified group ID. This allows non-root containers to read and write files without escalating privileges or running as root.

  276. Question 276 of 597A web application has a tendency to occasionally enter a state where it still responds to TCP connections on port 8080, but its internal processing logic is deadlocked, causing it to return a 500 Internal Server Error for every request. A standard TCP liveness probe would fail to detect this condition since the port remains open. You need to implement a liveness probe that specifically checks the /healthz endpoint and considers the application unhealthy if it does not return a 200 OK status within 3 seconds. Which configuration should be used? Correct answer

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

    Show answer & explanation

    Correct answer: A. An httpGet probe targeting port 8080 and path /healthz, with a timeoutSeconds value set to 3.

    An httpGet probe specifically inspects HTTP response codes to determine application health. The timeoutSeconds field ensures that deadlocked applications failing to respond within the required timeframe are correctly marked as unhealthy.

  277. Question 277 of 597A microservice experiences intermittent memory leaks that cause it to slow down significantly after 24 hours of operation. When this happens, the application still responds to HTTP health checks on the '/healthz' endpoint with a 200 OK status, but it takes 15 seconds to process a request that usually takes 100ms. You want the load balancer to stop sending traffic to these slow instances. Which probe configuration is most appropriate?

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

    Show answer & explanation

    Correct answer: C. A readinessProbe with a timeoutSeconds value set to 2, which will remove the Pod from the Service's Endpoints if the response takes longer than 2 seconds.

    Readiness probes control whether a pod receives traffic from a service. Setting a low timeout value removes struggling pods from endpoints, preventing application slow-downs without forcing unnecessary restarts.

  278. Question 278 of 597A security-sensitive application needs to access an API token stored in a Kubernetes Secret named auth-token. The security policy mandates that the token must be provided as a file at the path /var/run/secrets/api/key.txt. The file must be read-only and only accessible by the container's primary process which runs with UID 1001. Additionally, no other keys from the Secret should be visible in this directory. Which volume configuration is required?

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

    Show answer & explanation

    Correct answer: C. Mount the Secret using a volume with a secretName and an items list specifying the key and path, while setting the defaultMode to 0400.

    Using an items list in the secret volume projection ensures only specific keys are mounted. Setting defaultMode to 0400 restricts file permissions, making it readable only by the assigned user ID.

  279. Question 279 of 597A nightly data cleanup Job is scheduled to run in your cluster. Under normal conditions, it finishes in 10 minutes. However, due to a known bug in the cleanup script, it occasionally enters an infinite loop, consuming CPU resources indefinitely until manually killed. You need to automate the termination of this Job if it exceeds 30 minutes to protect cluster resources. Which field should you use?

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

    Show answer & explanation

    Correct answer: C. Set the activeDeadlineSeconds field in the Job specification to 1800

    The activeDeadlineSeconds field limits the total duration a job can run. Once reached, Kubernetes terminates the pods and marks the job as failed, preventing stuck processes from wasting cluster resources.

  280. Question 280 of 597An application expects its configuration file 'settings.json' to be located in the directory '/etc/config/'. This directory already contains several critical system-generated files that must not be deleted or hidden. You need to mount a ConfigMap containing the 'settings.json' file into this directory without overwriting or obscuring the existing content. How should this be configured in the Pod specification?

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

    Show answer & explanation

    Correct answer: D. Specify the subPath field in the volumeMounts section to map the specific ConfigMap key to the desired file path

    Specifying the subPath field in the volumeMounts section mounts a single file from a volume into a directory without masking existing files. This prevents the mount from overwriting the target directory's contents, which is a critical detail for config injection.

  281. Question 281 of 597A corporate legacy application is being containerized and deployed into a Kubernetes cluster. The application is hardcoded to look for a specific configuration file at the path /etc/app/config.yaml. However, the DevOps team has stored this configuration within a Kubernetes ConfigMap named app-config-map under the key production-settings. Which volume mount configuration should be used in the Pod specification to ensure the application finds the file exactly where it expects it?

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

    Show answer & explanation

    Correct answer: D. Mount the ConfigMap to /etc/app/ and use the subPath property to map production-settings to config.yaml

    Mounting the ConfigMap to the directory and using the subPath property correctly maps a specific key to a specific file path. Without subPath, mounting a volume overwrites or hides all pre-existing files in that target directory, breaking the application.

  282. Question 282 of 597A legacy enterprise application is being containerized. It writes its security audit logs to a local file at /var/log/app/audit.log instead of stdout or stderr. The existing cluster-level logging solution only collects logs from the container's standard output. You are tasked with making these audit logs available to the logging agent without modifying the application's source code. You decide to use a sidecar container pattern. Which sidecar implementation correctly achieves this goal?

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

    Show answer & explanation

    Correct answer: B. Add a sidecar container that shares an emptyDir volume with the application container and runs the command 'tail -f /var/log/app/audit.log'.

    Adding a sidecar container that shares an emptyDir volume and tails the application log correctly forwards logs to standard output. This classic sidecar pattern bridges legacy file logging with cluster-level container logging agents without altering application code.

  283. Question 283 of 597Your engineering team is performing a manual canary release for a stateless web application. You currently have a Deployment named 'web-v1' with the label 'version: v1' and a Service named 'web-service' targeting that label. You have deployed a new Deployment 'web-v2' with the label 'version: v2'. You want the existing 'web-service' to distribute traffic across both versions simultaneously to test the stability of 'v2' with real production traffic. How should you modify the Service configuration to achieve this?

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

    Show answer & explanation

    Correct answer: B. Remove the version label from the Service selector and ensure both Deployments share a common identifying label targeted by the Service

    Removing the version label from the Service selector correctly allows it to target pods across multiple Deployments via a common label. Kubernetes Service routing does not support logical OR operations, so a shared generic label is required.

  284. Question 284 of 597A distributed database system is being deployed using a StatefulSet named data-node. Each replica in the StatefulSet needs to be able to communicate directly with other specific replicas to synchronize data and maintain cluster quorum. The replicas require stable network identifiers that do not change when the Pods are restarted. You need to configure the network resource that enables this direct pod-to-pod addressing via DNS names.

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

    Show answer & explanation

    Correct answer: B. Define a Headless Service by setting the clusterIP field to None in the Service specification

    Defining a Headless Service by setting clusterIP to None returns the individual Pod IP addresses via DNS instead of load-balancing them. This mechanism provides StatefulSet pods with the stable network identities required for peer discovery.

  285. Question 285 of 597Ingress Traffic Weighting. You are managing a web application exposed via an Ingress resource using an NGINX Ingress Controller. You have a stable production service named 'web-prod' and you have just deployed a new version as 'web-canary'. You need to route exactly 10% of the incoming traffic to the 'web-canary' service while the remaining 90% stays on 'web-prod'. How should you implement this using the Ingress resource configuration?

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

    Show answer & explanation

    Correct answer: B. Create a second Ingress resource for the canary service and use the nginx.ingress.kubernetes.io/canary-weight annotation set to '10'.

    Creating a secondary Ingress with the NGINX canary-weight annotation accurately routes a specific percentage of traffic to the new service. This is a controller-specific feature rather than standard upstream Kubernetes functionality.

  286. Question 286 of 597A batch processing application must process exactly 50 independent work items. Each item takes about 1 minute. The team wants to run up to 5 items in parallel to save time. If a single task fails, it should be retried, but if more than 4 total failures occur across the entire job, the whole job should stop and be marked as failed. What is the correct configuration for this Kubernetes Job?

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

    Show answer & explanation

    Correct answer: A. Set completions: 50, parallelism: 5, and backoffLimit: 4

    The completions field sets the total successful work items required, while parallelism controls concurrent execution. The backoffLimit specifically dictates the allowed retries before the entire Job is marked as failed.

  287. Question 287 of 597A developer needs to provide a large set of configuration parameters to a container via a ConfigMap. Instead of using dozens of individual environment variables, they want to mount the ConfigMap as a volume. They must ensure that the application cannot accidentally modify these configuration files at runtime, and that the files remain consistent with the source in the Kubernetes API.

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

    Show answer & explanation

    Correct answer: A. The volume will be mounted as read-only by default, and any attempt by the application to write to it will result in a filesystem error.

    ConfigMap-backed volumes are projected as read-only filesystems by the kubelet, preventing applications from modifying them. While using readOnly: true in volumeMounts is a valid explicit practice, the default projection behavior makes it inherently read-only.

  288. Question 288 of 597Namespace Resource Constraints: A development team is unable to create new Pods in the 'staging' namespace. When they attempt to run a simple Nginx Pod, they receive an error message: 'Forbidden: exceeded quota: pods-quota, requested: pods=1, used: pods=10, limited: pods=10'. After checking, you find there are only 5 Pods currently running. You discover that 5 failed Jobs have left their pods in the 'Completed' or 'Failed' state. What is the most efficient way to allow the team to create new Pods while keeping the history of the failed Jobs?

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

    Show answer & explanation

    Correct answer: B. Edit the ResourceQuota to increase the pods limit from 10 to 15 to accommodate the presence of terminal Pods that are still consuming quota.

    Increasing the ResourceQuota is the most direct way to resolve the immediate Forbidden error while preserving terminal Pods for auditing. A LimitRange cannot bypass a strict pods quota, and deleting the quota removes necessary guardrails.

  289. Question 289 of 597You are managing an Ingress resource for a global corporate portal. Traffic to 'portal.example.com/api' must be routed to the 'api-service', and traffic to 'portal.example.com/static' must be routed to the 'static-service'. You also need to ensure that any other requests to 'portal.example.com' that do not match these specific paths are automatically handled by a dedicated 'maintenance-service'.

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

    Show answer & explanation

    Correct answer: A. Add a path with the value '/' at the end of the paths list for the host 'portal.example.com' pointing to the 'maintenance-service'.

    Adding a path with the value slash at the end of the paths list for the host acts as a catch-all for unmatched requests. Option D would catch unmatched traffic across all hosts rather than just portal.example.com.

  290. Question 290 of 597You are managing a critical Deployment named 'web-server' that currently runs 5 replicas. You need to update the container image to a newer version. The business requirement states that you must ensure 100% of the service capacity is maintained at all times during the update, and you should not consume more than 2 extra Pods' worth of resources during the transition. Which RollingUpdate strategy parameters should you use to achieve this?

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

    Show answer & explanation

    Correct answer: A. Set maxUnavailable to 0 and maxSurge to 2 to ensure no pods are removed before new ones are ready and allow up to 7 pods total.

    Setting maxUnavailable to 0 and maxSurge to 2 maintains full capacity while strictly limiting extra resource consumption. Option D fails the 100% capacity requirement because it allows one Pod to be unavailable.

  291. Question 291 of 597CronJob execution windows. A business-critical CronJob is scheduled to run every day at 02:00 AM to generate financial reports. Due to high cluster utilization or potential node maintenance, there is a risk that the Job might not start exactly on time. The finance department stipulates that if the Job cannot start within 30 minutes of its scheduled time, it should not run at all for that day to avoid impacting daytime operations. How should you configure the CronJob to meet this requirement?

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

    Show answer & explanation

    Correct answer: A. Configure the startingDeadlineSeconds field to 1800 in the CronJob specification to limit the window for starting a missed or delayed job.

    The startingDeadlineSeconds field limits how long after the scheduled time a missed Job can start. Option C controls total Job execution time rather than the startup delay window.

  292. Question 292 of 597An organization is hosting a multi-service platform. You need to configure an Ingress resource that routes traffic for two different domains: 'orders.example.com' and 'shipments.example.com'. Both domains must use TLS encryption with separate certificates stored in secrets 'orders-tls' and 'shipments-tls'. If a request arrives that does not match either domain, it should be sent to a service named 'default-http-backend'. How should the Ingress rules and TLS sections be structured?

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

    Show answer & explanation

    Correct answer: A. Define two separate entries in the tls list, each specifying its own hosts and secretName, and include a rule for each host in the rules list with a fallback backend.

    Defining two TLS entries and using a defaultBackend ensures correct routing and security for multiple domains. Option B fails because using a shared secret will not serve the correct individual certificates.

  293. Question 293 of 597A web application 'frontend-prod' needs to be exposed to the internet. The cluster uses an Ingress Controller. You are tasked with creating an Ingress resource that routes all traffic coming to 'www.example.com' to a service named 'frontend-svc' on port 80. However, traffic specifically reaching 'www.example.com/assets' must be routed to a different service named 'static-svc' on port 8080. How should the paths be defined in the Ingress rule? Correct answer

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

    Show answer & explanation

    Correct answer: A. Define two separate path entries under the same host: one for '/assets' with pathType Prefix and one for '/' with pathType ImplementationSpecific

    Defining multiple paths under a single host in an Ingress resource routes traffic to different services based on the URI. The longest matching path is typically chosen by the controller, correctly directing requests to the appropriate backend.

  294. Question 294 of 597You are investigating why a newly created Pod named 'worker-nodes-only' is stuck in the Pending state. The 'kubectl describe pod' command shows the message: '0/5 nodes are available: 5 node(s) had untolerated taint {type: gpu}'. The cluster has 2 nodes with GPUs and 3 nodes without. You intended for this Pod to run on one of the GPU-equipped nodes because of its intensive processing needs. What is the missing step? Correct answer

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

    Show answer & explanation

    Correct answer: A. The Pod manifest needs a toleration block that matches the key 'type', operator 'Equal', and value 'gpu' with the effect 'NoSchedule'.

    Adding a matching toleration to the pod manifest allows it to be scheduled onto nodes with corresponding taints. Without this toleration, the scheduler prevents the pod from running on the tainted nodes.

  295. Question 295 of 597A complex Java application performs a heavy data cache pre-loading process that takes approximately 2 minutes. During this time, the application process is running and the port is open, but it cannot yet handle incoming API requests. If traffic is sent to it during this phase, the client receives 503 errors. You need to prevent the Service from sending traffic until the cache is fully loaded. Which probe is most appropriate?

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

    Show answer & explanation

    Correct answer: B. A ReadinessProbe configured with an initialDelaySeconds of 120 to delay traffic until the application is ready

    Readiness probes prevent services from routing traffic to unready pods. By delaying the initial probe, the application has time to load its cache before accepting requests, avoiding client errors.

  296. Question 296 of 597A legacy application generates massive text-based log files at a rate of 500MB per hour, quickly filling up the node's local storage. The application is hardcoded to write logs to a volume mounted at /var/logs/app. You need to implement a solution where a second container in the same Pod monitors this directory and compresses files that are older than 10 minutes to save space, without modifying the primary application code. What is the most appropriate architectural pattern and configuration for this requirement?

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

    Show answer & explanation

    Correct answer: A. Implement a Sidecar container in the Pod that shares an emptyDir volume with the main container at /var/logs/app and runs a continuous loop to compress old files.

    Implementing a sidecar container that shares an emptyDir volume is the correct architectural pattern for augmenting legacy applications. Shared volumes allow the primary container to write logs while the sidecar independently processes them without altering the main application.

  297. Question 297 of 597You are migrating a complex Node.js application that requires over 40 different environment variables to function, including database URLs, API endpoints, and feature flags. All these variables are stored in a ConfigMap named 'app-env-vars'. Instead of mapping each variable individually in the Pod manifest using valueFrom, you want to inject all key-value pairs from the ConfigMap into the container's environment automatically. Which configuration should you use in the container spec?

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

    Show answer & explanation

    Correct answer: C. Utilize the envFrom field under the container specification and provide a configMapRef pointing to the app-env-vars ConfigMap.

    The envFrom field is designed to populate environment variables automatically from an entire ConfigMap or Secret. This approach saves time compared to specifying individual env entries using configMapKeyRef for every single key.

  298. Question 298 of 597An automated CI/CD pipeline recently deployed a new version of the shipping-api deployment. After the deployment reached a ready state, users started reporting intermittent 503 errors and high latency. The operations team needs to roll back to the previous version immediately. However, when checking the rollout history, they notice that the CHANGE-CAUSE column is empty for all revisions, making it difficult to identify the stable version. Which action should be taken to ensure future rollouts provide this metadata and to perform the immediate rollback?

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

    Show answer & explanation

    Correct answer: C. Run kubectl rollout undo deployment/shipping-api and update the manifest with the kubernetes.io/change-cause annotation.

    Running the rollout undo command immediately reverts the Deployment to its previous working revision. Adding the kubernetes.io/change-cause annotation during future rollouts ensures the history controller properly populates the audit trail.

  299. Question 299 of 597An engineering team is managing a high-traffic web service deployed via a Deployment named web-portal. To ensure stability during updates, they require that during a rolling update, the total number of replicas never exceeds 125% of the desired count. At the same time, at least 75% of the desired replicas must always be available and ready to serve traffic. If the Deployment is configured with 20 replicas, what are the correct settings for maxSurge and maxUnavailable?

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

    Show answer & explanation

    Correct answer: C. Set maxSurge to 25% and set maxUnavailable to 25% in the Deployment rollingUpdate strategy

    A maxSurge of 25% allows up to 5 extra pods, matching the 125% maximum requirement. However, setting maxSurge and maxUnavailable to the integer 5 is mathematically identical for a 20-replica deployment. Both options effectively fulfill the stated requirements.

  300. Question 300 of 597An enterprise is migrating a legacy database to a cloud-managed service outside of the Kubernetes cluster. The application code is hardcoded to connect to 'db-internal.production.svc.cluster.local'. To avoid code changes, you need to create a Kubernetes resource that maps this internal DNS name to the external fully qualified domain name (FQDN) of the new managed database: 'prod-db-99.provider.com'.

    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 'prod-db-99.provider.com'.

    An ExternalName Service creates a DNS CNAME record, perfectly mapping an internal cluster domain to an external FQDN without code changes. Modifying CoreDNS directly is an anti-pattern and a poor distractor, whereas Ingress only manages HTTP traffic routing.

  301. Question 301 of 597A Python-based data processing application is experiencing intermittent freezes where the process remains running but stops responding to internal health checks. You need to implement a health check that specifically checks for the existence of a 'heartbeat.txt' file that the application is supposed to update every 30 seconds. If the file has not been modified in the last 60 seconds, the container should be considered unhealthy and restarted by the kubelet. Which configuration effectively addresses this requirement?

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using an exec command that evaluates the file's modification time

    A liveness probe determines when a container needs a restart due to deadlock or failure. Using an exec handler runs a custom script to validate complex conditions, such as file modification times, which readiness probes or startup delays do not manage.

  302. Question 302 of 597A data processing Job named 'nightly-reconciliation' is configured to process 100 shards of data. The team has observed that occasionally a specific shard causes the container to crash due to malformed data. They want the Job to attempt to retry individual failed pods up to 4 times, but the entire Job must be terminated if it doesn't complete within 30 minutes, regardless of how many shards were processed.

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

    Show answer & explanation

    Correct answer: B. Set completions to 100, parallelism to 10, backoffLimit to 4, and activeDeadlineSeconds to 1800

    In Kubernetes Jobs, backoffLimit governs the maximum pod retries before failing. The activeDeadlineSeconds parameter enforces a strict time limit for the entire job execution. Avoid sidecar workarounds and use native API fields during the exam.

  303. Question 303 of 597Your monitoring and observability strategy requires that each instance of a distributed microservice identifies itself using its own Pod name and the name of the Node it is currently scheduled on. This metadata is essential for correlating application performance with specific hardware in the cluster. You must ensure that these values are available as environment variables inside the 'data-processor' container without using the Kubernetes API client from within the application code.

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

    Show answer & explanation

    Correct answer: D. Configure the Pod specification to use the Downward API to map fieldRef values like metadata.name and spec.nodeName into environment variables.

    The Downward API exposes pod metadata directly to containers without using the Kubernetes API client. Use fieldRef for environment variables to pass the pod name and node name dynamically. Static ConfigMaps fail when pods are rescheduled.

  304. Question 304 of 597You are managing a critical web deployment named 'frontend-v2' which is currently running with 6 healthy replicas. To ensure high availability during a rolling update to 'frontend-v3', the infrastructure team has dictated that the number of available pods must never drop below the current count of 6. Additionally, to avoid overwhelming the node resources, the total number of pods during the update process must never exceed 8. How should you configure the rolling update strategy in the Deployment manifest to strictly adhere to these performance and availability constraints?

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

    Show answer & explanation

    Correct answer: B. Define the strategy with maxUnavailable set to 0 and maxSurge set to 2 to maintain at least 6 pods while allowing a maximum of 8 pods during the transition.

    Setting maxUnavailable to zero keeps all desired replicas running during updates. Configuring maxSurge to two allows only two extra pods to be created, keeping the maximum total within the required limit. The Recreate strategy causes downtime.

  305. Question 305 of 597Your engineering team has provided a ConfigMap named 'app-settings' containing various environment-specific files. One of these files, 'database.yaml', needs to be injected into a container at the path '/etc/config/database.yaml'. However, the directory '/etc/config/' already contains essential system files generated during the container build process that must not be deleted or hidden. If you mount the entire ConfigMap as a volume, the existing files in that directory will be obscured. Which volume mounting strategy should you use to mount only the specific file without affecting the rest of the directory contents?

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

    Show answer & explanation

    Correct answer: B. Apply a volumeMount with the subPath property to map the specific key from the ConfigMap volume directly to the desired file path in the container.

    The subPath property mounts a single file from a volume into an existing directory without obscuring other files. This is the exact Kubernetes feature for injecting specific ConfigMap keys safely. Using init containers is an unnecessary workaround.

  306. Question 306 of 597You are deploying a security-hardened Pod that runs as a non-root user with UID 2000. The container needs to process files located in a PersistentVolume mounted at '/app/data'. However, the underlying storage system initializes the volume with root ownership, preventing the user 2000 from writing to the directory. Without changing the container image or using a privileged initContainer to run 'chmod', how can you ensure the Pod has the necessary permissions to write to the volume at runtime?

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

    Show answer & explanation

    Correct answer: A. Specify fsGroup: 2000 within the Pod-level securityContext to automatically change the ownership of the mounted volume to be owned by group 2000.

    Specifying fsGroup in the Pod securityContext automatically adjusts the group ownership of mounted volumes. This built-in kubelet feature handles permissions cleanly, avoiding the need for insecure privileged containers or application modifications.

  307. Question 307 of 597A distributed application depends on a database service named 'db-backend' located in the same namespace. If the application starts before the database is ready to accept connections, it crashes and enters a CrashLoopBackOff state, causing delays in the overall system recovery. You want to implement a mechanism within the Pod to ensure the main application container only starts after the database service is reachable over the network.

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

    Show answer & explanation

    Correct answer: B. Define an Init container that runs a script to check for the availability of the 'db-backend' service using a tool like netcat or nslookup.

    Init containers run sequentially and must complete successfully before the main application containers start. This makes them the perfect tool for blocking startup until external network dependencies are fully reachable and ready.

  308. Question 308 of 597Your microservice architecture includes a 'reporting-api' that occasionally experiences internal deadlocks. When this happens, the process continues to run, and the HTTP port remains open, but all subsequent requests return a 504 Gateway Timeout or hang indefinitely. You need to configure a mechanism that automatically restarts the container only when it enters this specific unresponsive state, while ensuring it is not killed during its 30-second initialization period.

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

    Show answer & explanation

    Correct answer: B. Implement a LivenessProbe using an HTTP GET request with an initialDelaySeconds of 30 and a failureThreshold of 3.

    A LivenessProbe detects application deadlocks and restarts the unresponsive container to restore functionality. The initialDelaySeconds parameter ensures the probe does not prematurely kill the container during its 30-second startup routine.

  309. Question 309 of 597A data analytics Pod named log-processor in your production cluster performs heavy temporary calculations by writing intermediate files to its local filesystem at /tmp. During peak hours, these temporary files can grow rapidly and consume all available disk space on the worker node, leading to node instability and affecting other critical workloads. You need to enforce a mechanism that ensures this Pod is terminated if its local storage usage exceeds 500Mi to protect the underlying host and other neighboring Pods.

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

    Show answer & explanation

    Correct answer: B. Set an ephemeral-storage resource limit of 500Mi within the container specification

    Setting an ephemeral-storage limit triggers pod eviction when container writes exceed the specified threshold, protecting the node. ResourceQuotas only cap total namespace usage rather than enforcing strict limits on individual pod consumption.

  310. Question 310 of 597Your organization is deploying a microservice that requires access to a shared certificate file, a database configuration ConfigMap, and the Pod's own IP address injected into the filesystem. To maintain a clean container environment, you want all three pieces of information to be mounted into the same directory at /var/app/metadata, even though they come from different Kubernetes resource types. Which volume configuration is designed to aggregate multiple sources into a single mount point?

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

    Show answer & explanation

    Correct answer: D. Implement a projected volume that includes secret, configMap, and downwardAPI sources

    A projected volume maps several volume sources like secrets and downwardAPI data into a single unified directory tree. This provides a clean aggregation method, whereas overlapping standard volume mounts will simply overwrite each other.

  311. Question 311 of 597Your engineering team is deploying a complex Java-based microservice that exposes its main application on port 8080. However, the application's internal health-check logic and metrics are exposed on a dedicated management port 9090. A Readiness Probe must be configured to ensure the Pod only receives traffic through the Service once the internal cache is fully loaded and the management endpoint returns a 200 OK status. If the probe is misconfigured to point to the main application port, the Pod might receive traffic before it is truly ready to process requests. How should this probe be defined in the container specification?

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

    Show answer & explanation

    Correct answer: C. Define a readinessProbe using httpGet specifying port 9090 and the appropriate path for health checks.

    A readinessProbe using httpGet on the management port accurately validates application readiness before routing traffic. Liveness or startup probes do not control traffic routing, making them unsuitable for this specific Service requirement.

  312. Question 312 of 597A financial technology firm is hardening its Kubernetes clusters to meet strict compliance standards. During a security review, the DevSecOps team identified that many application Pods in the transaction-processing namespace have a default ServiceAccount token mounted at /var/run/secrets/kubernetes.io/serviceaccount, even though these microservices do not interact with the Kubernetes API. To minimize the attack surface and prevent potential token theft, the team mandates that this automatic mounting behavior must be disabled at the Pod level or ServiceAccount level for all non-administrative workloads. Which configuration change should be applied to the Pod's YAML manifest to prevent the automatic injection of the ServiceAccount token into the container's file system?

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

    Show answer & explanation

    Correct answer: D. Set the boolean field automountServiceAccountToken to false in the Pod specification to prevent the automatic mount.

    Setting automountServiceAccountToken to false explicitly stops the kubelet from injecting the API credentials into the pod. Overriding the mount path with an emptyDir is a dangerous hack that does not properly secure the environment.

  313. Question 313 of 597You are deploying a distributed database system using a StatefulSet named db-cluster. Each instance in the cluster must be addressable by its own unique and stable DNS hostname (e.g., db-cluster-0.db-service, db-cluster-1.db-service) so that the members can perform data replication and leader election. Standard load balancing across all pods is not desired for these internal operations. Which networking component must you create and associate with the StatefulSet to enable this individual Pod addressing?

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

    Show answer & explanation

    Correct answer: B. A Headless Service with the clusterIP field set to None and a selector that matches the labels defined in the StatefulSet's pod template.

    A Headless Service returns individual pod IP addresses instead of providing a single virtual IP for load balancing. This behavior is required for StatefulSets to provide stable network identities for distributed data replication.

  314. Question 314 of 597A high-volume batch processing system uses Kubernetes Jobs to process large data files. Occasionally, a malformed data file causes the processing container to crash repeatedly. You want to ensure that if a specific Job fails more than 4 times, the system stops attempting to run it and marks the Job as failed. Additionally, you want to ensure the Job does not run for more than 300 seconds total, regardless of how many retries occur. Which combination of fields in the Job spec should you use?

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

    Show answer & explanation

    Correct answer: C. Define backoffLimit set to 4 and activeDeadlineSeconds set to 300

    The backoffLimit field specifies the number of retries before a Job is marked as failed, while activeDeadlineSeconds enforces a hard time limit. Use activeDeadlineSeconds rather than a grace period when you need an absolute cap on Job duration.

  315. Question 315 of 597Your engineering team is deploying a legacy inventory application named inv-singleton. This application relies on an older database engine that does not support concurrent connections from multiple application instances. When performing an update to a new container image, you must ensure that the existing Pod is completely terminated before the new version is started to avoid database corruption and locking issues. Which specific configuration should you apply to the Deployment to guarantee this behavior?

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

    Show answer & explanation

    Correct answer: C. Change the Deployment strategy type to Recreate in the spec section

    The Recreate deployment strategy terminates all existing Pods before creating new ones, which is required for singleton applications. A RollingUpdate will temporarily run both versions simultaneously, risking database locks.

  316. Question 316 of 597Your organization's e-commerce API must be highly available and resilient to datacenter failures. The Kubernetes cluster is distributed across three availability zones (zone-a, zone-b, and zone-c). You need to ensure that the 9 replicas of your 'checkout-api' Deployment are distributed as evenly as possible across these three zones, preventing a situation where a single zone failure takes down a majority of your application's capacity.

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

    Show answer & explanation

    Correct answer: A. Configure topologySpreadConstraints in the Pod spec with a topologyKey set to 'topology.kubernetes.io/zone' and a maxSkew of 1.

    TopologySpreadConstraints give the scheduler explicit rules for distributing Pods evenly across designated topology domains like zones. NodeSelectors or anti-affinity rules cannot mathematically enforce an even spread across multiple failure domains.

  317. Question 317 of 597A payment-gateway microservice must be considered ready to receive traffic only if it can successfully connect to both a local Redis cache and an external credit card processing API. A simple HTTP check on the /health endpoint is insufficient because it only checks the web server status. The application includes a utility script at /usr/bin/verify-dependencies.sh that returns an exit code of 0 only when all these conditions are met. You need to configure the most appropriate probe to ensure traffic is only routed to healthy Pods.

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

    Show answer & explanation

    Correct answer: B. Define a Readiness Probe using the exec handler to run the /usr/bin/verify-dependencies.sh script to control the Pod's inclusion in Service endpoints.

    A Readiness Probe evaluates if an application can serve requests, removing it from Service endpoints if checks fail. A Liveness Probe would restart the Pod unnecessarily when external dependencies become temporarily unavailable.

  318. Question 318 of 597Your team is implementing a Blue-Green deployment strategy for the 'checkout-api' service. Version 1 (Blue) is currently active and receiving traffic through a Service named 'checkout-service'. You have successfully deployed Version 2 (Green) using a separate Deployment. Now, you need to perform the final cutover to route 100% of the production traffic to Version 2 while keeping Version 1 running in the background for a possible quick rollback if issues are detected.

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

    Show answer & explanation

    Correct answer: C. Modify the label selector of the 'checkout-service' to match the unique labels of the Version 2 Deployment pods.

    Updating the Service selector instantly changes traffic routing to match the new deployment pods. Deleting the old deployment removes rollback capability, and Ingress canary rules apply proxy traffic splitting, not standard Kubernetes service routing.

  319. Question 319 of 597You are deploying a distributed database where each instance (replica) needs to be uniquely identifiable and addressable by its own DNS name (e.g., db-0, db-1, db-2) for clustering and synchronization purposes. You are using a StatefulSet for the deployment. However, you notice that the Pods are not getting individual DNS entries. What specific component are you likely missing to enable this direct network addressability for the individual Pods?

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

    Show answer & explanation

    Correct answer: C. A Headless Service with the 'clusterIP' set to 'None' and matching the 'serviceName' of the StatefulSet

    A Headless Service with clusterIP set to None provides stable DNS records for individual StatefulSet pods. Standard ClusterIP services balance traffic across random pods, destroying direct addressability, while Ingress and LoadBalancers manage external routing.

  320. Question 320 of 597A security audit has flagged that your main application container contains several heavy-duty diagnostic and encryption tools that are only needed once during the initial configuration phase. To minimize the attack surface and reduce image size, the security team requires these tools to be removed from the production image. However, the application still needs a specific 'encryption-key' file to be generated and placed in a shared directory before it starts. How should you design the Pod to meet these security and functional requirements?

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

    Show answer & explanation

    Correct answer: B. Implement an initContainer that uses a specialized image containing the tools to generate the key and save it into an emptyDir volume shared with the main container.

    Init containers run sequentially before the main app, securely passing data via an emptyDir volume. Granting elevated runtime capabilities or relying on lifecycle hooks leaves heavy diagnostic tools exposed inside the primary production image.

  321. Question 321 of 597A legacy inventory-service application is being migrated to a Kubernetes cluster. The application is known to be fragile during its startup phase; it will immediately crash if the backend database is reachable but the required SQL schema version 2.4 has not been fully initialized by the database administration team. To prevent continuous CrashLoopBackOff events, you need to ensure that the main application container only starts after a validation script successfully verifies the presence of the correct schema version in the database.

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

    Show answer & explanation

    Correct answer: B. Define an Init Container that runs the SQL validation script and only exits successfully when the database schema version is confirmed as 2.4.

    Init containers block application startup until prerequisite checks successfully complete. PostStart hooks execute concurrently with the main app, and readiness probes only prevent service routing without stopping the main process from crashing.

  322. Question 322 of 597A production Deployment named web-portal currently runs 10 replicas. You are planning to update the container image to version 2.0.0. Due to resource constraints on the cluster nodes, you cannot have more than 12 Pods running at any point during the update process. However, the business requires that at least 8 Pods must remain available and ready to serve traffic at all times during the rollout. Which RollingUpdate strategy parameters meet these constraints?

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

    Show answer & explanation

    Correct answer: B. Set maxSurge to 20% and maxUnavailable to 20%

    A twenty percent surge permits exactly two extra pods, staying safely under the twelve pod limit. Concurrently, twenty percent unavailable ensures at least eight pods remain active, perfectly meeting the strict availability requirements.

  323. Question 323 of 597A financial application Pod named 'transaction-handler' in the 'finance' namespace must be restricted for security reasons. It should be allowed to send outgoing requests only to a specific internal database Service at IP 10.0.0.55 on port 5432 and to the Kubernetes DNS service. All other egress traffic to any other internal or external IP addresses must be blocked.

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

    Show answer & explanation

    Correct answer: D. Apply a NetworkPolicy with an 'egress' section that includes a CIDR rule for 10.0.0.55/32 and a rule for the DNS port.

    A NetworkPolicy with an egress section explicitly allows traffic to the database IP and DNS port while blocking everything else. RBAC controls API access rather than network traffic, and Ingress only manages incoming connections.

  324. Question 324 of 597Your organization recently added specialized nodes equipped with NVIDIA A100 GPUs to the Kubernetes cluster to support a new real-time fraud detection engine. These nodes are labeled with accelerator=nvidia-a100. Due to the high operational cost of these resources, the platform team mandates that standard microservices must not be scheduled on these nodes. Conversely, the fraud-detection application must only run on these specific GPU-enabled nodes to meet its strict latency requirements. You need to configure the Pod specification for the fraud-detection deployment and the node configuration to enforce this two-way isolation.

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

    Show answer & explanation

    Correct answer: D. Apply a Taint with the NoSchedule effect to the GPU nodes and add a matching Toleration and NodeAffinity to the fraud-detection Pod specification.

    Taints repel standard Pods from the GPU nodes, while Tolerations and NodeAffinity ensure the fraud-detection Pods are specifically scheduled there. Using NodeAffinity guarantees the workload lands on the correct hardware.

  325. Question 325 of 597A complex data-processing application takes approximately 180 seconds to initialize its internal cache and verify database connections upon startup. During this initialization phase, the application is unable to respond to health checks. Your current Liveness probe is configured with an initialDelaySeconds of 30, causing the kubelet to restart the container repeatedly before it can ever become healthy. You need to optimize the Pod configuration to allow the application sufficient time to start while still maintaining a responsive Liveness probe once the application is operational. What is the most effective way to handle this slow-starting container?

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

    Show answer & explanation

    Correct answer: A. Add a Startup probe with a failureThreshold of 30 and a periodSeconds of 10 to allow the container up to 300 seconds to initialize before Liveness probes take over.

    A Startup probe disables Liveness and Readiness checks until it succeeds, protecting slow-starting applications. Just increasing the Liveness delay leaves the container unmonitored during steady-state, defeating the probe's purpose.

  326. Question 326 of 597You are modernizing a legacy billing-calc application that is hardcoded to connect to a MySQL database located at localhost:3306. In your Kubernetes cluster, the database is actually a managed service reachable via a cluster-internal DNS name (db-prod.finance.svc.cluster.local). Since you cannot modify the legacy application's source code to change the database host, you decide to use a Sidecar container (Ambassador pattern) to bridge the connection. How should you configure the sidecar?

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

    Show answer & explanation

    Correct answer: B. Deploy a sidecar container running a proxy (like HAProxy or Socat) that listens on localhost:3306 and forwards traffic to the remote database address.

    The Ambassador pattern uses a sidecar to act as a local proxy, making remote services appear local without code changes. Modifying Pod hosts or synchronizing databases adds unnecessary complexity and fails the proxy requirement.

  327. Question 327 of 597You are deploying a legacy monolithic application that requires a complex set of configuration files to be present in the /app/config directory. However, one specific file, 'license.key', must be mounted from a Secret, while the rest of the configuration files come from a ConfigMap. If you mount the Secret at /app/config, it hides the files from the ConfigMap. How can you mount both the ConfigMap and the Secret into the same directory without them overwriting each other?

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

    Show answer & explanation

    Correct answer: A. Use the 'subPath' field in the volumeMounts section for each file to mount them individually into the target directory.

    Using subPath mounts individual files without overwriting the destination directory. However, using a projected volume is also a valid, modern solution for merging multiple volume sources into a single directory.

  328. Question 328 of 597A security-sensitive application needs to write persistent data to a volume mounted at '/data/secure-storage'. The application container is configured to run as a non-privileged user with UID 2005. However, the volume mounted from the storage provider is initially owned by the root user, which prevents the application from writing its files. You must ensure that the volume is automatically accessible and writable by the application's user without manually changing permissions on the underlying host. How should you configure the pod?

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

    Show answer & explanation

    Correct answer: B. Set the 'fsGroup' field within the Pod's securityContext to 2005 to ensure Kubernetes changes the group ownership of the volume.

    Setting fsGroup in the Pod securityContext tells Kubernetes to change the mounted volume's group ownership to that ID. This grants the non-privileged container write access without requiring risky privileged escalations.

  329. Question 329 of 597You are managing a mission-critical web application where you need to perform a Blue/Green deployment to minimize downtime. You have version 1.0 (Blue) running and have just deployed version 2.0 (Green) with its own set of Pods. Both sets of Pods are currently active in the cluster, but only Blue is receiving production traffic. How can you natively shift 100% of the traffic to the Green version using standard Kubernetes Service discovery mechanisms without using an Ingress or Service Mesh?

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

    Show answer & explanation

    Correct answer: A. Update the selector labels in the Service manifest to match the version 2.0 Pod labels

    A Kubernetes Service routes traffic using label selectors. Updating the selector to match the new labels instantly shifts all traffic to the Green environment without deploying a new Service or modifying Deployment strategies.

  330. Question 330 of 597A security audit requires that all containers in the 'payment-processing' namespace run with a read-only root filesystem to prevent unauthorized modifications or persistent malware. However, the application inside the container requires a specific directory, /tmp/app-cache, to be writable for storing temporary session data that does not need to persist across restarts. The deployment must comply with the security mandate while still allowing the application to function correctly. Which combination of SecurityContext and Volume configuration is required?

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

    Show answer & explanation

    Correct answer: A. Set readOnlyRootFilesystem to true in the securityContext and mount an emptyDir volume at /tmp/app-cache.

    Setting readOnlyRootFilesystem to true secures the container image. Mounting an emptyDir at the specific path provides a writable scratch space that remains isolated to the Pod's lifecycle.

  331. Question 331 of 597You are managing a shared cluster where security is a top priority. A new compliance mandate requires that all Pods in the 'secure-finance' namespace must run with the 'Restricted' Pod Security Standard. This means they cannot run as root, cannot access the host network, and must have a restricted set of capabilities. You need to enforce this policy so that any Pod that does not meet these criteria is blocked from starting. What is the most modern and efficient way to achieve this at the namespace level?

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

    Show answer & explanation

    Correct answer: B. Apply labels to the namespace that configure the Pod Security Admission controller to enforce the restricted profile

    Pod Security Admission is the modern replacement for PodSecurityPolicies. Applying namespace labels like pod-security.kubernetes.io/enforce: restricted automatically enforces the baseline security standard natively.

  332. Question 332 of 597Your application pod requires a clean shutdown to ensure that all in-flight transactions are saved to a persistent disk when the pod is terminated (e.g., during a scaling event or update). The application listens for a SIGTERM signal, but it requires at least 45 seconds to complete its cleanup process. By default, Kubernetes terminates containers much faster, which is causing data corruption in your environment. How do you prevent this data corruption?

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

    Show answer & explanation

    Correct answer: C. Set the 'terminationGracePeriodSeconds' field in the Pod specification to 60 to allow the application enough time to shut down.

    The terminationGracePeriodSeconds defines the duration Kubernetes waits after sending SIGTERM before issuing SIGKILL. Increasing this value ensures the application has the necessary window to finish cleanup tasks safely.

  333. Question 333 of 597Your engineering team is performing a Blue-Green deployment for a mission-critical payment processing microservice. Version 1.0 (Blue) is currently serving production traffic through a Service named 'payment-service'. Version 2.0 (Green) has been deployed and fully tested in the same namespace but is not yet receiving public traffic. You need to transition all incoming production traffic from Version 1.0 to Version 2.0 with minimal downtime and the ability to roll back instantly if an error is detected. How do you accomplish this?

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

    Show answer & explanation

    Correct answer: A. Update the selector labels of the 'payment-service' Service to match the labels unique to the Version 2.0 Deployment pods.

    Updating the Service selector implements an atomic Blue-Green switch by redirecting internal load balancing to the new Pods. Rolling updates risk mixing traffic, whereas deleting deployments causes downtime.

  334. Question 334 of 597An application pod named 'auth-service' needs to access several different pieces of metadata and configuration at runtime. Specifically, it requires a TLS certificate stored in a Secret, a set of environment-specific flags stored in a ConfigMap, and it also needs to know its own Pod IP address to register with a discovery service. To simplify the container's filesystem structure, you want all these items to be mounted as files within a single directory at /etc/app-meta. Which Kubernetes volume type allows you to aggregate multiple data sources into a single mounted directory?

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

    Show answer & explanation

    Correct answer: B. Use a projected volume that includes secret, configMap, and downwardAPI sources.

    A projected volume maps several volume sources like Secrets, ConfigMaps, and Downward API into a single directory. This avoids mounting multiple separate volumes and provides a clean, unified filesystem structure.

  335. Question 335 of 597A critical Python-based microservice in your production environment occasionally suffers from internal thread locking. When this happens, the process continues to run, and the container remains 'Running' from a Kubernetes perspective, but it stops processing incoming requests and fails to respond to health checks. You need to ensure that Kubernetes automatically terminates and replaces the container whenever this specific frozen state is detected. Which probe configuration is required to resolve this issue? Correct answer

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

    Show answer & explanation

    Correct answer: A. A LivenessProbe configured with an appropriate failureThreshold to trigger a container restart upon repeated failures.

    A liveness probe checks if an application is stuck or deadlocked, and failing it triggers the kubelet to restart the container. A readiness probe only routes traffic, meaning a frozen container would stay offline indefinitely without being replaced.

  336. Question 336 of 597A security-sensitive application Pod must run as a specific non-root user with UID 1000. Additionally, the application needs to read and write files to a PersistentVolume that is mounted at '/data'. The storage provider identifies the files on the volume as belonging to GID 5000. For the application to have proper permissions without running as root, what configuration should be applied to the Pod's securityContext? Correct answer

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

    Show answer & explanation

    Correct answer: A. Set fsGroup to 5000 in the Pod's securityContext specification

    Setting fsGroup to 5000 in the pod security context automatically grants the mounted volume group ownership so your user can read and write files. Running privileged containers or applying broad permissions creates unnecessary security risks on the certification exam.

  337. Question 337 of 597A DevOps team is performing a manual canary deployment for a new version of a user-profile service. They have created a second Deployment named 'user-profile-v2' alongside the existing 'user-profile-v1'. They want a single Service named 'user-profile-svc' to distribute traffic between both versions so that they can monitor the performance of v2 on a small percentage of real production traffic. What is the standard way to configure the Service to include both sets of Pods in its load balancing pool?

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

    Show answer & explanation

    Correct answer: C. Point the Service selector to a common label shared by both Deployments

    A service routes traffic by matching pod labels, so pointing it to a common label shared by both deployments adds them to the pool. The control plane dynamically manages endpoints, making manual edits unreliable and temporary.

  338. Question 338 of 597A batch processing system requires a Kubernetes Job to process exactly 20 work items from a queue. To optimize the processing time, the team wants to ensure that at least 4 worker Pods are running simultaneously at any given time until the total of 20 successful completions is reached. If a Pod fails, it should be replaced. Which fields in the Job specification should be configured to meet these exact requirements? Correct answer

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

    Show answer & explanation

    Correct answer: A. Set parallelism to 4 and completions to 20 in the Job spec

    The parallelism field dictates concurrent worker pods, and completions dictates total successful finishes required. Using activeDeadlineSeconds sets timeout limits rather than concurrency, completely failing to match workload requirements.

  339. Question 339 of 597A developer needs to configure a Deployment for a legacy application that requires 25 different environment variables to function. These variables are currently stored in a ConfigMap named 'app-env-vars'. To avoid a long and error-prone Pod specification, the developer wants to inject all keys from the ConfigMap into the container automatically as environment variables. How can this be achieved?

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

    Show answer & explanation

    Correct answer: A. Use the envFrom field in the container spec and reference the ConfigMap via configMapRef

    The envFrom field bulk injects all ConfigMap or Secret keys as environment variables into a container. Mapping individual keys manually using configMapKeyRef is tedious and inefficient for large configurations.

  340. Question 340 of 597Your team uses a CronJob to perform a database cleanup every night at 2:00 AM. Over time, you have noticed that the namespace is becoming cluttered with hundreds of 'Completed' Pods from past executions, making it difficult to find active resources and putting unnecessary load on the API server's storage. You need to modify the CronJob so that it only retains the records of the last 3 successful executions and the last 1 failed execution. Which fields should you configure?

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

    Show answer & explanation

    Correct answer: B. Set 'successfulJobsHistoryLimit' to 3 and 'failedJobsHistoryLimit' to 1 in the CronJob spec.

    The successfulJobsHistoryLimit and failedJobsHistoryLimit fields restrict how many finished jobs and pods remain for auditing. Configuring ttlSecondsAfterFinished on the job template controls deletion timing rather than strict retention counts.

  341. Question 341 of 597A financial data processing CronJob is scheduled to run every day at midnight to generate reports. However, the cluster is often heavily loaded at that time, which can cause delays in scheduling the Pod. The business requires that if the job cannot be started within 30 minutes of its scheduled time (e.g., due to resource constraints or cluster downtime), the specific execution should be skipped to avoid running outdated reports during the day. Which field meets this requirement?

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

    Show answer & explanation

    Correct answer: A. Set the 'startingDeadlineSeconds' field in the CronJob specification to 1800 seconds to define the allowed scheduling window.

    Setting startingDeadlineSeconds dictates the grace period before a delayed job is skipped entirely by the controller. The activeDeadlineSeconds field sets the maximum duration a job runs once started, not scheduling delay tolerances.

  342. Question 342 of 597A data-processing application requires a specific configuration directory at '/etc/config/app' to be populated with several decrypted security keys before the main container starts. These keys are fetched from an external vault via a secure API call. The main application container is built with a minimal 'distroless' image that lacks the 'curl' or 'wget' utilities for security reasons. How should you design the Pod to ensure the keys are available to the main application at runtime?

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

    Show answer & explanation

    Correct answer: A. Use an Init container with curl to fetch keys into a shared emptyDir volume

    Init containers run sequentially before the main application starts and can share an emptyDir volume. This approach securely passes data to minimal distroless images that lack standard shell utilities. Sidecars run concurrently, making them unsuitable.

  343. Question 343 of 597An enterprise financial application named secure-vault must be deployed with strict security constraints. The security team requires that the application container runs as a specific non-root user with UID 5000. Additionally, the application must be prevented from gaining any additional privileges beyond those assigned at startup, even if the application process is compromised. You need to configure the Pod specification to meet these requirements while ensuring it is applied at the container level.

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

    Show answer & explanation

    Correct answer: B. Configure securityContext with runAsUser 5000 and allowPrivilegeEscalation set to false

    Setting runAsUser enforces a specific UID while allowPrivilegeEscalation prevents a process from gaining more privileges than its parent. Configuring these in the security context meets the requirement. PodSecurityPolicy is deprecated and a strong distractor.

  344. Question 344 of 597Your organization is hosting a legacy web application that was not designed for stateless cloud environments. The application stores user session data in local memory rather than a shared database. As a result, if a user's subsequent requests are routed to different Pods, their session is lost, and they are forced to log in again. You are using a Kubernetes Service of type LoadBalancer to expose the application. What configuration change can be made to the Service to ensure a user is consistently routed to the same Pod based on their IP address?

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

    Show answer & explanation

    Correct answer: C. Set the service property sessionAffinity to ClientIP in the Service manifest.

    Setting sessionAffinity to ClientIP ensures requests from a specific IP route to the same pod during the session timeout window. This is the native service configuration for legacy applications. Avoid manual pod selectors or complex Ingress rules.

  345. Question 345 of 597An API service named 'order-sync' written in Go occasionally suffers from a deadlock where the HTTP server remains responsive (returning 200 OK), but the internal background worker responsible for processing database transactions stops functioning. The team needs a reliable way to ensure Kubernetes restarts the container when this internal worker thread hangs.

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

    Show answer & explanation

    Correct answer: A. Configure a LivenessProbe using an 'exec' command that runs a custom script to check the status of the internal worker

    A liveness probe triggers a container restart when it detects an application deadlock. Using an exec handler allows you to run custom logic that verifies the background worker status directly. Readiness probes only manage traffic routing.

  346. Question 346 of 597A company uses a Kubernetes CronJob to perform a daily data synchronization task scheduled for 02:00 AM. In some instances, due to high data volume, the task takes longer than 24 hours to complete, leading to the next day's job starting while the previous one is still active. This overlap causes database locking issues and data corruption. You must ensure that if a job is still running from the previous day, the new execution is skipped entirely. Which concurrency policy should you implement in the CronJob manifest?

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

    Show answer & explanation

    Correct answer: A. Assign the concurrencyPolicy to Forbid to prevent the CronJob controller from starting a new job if the previous instance has not yet finished its execution.

    The Forbid policy prevents concurrent executions, ensuring a new job is skipped if the previous one is still running. Replace would terminate the existing job, which violates the requirement to skip the new execution entirely.

  347. Question 347 of 597You are migrating a microservice named payment-api to Kubernetes. The application is hardcoded to connect to a database using the hostname db-prod.internal.corp. For architectural reasons, this database will remain hosted on an external on-premises server outside the Kubernetes cluster. You need to allow the Pods in your cluster to resolve db-prod.internal.corp to the external IP address 192.168.1.50 without modifying the application code or using a Headless service with manually created Endpoints.

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

    Show answer & explanation

    Correct answer: C. Create a Service of type ExternalName and set the externalName field to the database DNS name

    An ExternalName service creates a CNAME record that maps an internal service name to an external DNS name. While Option C matches the official answer, an ExternalName service technically accepts IP addresses directly in modern Kubernetes clusters.

  348. Question 348 of 597You are configuring an Ingress resource to manage traffic for a corporate portal. The platform hosts a frontend application and a search service. You need to ensure that all traffic coming to portal.example.com is routed to the service named frontend-svc on port 80, except for requests that start with the path /search, which must be routed to the search-svc on port 8080. Both services reside in the same namespace.

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

    Show answer & explanation

    Correct answer: B. Configure a single Ingress with a host rule and two paths under the paths list

    A single Ingress resource can define a host alongside a list of paths, allowing traffic routing to different backend services based on the URL. NodePort or multiple Ingresses are not needed for basic path-based routing.

  349. Question 349 of 597Your engineering team is developing a microservice that requires a local cache file to be continuously updated from a remote legacy file server. The application code itself cannot be modified to include this synchronization logic. You decide to use a multi-container Pod where a secondary container runs a synchronization script that pulls data into a shared volume accessible by the main application container. Which container pattern and volume type best facilitate this architecture without persisting data across Pod restarts?

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

    Show answer & explanation

    Correct answer: D. Utilizing a Sidecar container pattern with an emptyDir volume type

    The Sidecar pattern is the standard way to extend the main container without modifying its code, and an emptyDir provides temporary shared storage. Other volume types like a PVC would persist data across Pod restarts.

  350. Question 350 of 597You are managing a data-intensive application that runs as a non-root user (UID 1005) for security hardening. The application needs to write large temporary files to a PersistentVolume mounted at /data/scratch. Even though the volume is successfully mounted, the application receives 'Permission Denied' errors when trying to create files. The storage provider mounts the volume with root ownership by default. Which security setting should you add to the Pod specification to resolve this access issue?

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

    Show answer & explanation

    Correct answer: A. Configure 'fsGroup: 1005' in the Pod-level securityContext to change the group ownership of the mounted volume.

    Setting fsGroup in the Pod security context automatically changes the group ownership of mounted volumes to the specified ID. This allows the non-root user to write to the storage without requiring privileged access or insecure chmod commands.

  351. Question 351 of 597An Ingress resource is being used to route traffic to a collection of microservices. One service, 'legacy-api', expects all incoming traffic to arrive at its root path ('/'). However, the Ingress is configured to route traffic based on the path prefix '/v1/api/legacy'. When a user requests 'example.com/v1/api/legacy/users', the service receives the full path and returns a 404 error. Which annotation should be added to the Ingress resource to strip the prefix before the request reaches the backend?

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

    Show answer & explanation

    Correct answer: C. nginx.ingress.kubernetes.io/rewrite-target: /

    The nginx rewrite-target annotation instructs the Ingress controller to replace the matched URL path with the specified value before forwarding the request. The backend-protocol annotation only changes the transport layer and does not alter the URI.

  352. Question 352 of 597Your company has recently purchased a set of nodes equipped with high-performance GPU hardware intended specifically for the 'data-science' team's workloads. You want to ensure that regular application Pods from other teams are never scheduled on these specialized nodes, while simultaneously ensuring that the data science Pods explicitly request and are allowed to run on them. Which Kubernetes features must be combined to achieve this exclusive scheduling?

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

    Show answer & explanation

    Correct answer: B. Taints on the specialized nodes and Tolerations on the data science Pods

    Applying taints to nodes repels all Pods unless they possess a matching toleration. While node selectors help target specific nodes, only taints strictly prevent standard Pods from scheduling there.

  353. Question 353 of 597An application developer needs to ensure that every log entry produced by their 'order-processor' Pod contains the Pod's own IP address and the name of the Node it is running on. This is required for advanced correlation in a centralized logging system. Rather than hardcoding these values or using the Kubernetes API from within the application, you want to inject this information automatically as environment variables. Which Kubernetes feature should be used to provide Pod-level metadata to the application containers?

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

    Show answer & explanation

    Correct answer: C. The Downward API, mapping fieldRef paths like status.podIP and spec.nodeName to environment variables.

    The Downward API exposes Pod metadata like IP and Node name directly to containers as environment variables or files. Avoid using init containers or the Kubernetes API for this, as the Downward API provides this data natively without extra RBAC permissions.

  354. Question 354 of 597You are managing an Ingress resource for a global SaaS platform. You need to route traffic based on the URL path: requests to 'saas.com/app' should go to the 'web-frontend' service, and 'saas.com/api' should go to the 'api-backend' service. For any other path that does not match these rules, traffic must be directed to a 'maintenance-page' service. How should you configure the Ingress to handle the unmatched traffic?

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

    Show answer & explanation

    Correct answer: D. Define the 'maintenance-page' service as the defaultBackend at the top level of the Ingress resource specification

    The defaultBackend field is explicitly designed to handle requests that do not match any defined host or path rules. Using a wildcard path is less reliable because evaluation order and priority can vary between different Ingress controller implementations.

  355. Question 355 of 597You are deploying a network diagnostic tool as a Pod in your Kubernetes cluster. The container needs to perform low-level network operations, such as capturing raw packets and modifying network interfaces, which are typically restricted by the Linux kernel. Instead of running the container as fully privileged, which is against security best practices, you want to grant only the specific Linux capabilities required for these tasks. How should you configure the container's security context?

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

    Show answer & explanation

    Correct answer: D. Add the NET_ADMIN and NET_RAW capabilities to the capabilities block within the container's securityContext.

    Adding capabilities like NET_ADMIN and NET_RAW within the container securityContext grants the exact privileges needed for network tools. Setting privileged to true violates the principle of least privilege by granting all capabilities rather than the specific ones required.

  356. Question 356 of 597A corporate security audit requires that all logs generated by a legacy application be encrypted before they are transmitted to a centralized logging server. The legacy application, currently containerized, only supports writing raw text logs to a local file system and lacks native encryption capabilities. You must implement a solution that intercepts these logs, encrypts them, and handles the secure transmission without modifying the original application code. What Kubernetes pattern should you use?

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

    Show answer & explanation

    Correct answer: B. Deploy a sidecar container in the same Pod that shares a volume with the main container to read, encrypt, and forward the log data.

    Deploying a sidecar container that shares a volume with the main application cleanly separates log encryption from the legacy business logic. The sidecar reads the raw files and securely forwards them, fully adhering to the single container per concern design.

  357. Question 357 of 597A shared development namespace has a ResourceQuota that limits the total CPU and Memory requests for all Pods. A developer is attempting to deploy a new microservice, but the Pod remains in a 'Pending' state indefinitely. Upon investigation, you find that the Pod does not have any resource requests or limits defined in its manifest. The namespace does not have a LimitRange configured. Why is the Pod failing to schedule, and how should it be corrected?

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

    Show answer & explanation

    Correct answer: C. The Pod is stuck because Kubernetes requires all Pods in a quota-restricted namespace to have explicit resource requests defined.

    When a ResourceQuota restricts CPU or Memory, Kubernetes requires every Pod to explicitly define resource requests so usage can be tracked. Adding explicit requests to the manifest solves this, or a LimitRange could be added to provide defaults.

  358. Question 358 of 597An engineering team is migrating a Node.js web application that requires a complex configuration file to be generated at runtime before the main process starts. The generation script is written in Python and requires specific libraries that are not included in the lightweight Node.js production image. The generated file must be placed in a shared directory accessible by the Node.js process at /app/config/settings.json.

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

    Show answer & explanation

    Correct answer: B. Use an initContainer with the Python image to generate the file into an emptyDir volume shared with the main container

    Init containers run to completion before the main application container starts. Sharing an emptyDir volume lets the init container generate the configuration file securely. Sidecars run concurrently, so the app might start before the file exists.

  359. Question 359 of 597A development team is migrating a microservice named order-processor to a Kubernetes cluster. The service needs to connect to an external legacy Oracle database located on-premises. This database requires a complex, proprietary authentication handshake and encrypted tunnel that the current Node.js application is not designed to handle natively. The security team insists that the application should not contain any logic related to the connection tunnel or authentication credentials, but it should instead communicate with a local endpoint on localhost. You need to implement a solution that follows best practices for Kubernetes application design patterns to bridge this gap. How should you configure the Pod for order-processor to satisfy these requirements?

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

    Show answer & explanation

    Correct answer: C. Deploy a sidecar container running a specialized proxy that handles the authentication and tunnel, allowing the application to connect via localhost.

    The ambassador pattern uses a sidecar proxy to handle complex external connections. Containers in the same pod share the network namespace, allowing the app to connect via localhost. Init containers cannot maintain long-running network tunnels.

  360. Question 360 of 597Your organization has a strict network security policy. A Pod named 'payment-api' in the 'finance' namespace needs to communicate with an external PostgreSQL database at the IP address 192.168.1.100 on port 5432. All other outbound traffic from this Pod must be blocked to prevent data exfiltration. The cluster uses a network plugin that supports Kubernetes NetworkPolicies.

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

    Show answer & explanation

    Correct answer: B. Define an Egress NetworkPolicy with a CIDR selector for 192.168.1.100/32 and the specific port 5432

    An egress network policy whitelists specific destination IP ranges and ports. Creating a rule for the database IP automatically blocks all other non-matching outbound traffic. Ingress rules only control incoming traffic, not outbound.

  361. Question 361 of 597You need to process 100 independent data chunks using a batch processing tool. Each chunk takes about 2 minutes to process. To meet your deadline, you want to process 5 chunks simultaneously at any given time. The process should continue until all 100 chunks have been successfully completed. If a specific task fails, it should be retried automatically by the system.

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

    Show answer & explanation

    Correct answer: C. Define a Job with 'completions: 100' and 'parallelism: 5' to manage the execution and retries of the tasks.

    A Kubernetes Job handles batch processing tasks by running pods to completion. Setting completions to 100 and parallelism to 5 runs five tasks simultaneously until all finish. Deployments and StatefulSets are for long-running services, not finite tasks.

  362. Question 362 of 597A legacy application in your production environment outputs critical performance metrics in a specialized XML format to its standard output. Your centralized monitoring platform only accepts metrics in a specific JSON schema via a REST API. You need to implement a mechanism that captures the XML logs from the application container, transforms them into the required JSON format, and transmits them to the monitoring server without altering the original application image or code. Which design pattern and implementation strategy should you choose to fulfill this requirement while ensuring high decoupling?

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

    Show answer & explanation

    Correct answer: B. Deploy an adapter container within the same Pod that reads the XML output from a shared volume or standard stream and converts it into the JSON format required by the monitoring platform.

    The adapter pattern standardizes output by transforming data within a sidecar container. Reading from a shared volume lets the adapter translate XML logs into the required JSON format. This decouples the legacy app from the monitoring platform.

  363. Question 363 of 597A Python-based microservice responsible for processing heavy financial data occasionally encounters a localized deadlock in its processing thread. Although the main process remains alive and the container status is marked as 'Running', the application stops responding to health checks and ceases to pull work from the message queue. You need to implement a mechanism that automatically detects this frozen state and restarts the container to restore service. Which configuration should be added to the Pod specification to handle this scenario effectively?

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

    Show answer & explanation

    Correct answer: C. Define a Liveness probe using an HTTP GET check against a health endpoint

    A liveness probe checks if an application is responsive and restarts the container if it fails. Since the process is deadlocked but running, only a liveness probe triggers a restart. Readiness probes only remove pods from service endpoints.

  364. Question 364 of 597You are deploying a Java-based microservice that requires a complex set of database schema migrations to be performed before the application starts. The migration tool is a standalone binary that is not included in the main application container image. You want to ensure the migrations run successfully every time a Pod is created or restarted, and the main application container should only start if the migrations complete without error.

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

    Show answer & explanation

    Correct answer: B. Use an InitContainer with the migration tool image to run the schema update script before the main container starts.

    Init containers run to completion before the main application container starts. If the migration fails, the init container errors out and prevents the main application from starting. PostStart hooks run concurrently with the main app, causing race conditions.

  365. Question 365 of 597You are managing a multi-tenant cluster with two namespaces: 'frontend-apps' and 'backend-services'. A strict security policy requires that Pods in the 'backend-services' namespace should only accept incoming traffic from specific Pods in the 'frontend-apps' namespace that have the label 'app: web-portal'. Traffic from any other Pods, even within the same namespace or from other namespaces, must be blocked. Which NetworkPolicy configuration in the 'backend-services' namespace would correctly implement this requirement?

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

    Show answer & explanation

    Correct answer: B. An ingress policy with a from section containing both a namespaceSelector matching 'frontend-apps' and a podSelector matching 'app: web-portal'.

    A network policy isolates pods by selecting specific sources for traffic. Using both a namespaceSelector and podSelector inside the from block restricts traffic precisely to the frontend pods. Without a namespaceSelector, traffic would be allowed from any namespace.

  366. Question 366 of 597Your application requires a database password to be injected as an environment variable. The password is stored in a Secret named db-secrets under the key 'DB_PASS'. Additionally, the application needs to read a shared configuration file from a ConfigMap named app-config, which should be mounted as a read-only file at /etc/config/settings.json. You must ensure that only the 'settings.json' key from the ConfigMap is visible in that directory.

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

    Show answer & explanation

    Correct answer: C. Use secretKeyRef for the environment variable and volumeMounts with subPath for the file

    The secretKeyRef correctly targets a specific key for the environment variable, while subPath cleanly mounts just the target file from the ConfigMap. Using envFrom would incorrectly inject all Secret keys, violating the principle of least privilege required for strict configuration.

  367. Question 367 of 597A critical customer-facing dashboard is managed via a Kubernetes Deployment with 5 replicas. The business requirement states that during any update to the application, the service must never drop below its current capacity of 5 replicas to ensure 100% availability and performance. However, the cluster has enough spare resources to temporarily run additional Pods during the transition period. You need to configure the RollingUpdate strategy to meet these strict availability requirements. Which strategy configuration should be applied to the Deployment manifest?

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

    Show answer & explanation

    Correct answer: D. Set maxUnavailable to 0 and maxSurge to a value greater than 0 such as 25%.

    Setting maxUnavailable to 0 ensures no healthy pods are terminated during the rollout. The maxSurge setting allows creating extra pods first, whereas setting maxUnavailable higher risks dropping below the required replica capacity.

  368. Question 368 of 597A legacy monitoring tool deployed in your cluster outputs raw metrics via UDP packets to a local destination. Your company requires these metrics to be forwarded to an external cloud-based analytics platform that only accepts encrypted HTTPS gRPC calls. The legacy tool cannot be modified to support encryption or gRPC. To solve this, you decide to implement a design pattern that offloads the communication logic to a helper container within the same Pod, which will handle the protocol translation and secure transmission to the cloud provider. Which configuration best describes the implementation of this pattern?

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

    Show answer & explanation

    Correct answer: D. Deploy an Ambassador container that listens for UDP traffic on localhost and proxies it to the external HTTPS endpoint.

    An Ambassador container acts as a local proxy representing an external service, handling protocol translation securely. The Adapter pattern modifies outbound data formatting, while a Sidecar typically augments the main container without proxying external connections.

  369. Question 369 of 597A legacy enterprise application is being migrated to a Kubernetes cluster but requires a complex sharding logic to communicate with an external database. The development team does not want to modify the application's source code to include this logic. Instead, they decide to deploy a proxy container within the same Pod that handles the connection routing and sharding based on the application's local requests to localhost. This allows the application to remain unaware of the underlying database complexity while the proxy manages the distribution of data across multiple shards.

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

    Show answer & explanation

    Correct answer: D. Deploy an Ambassador container within the Pod to act as a local proxy for external service discovery and routing.

    The Ambassador pattern deploys a local proxy container managing complex external routing for the main app. The Adapter pattern transforms standard application output, whereas Init containers only execute during startup before the app runs.

  370. Question 370 of 597A legacy web application is being migrated to Kubernetes. The application was designed to work only with sticky sessions because it stores user session data in local memory rather than a distributed cache. When the application is scaled to multiple replicas, users are frequently logged out because their subsequent requests are routed to different Pods. How should you configure the Kubernetes Service to ensure a client is consistently routed to the same Pod for the duration of their session?

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

    Show answer & explanation

    Correct answer: B. Configure sessionAffinity to ClientIP within the Service manifest specification

    Setting sessionAffinity to ClientIP in the Service manifest ensures requests from the same IP reach the same Pod. While Ingress controllers offer external hashing, native Service configuration is the direct Kubernetes way to handle this traffic steering.

  371. Question 371 of 597A complex Java-based microservice named report-engine takes approximately 120 seconds to fully initialize its internal cache and start listening for connections on port 8080. If the standard liveness probe starts checking the application too early, it fails and the kubelet restarts the container, leading to an infinite crash loop. You need to implement a solution that delays the liveness checks until the application is ready, but you want to avoid setting a very long initialDelaySeconds on the liveness probe to ensure quick detection of deadlocks later.

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

    Show answer & explanation

    Correct answer: C. Add a startupProbe that checks port 8080 and has a sufficient failureThreshold and periodSeconds

    A startup probe disables liveness and readiness checks until it succeeds, which is perfect for slow-starting applications. Relying solely on a high liveness probe failure threshold delays deadlock detection after the application finally starts.

  372. Question 372 of 597An e-commerce platform is transitioning from a monolithic architecture to microservices. The marketing team requires that requests to 'api.example.com/v1/orders' are routed to a stable legacy service, while requests to 'api.example.com/v2/orders' are routed to a new, optimized service for beta testing. The cluster uses an NGINX Ingress Controller to manage external access. What is the most efficient way to configure the Ingress resource to achieve this path-based routing for a single host?

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

    Show answer & explanation

    Correct answer: C. Configure one Ingress resource with multiple paths under the same host rule

    A single Ingress resource can define multiple paths under one host, routing traffic to different backend Services based on the URL. Deploying multiple Ingress controllers is unnecessary and overly complex for simple path-based routing.

  373. Question 373 of 597A Pod named file-manager runs a container as a non-privileged user with UID 3000. This Pod mounts a PersistentVolume (PV) at the path /data to store application logs and user uploads. During testing, the application fails to start because it lacks the necessary permissions to write to the /data directory, which is currently owned by the root user. You need to ensure that the volume is accessible and writable by the container's user without changing the container to run as root.

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

    Show answer & explanation

    Correct answer: B. Add a securityContext to the Pod spec and set the fsGroup field to 3000 to automatically change the ownership of the mounted volume.

    Setting fsGroup in the Pod securityContext automatically adjusts mounted volume ownership to match the container's group. Using an init container to change permissions is unnecessarily complex compared to this native Kubernetes feature.

  374. Question 374 of 597Your engineering team is migrating an application that is hardcoded to connect to a database using the internal DNS name 'db-prod.internal'. Currently, the database is being moved to an external cloud-managed service that provides a long, complex Fully Qualified Domain Name (FQDN) like 'rds-db-123.region.amazonaws.com'. You want the application to continue using 'db-prod.internal' without changing its configuration. What type of Kubernetes Service should you create to redirect this traffic?

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

    Show answer & explanation

    Correct answer: A. A Service of type ExternalName with the AWS FQDN as the value

    An ExternalName Service acts as a DNS alias, cleanly mapping an internal Kubernetes name to an external FQDN. Headless Services with manual endpoints are better suited for static IP addresses rather than dynamic cloud FQDNs.

  375. Question 375 of 597An image processing team needs to process a batch of 20 high-resolution images stored in an object storage bucket. Each image takes approximately 5 minutes to process, and each task is handled by a single Pod that exits once the work is done. To optimize the total processing time and effectively use cluster resources, the team wants to process exactly 4 images simultaneously at any given time until all 20 images have been completed successfully. You must configure a Kubernetes Job to meet these requirements.

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

    Show answer & explanation

    Correct answer: A. Configure a Job with completions set to 20 and parallelism set to 4 to ensure the work is distributed according to the team's performance goals.

    Setting completions to 20 ensures all files process, and parallelism dictates running 4 concurrent Pods to handle the workload efficiently. Deployments are designed for long-running services, not batch tasks that exit upon completion.

  376. Question 376 of 597A retail company uses a legacy inventory management system that outputs application logs in a proprietary XML format. The DevOps team has recently implemented a centralized monitoring solution based on Prometheus and Grafana, which exclusively consumes metrics and logs in JSON format. You need to ensure that these logs are converted in real-time before they are shipped to the central collector, without making any modifications to the original legacy application's source code or its container image. Which design pattern should you implement within the Pod to meet this requirement?

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

    Show answer & explanation

    Correct answer: A. Deploy an Adapter container that reads the XML logs and exports them in JSON

    An Adapter container translates the primary application's output into a format the monitoring system expects, standardizing the logs without altering the legacy code. A Sidecar merely forwards raw logs without performing the required translation.

  377. Question 377 of 597A data processing team has a Kubernetes Job that processes 50 large files. Occasionally, the processing of a specific file takes much longer than expected due to external network latency, causing the Job to hang for hours and block subsequent tasks in the CI/CD pipeline. You want to ensure that if the entire Job takes longer than 1800 seconds (30 minutes) to complete, Kubernetes should terminate all active Pods and stop the Job execution entirely. Which parameter should you set in the Job manifest?

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

    Show answer & explanation

    Correct answer: A. Set 'activeDeadlineSeconds' to 1800 in the Job specification (spec) block.

    The activeDeadlineSeconds field sets a hard time limit for the entire Job, terminating active Pods once it expires. The ttlSecondsAfterFinished parameter only controls how long a completed Job lingers before automatic deletion.

  378. Question 378 of 597A data processing team uses a Kubernetes Job to run a complex simulation that usually takes 20 minutes to complete. Occasionally, due to an external API hang, the simulation process enters an infinite loop, consuming CPU resources indefinitely and incurring high cloud costs. The team needs to ensure that if the simulation does not finish within 45 minutes, Kubernetes automatically terminates the Job and its associated Pods to prevent resource waste. Which Job-specific field should be used to enforce this time limit?

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

    Show answer & explanation

    Correct answer: A. Set the activeDeadlineSeconds field to 2700 in the Job specification.

    The activeDeadlineSeconds field sets the absolute duration limit for a Job, terminating its Pods automatically if exceeded. Avoid using livenessProbe for this, as probes check container health rather than total Job execution time.

  379. Question 379 of 597A web application 'frontend-service' is exposed via a ClusterIP Service on port 80. Despite the Pods being in a 'Running' state and the Deployment showing the desired number of replicas, users are experiencing 503 errors when trying to reach the service. You have verified that the Service and Pods are in the same namespace and that the Service port matches the containerPort. You now need to verify if the Service is correctly identifying and routing traffic to the back-end Pods.

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

    Show answer & explanation

    Correct answer: A. Check the 'Endpoints' object associated with the Service to confirm that it contains the IP addresses of the running Pods.

    The Endpoints object tracks which Pod IPs are eligible to receive traffic from a Service. If this list is empty, your Service selector is not matching the Pod labels, which explains the connection failures.

  380. Question 380 of 597You are hosting a production web application on a Kubernetes cluster with an Ingress controller. The security team has mandated that all HTTP traffic must be automatically redirected to HTTPS to ensure data encryption in transit. You need to configure this behavior globally for a specific Ingress resource without modifying the underlying Ingress controller's global configuration file.

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

    Show answer & explanation

    Correct answer: A. Add an annotation such as 'nginx.ingress.kubernetes.io/ssl-redirect: true' to the metadata of the Ingress resource.

    Ingress controllers rely on specific metadata annotations to enable features like SSL redirection on a per-resource basis. Changing the backend protocol or Service ports will not configure the controller to issue redirects.

  381. Question 381 of 597An old stateful application named 'user-session-store' is being scaled to 3 replicas to handle increased traffic. However, users report that they are being logged out intermittently. Investigation reveals that the application stores session data in local memory, so a user's request must always be sent to the same Pod where their session was initially created.

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

    Show answer & explanation

    Correct answer: A. Configure the Service with sessionAffinity set to ClientIP to ensure sticky sessions based on the user's IP address

    Setting sessionAffinity to ClientIP on a Service ensures requests from the same IP route consistently to the same backing Pod. While Ingress annotations offer cookies, native Service stickiness requires this setting.

  382. Question 382 of 597A security policy mandates that a data-processing container must run with a strictly enforced read-only root filesystem to prevent unauthorized modifications or persistent malware. However, the application requires a single directory at '/var/app/cache' to be writable for temporary processing files. You need to configure the Pod specification to meet these security requirements while allowing the application to function.

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

    Show answer & explanation

    Correct answer: C. Set the securityContext 'readOnlyRootFilesystem' to true and mount an 'emptyDir' volume specifically at '/var/app/cache'.

    Setting readOnlyRootFilesystem to true secures the container, while an emptyDir volume mount provides the necessary writable scratch space. Never use privileged mode, as it entirely bypasses container security boundaries.

  383. Question 383 of 597Your organization is hosting a suite of microservices where the 'inventory-service' pods are frequently scaled up and down based on demand. You need to expose these pods to other internal services within the cluster using a stable hostname. You must ensure that the traffic is only directed to pods that are fully initialized and ready to handle requests, avoiding any 'Connection Refused' errors during scaling events. Which Kubernetes resource and configuration will provide a stable internal IP and automated traffic filtering based on pod readiness?

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

    Show answer & explanation

    Correct answer: A. A Service of type ClusterIP with a label selector matching the inventory pods, which automatically manages an Endpoints object based on readiness probes.

    A ClusterIP Service provides a stable IP and automatically routes traffic only to Pods passing their readiness probes. A Headless Service bypasses this load balancing, returning all Pod IPs directly.

  384. Question 384 of 597Your team is migrating a microservices-based application to Kubernetes, but the central relational database is still hosted on a legacy physical server outside the cluster with a static IP address of 192.168.10.50. You want the Kubernetes-based microservices to reach this database using the DNS name 'internal-db' so that if the IP changes later, you only need to update one Kubernetes resource rather than the application code. How can you achieve this using Kubernetes Service objects?

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

    Show answer & explanation

    Correct answer: C. Create a Service without a selector, then manually create an Endpoints object with the same name pointing to 192.168.10.50.

    Creating a selectorless Service paired with a manually created Endpoints object maps a cluster DNS name to an external IP. An ExternalName Service requires a DNS name, not an IP address.

  385. Question 385 of 597You are updating a high-availability 'order-engine' Deployment from version 'v1' to 'v2'. The Deployment currently runs with 10 replicas. To ensure that the system's capacity never drops below 80% during the update process and that the cluster does not exceed its resource limits by more than 2 additional Pods at any given time, you need to configure the rolling update strategy parameters.

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

    Show answer & explanation

    Correct answer: D. Set 'maxUnavailable' to 2 and 'maxSurge' to 2 within the Deployment's rollingUpdate strategy configuration.

    Setting maxUnavailable to 2 guarantees 8 Pods remain running, while maxSurge limits the total to 12 Pods during the update. Option B uses percentages that incorrectly allow 3 unavailable Pods.

  386. Question 386 of 597A high-availability transaction API service is currently running with 12 replicas in a production Kubernetes cluster. To ensure business continuity during an upcoming software update, the management has established two strict constraints: first, at least 10 replicas must remain available and ready to serve traffic at all times; second, the total number of Pods running in the cluster for this deployment must never exceed 15 during the rollout process. How should you configure the RollingUpdate strategy in the Deployment manifest to satisfy these constraints?

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

    Show answer & explanation

    Correct answer: A. Set maxUnavailable to 2 and maxSurge to 3 in the deployment strategy

    Setting maxUnavailable to 2 ensures at least 10 Pods remain available, while maxSurge limits total running Pods to 15. Options with a maxSurge of 15 or maxUnavailable of 10 violate the stated replica boundaries.

  387. Question 387 of 597A developer is complaining that every time they update a ConfigMap, the application Pods continue to use the old configuration data. Investigation reveals that the ConfigMap is mounted as a volume. However, the application only reads its configuration file once at startup and does not watch for changes on the filesystem. The developer wants a solution that ensures all Pods are automatically restarted whenever the ConfigMap data changes, ensuring the new values are loaded. What is the standard practice for this?

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

    Show answer & explanation

    Correct answer: B. Adding a version-specific annotation to the Pod template in the Deployment that changes when the ConfigMap changes

    Adding a dynamic annotation, like a config hash, to the Pod template forces a rolling restart when the ConfigMap changes. Kubernetes does not automatically restart Pods when mounted ConfigMap volumes update.

  388. Question 388 of 597Your engineering team is deploying a sensitive microservice named report-exporter in the production namespace. This microservice is designed to send daily PDF reports to a specific external FTP server located at the static IP address 203.0.113.10. For security reasons, the organization requires that this Pod is completely blocked from accessing any other internal services within the cluster and any other external internet addresses. You need to implement a solution that specifically permits outgoing traffic only to this single IP address while denying all other egress traffic.

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

    Show answer & explanation

    Correct answer: A. Create a NetworkPolicy with an egress rule containing an ipBlock that specifies 203.0.113.10/32 and an empty podSelector for other rules.

    Using a default-deny NetworkPolicy with an egress rule for a specific ipBlock perfectly restricts outgoing traffic to the target IP. Ingress resources manage incoming traffic, while ExternalName services merely alias DNS names without restricting outbound network access.

  389. Question 389 of 597A modern data analytics platform generates operational metrics in a legacy XML format. The central monitoring system, however, only supports JSON ingestion via a specific REST endpoint. Your team needs to implement a solution where the transformation happens locally within the same Pod to avoid altering the legacy application code or adding network overhead. Which design pattern and implementation details would best address this requirement in a Kubernetes environment?

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

    Show answer & explanation

    Correct answer: A. Implement an Adapter container that reads the XML output from a shared volume, converts it to JSON, and exposes it.

    The adapter pattern standardizes main container output into formats external systems expect by processing shared files locally. An ambassador container proxies external network traffic, while a sidecar is a general term not specific to data translation.

  390. Question 390 of 597Your organization is migrating a high-performance microservice to Kubernetes that uses gRPC for all internal communications. To ensure the highest level of reliability, you want to implement a liveness probe that checks the application's health using the native gRPC Health Checking Protocol. The service listens on port 9000. Starting with Kubernetes 1.24+, you want to use the built-in gRPC probe support instead of bundling a separate 'grpc-health-probe' binary inside your container image. Which configuration achieves this?

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

    Show answer & explanation

    Correct answer: D. Use a Liveness Probe with the grpc field, specifying the port as 9000 and leaving the service field empty or set to the appropriate service name.

    Native gRPC probes use the dedicated grpc field allowing the kubelet to properly check application health without extra binaries. A TCP socket probe only verifies the connection, failing to detect deadlocks at the application layer.

  391. Question 391 of 597You are securing a multi-tenant application where the 'frontend' pods in the 'web-system' namespace must communicate with 'backend' pods in the 'data-api' namespace. To follow the principle of least privilege, you need to create a NetworkPolicy in the 'data-api' namespace that restricts ingress traffic. The policy should only permit traffic if the source pod has the label 'tier: frontend' and belongs to the namespace labeled 'purpose: production'. How should you structure the ingress rule in the NetworkPolicy to combine these two specific requirements?

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

    Show answer & explanation

    Correct answer: A. Configure an ingress rule with both a namespaceSelector and a podSelector as separate items in the same peer element to ensure both conditions must be met.

    When you define a namespaceSelector and a podSelector within the same networkPolicyPeer block, they act as a logical AND. Placing them in separate peer blocks would act as an OR, allowing unwanted traffic from any matching pod.

  392. Question 392 of 597You are performing a Blue-Green deployment for a high-traffic API. The current version (Blue) is managed by a Deployment named 'api-v1' and is exposed by a Service named 'api-service' using the selector 'app: api, version: v1'. You have successfully deployed the new version (Green) via a Deployment named 'api-v2' with the labels 'app: api, version: v2'. After verifying that the Green pods are healthy, you need to switch all production traffic from version 1 to version 2 instantly. What is the most efficient and standard way to perform this switch?

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

    Show answer & explanation

    Correct answer: A. Update the selector of the 'api-service' Service to change the 'version' label from 'v1' to 'v2', effectively re-pointing the service to the new pods.

    Updating the Service selector is the defining step of a Blue-Green deployment, allowing an instantaneous traffic switch at the networking layer. Changing DNS records or performing a rolling update defeats the purpose of maintaining both deployments for an immediate cutover.

  393. Question 393 of 597A developer is deploying a microservice named 'auth-processor' into the 'security-prod' namespace. The namespace is governed by a ResourceQuota that limits total CPU requests to 2000m and total Memory requests to 4Gi. The deployment is configured with 5 replicas, each requesting 500m CPU and 1Gi of Memory. After applying the manifest, the developer notices that none of the Pods are reaching the Running state and remain in a Pending phase with a 'FailedScheduling' event. How should the deployment be corrected?

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

    Show answer & explanation

    Correct answer: A. Reduce the total requested resources per pod or the replica count to fit within the 2000m CPU and 4Gi Memory limit

    The cumulative resource requests of the deployment exceed the namespace quota, causing the scheduler to keep the pods pending. You must lower the requested resources per pod or reduce the replica count to fit within the hard quota limits.

  394. Question 394 of 597In a multi-tenant cluster, you have two namespaces: 'accounting' and 'inventory'. To comply with internal security regulations, the 'accounting-db' Pod in the 'accounting' namespace must only be accessible by Pods that are located in the 'inventory' namespace. All other traffic, including traffic from within the 'accounting' namespace itself, must be blocked. How should you configure this isolation?

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

    Show answer & explanation

    Correct answer: C. Create a NetworkPolicy in the 'accounting' namespace with an ingress rule using a 'namespaceSelector' that matches the 'inventory' namespace labels.

    A NetworkPolicy using a namespaceSelector is the correct approach for restricting ingress to a specific namespace. RBAC roles only restrict Kubernetes API access and do not block network traffic between pods.

  395. Question 395 of 597Your organization operates a multi-tenant cluster where the 'secure-backend' namespace hosts a sensitive PostgreSQL database. A strict security policy dictates that this database must only accept incoming traffic on port 5432 from Pods that are specifically located within the 'frontend-prod' namespace. All other ingress traffic from any other namespace must be blocked. You are tasked with creating a NetworkPolicy in the 'secure-backend' namespace to enforce this rule. How should you define the ingress rule?

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

    Show answer & explanation

    Correct answer: A. Use a namespaceSelector with matchLabels for the frontend-prod namespace

    To restrict traffic to a specific namespace, your NetworkPolicy ingress rule must use a namespaceSelector matching the labels of the target namespace. Standard podSelectors without namespaceSelectors apply only within the same namespace.

  396. Question 396 of 597You are investigating a recurring issue where a memory-intensive Java application Pod is being terminated with the status 'OOMKilled'. Upon checking the Pod manifest, you see that the memory request is set to 512Mi and the limit is set to 1Gi. Monitoring data shows that the application heap usage grows steadily over several hours until the termination occurs. The developers suggest that the application is behaving normally under heavy load. What is the most appropriate action to prevent these restarts in the future?

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

    Show answer & explanation

    Correct answer: B. Increase the memory limit in the Pod specification to accommodate the load

    An OOMKilled status indicates the container exceeded its hard memory limit, so increasing the memory limit gives the application the necessary headroom. Pod priority and CPU adjustments do not prevent the kernel from killing a process that exceeds its memory constraints.

  397. Question 397 of 597Your team is managing a Node.js application that requires a specific environment variable named DATABASE_URL to establish a connection to the data layer. However, the organization's existing ConfigMap, named shared-db-config, stores this value under the key connection_string. Due to other legacy applications depending on this ConfigMap, you are not allowed to modify its keys. You must configure the Deployment so that the value of connection_string in the ConfigMap is correctly mapped to the DATABASE_URL variable inside the container.

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

    Show answer & explanation

    Correct answer: A. Use the valueFrom field with configMapKeyRef to map the specific key connection_string from the ConfigMap to the environment variable DATABASE_URL.

    The valueFrom field with configMapKeyRef provides explicit one-to-one key mapping for environment variables. This decouples the application's expected variable name from the ConfigMap key. The envFrom field imports all keys without allowing renaming.

  398. Question 398 of 597Your organization is deploying a high-traffic API that must remain highly available during updates. The current deployment has 20 replicas. The engineering lead specifies that during a rolling update, the system must never drop below 80 percent of its desired capacity to maintain performance. Additionally, to avoid overloading the cluster nodes, the deployment should not exceed 125 percent of its desired replica count at any point during the update process. How should you configure the rolling update strategy in the Deployment manifest?

    Select 2 answers.

    Show answer & explanation

    Correct answer: C. Set maxUnavailable to 4 units and maxSurge to 25 percent in the strategy block. · D. Set maxUnavailable to 20 percent and maxSurge to 5 units in the strategy block.

    Setting maxUnavailable to 4 maintains 16 pods, exactly 80 percent of the desired capacity. Setting maxSurge to 25 percent allows 5 extra pods, reaching the 125 percent maximum limit. Options using percentages incorrectly calculate the available units.

  399. Question 399 of 597A security audit of the 'customer-portal' application revealed that the container is running with excessive privileges. Specifically, the container is running as the root user, and the entire root filesystem is writable, which could allow an attacker to install malicious tools if the application is compromised. The application only needs to write temporary data to /var/log/app/.

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

    Show answer & explanation

    Correct answer: A. Set runAsNonRoot to true and configure a securityContext with readOnlyRootFilesystem set to true, while mounting an emptyDir at /var/log/app/

    Setting readOnlyRootFilesystem to true secures the container, and an emptyDir allows necessary application logging. Using a hostPath volume violates security isolation, and resource quotas restrict disk usage but do not prevent root filesystem tampering.

  400. 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.

  401. 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.

  402. 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.

  403. 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.

  404. 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.

  405. 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.

  406. 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.

  407. 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.

  408. 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.

  409. 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.

  410. 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.

  411. 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.

  412. 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.

  413. 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.

  414. 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.

  415. 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.

  416. 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.

  417. 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.

  418. 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.

  419. 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.

  420. 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.

  421. 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.

  422. 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.

  423. 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.

  424. 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.

  425. 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.

  426. 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.

  427. 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.

  428. 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.

  429. 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.

  430. 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.

  431. 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.

  432. 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.

  433. 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.

  434. 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.

  435. 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.

  436. 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.

  437. 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.

  438. 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.

  439. 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.

  440. 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.

  441. 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.

  442. 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.

  443. 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.

  444. 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.

  445. 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.

  446. 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.

  447. 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.

  448. 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.

  449. 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.

  450. 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.

  451. 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.

  452. 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.

  453. 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.

  454. 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.

  455. 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.

  456. 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.

  457. 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.

  458. 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.

  459. 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.

  460. 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.

  461. 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.

  462. 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.

  463. 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.

  464. 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.

  465. 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.

  466. 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.

  467. 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.

  468. 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.

  469. 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.

  470. 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.

  471. 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.

  472. 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.

  473. 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.

  474. 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.

  475. 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.

  476. 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.

  477. 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.

  478. 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.

  479. 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.

  480. 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.

  481. 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.

  482. 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.

  483. 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.

  484. 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.

  485. 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.

  486. 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.

  487. 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.

  488. 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.

  489. 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.

  490. 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.

  491. 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.

  492. 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.

  493. 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.

  494. 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.

  495. 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.

  496. 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.

  497. 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.

  498. Question 498 of 597You are deploying a stateful application that runs as a non-root user with UID 1000. The application needs to write logs and data to a PersistentVolume mounted at /data. During initial testing, the application fails to start with a 'Permission Denied' error because the mounted volume is owned by the root user by default. You must ensure the application has the necessary permissions to write to the volume without changing the container's user or using an InitContainer to chmod the directory. Which SecurityContext setting should be used?

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

    Show answer & explanation

    Correct answer: B. Specify the fsGroup: 2000 in the Pod-level SecurityContext to allow Kubernetes to change the ownership of the volume.

    The fsGroup setting in the pod security context instructs Kubernetes to change the ownership of mounted volumes to the specified group ID. This directly grants the non-root application process the required write permissions without using privileged mode or init containers.

  499. Question 499 of 597You are migrating a legacy web portal to Kubernetes that was not designed for stateless operation. The portal stores active user sessions in its local memory. If a user is routed to Pod-A for their first request and Pod-B for their second, they are automatically logged out. You are exposing these Pods via a 'Service' of type 'LoadBalancer'. You need to ensure that a specific user's traffic is always sent to the same Pod replica to maintain session continuity.

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

    Show answer & explanation

    Correct answer: D. Set 'spec.sessionAffinity: ClientIP' in the Service manifest to enable session persistence based on the source IP.

    Setting sessionAffinity to ClientIP on the Service ensures requests from the same source IP are routed to the same backend Pod. This provides the required session stickiness for legacy applications, unlike standard round-robin load balancing.

  500. Question 500 of 597A sophisticated Java-based microservice takes approximately 45 seconds to initialize its internal cache and verify connections to a database. If the main 'app-server' container starts and begins accepting traffic before the database is ready, it enters a non-recoverable error state. You need to implement a mechanism within the Pod manifest to ensure that a check script, which pings the database, completes successfully before the main 'app-server' container is even allowed to start.

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

    Show answer & explanation

    Correct answer: A. Add an InitContainer to the Pod specification that runs a shell loop script to check database connectivity before exiting successfully.

    Init containers run to completion before any regular containers in a Pod are started, making them the perfect place for dependency checks. Readiness probes only prevent traffic routing and do not delay the main container's startup process.

  501. Question 501 of 597You are managing a mission-critical web application that currently runs with 10 replicas. During the deployment of a new version, your team has a strict requirement that at least 8 Pods must remain available at all times to handle the incoming traffic load. Additionally, to avoid overloading the node resources, the cluster should never run more than 12 Pods total during the rollout process. How should you configure the rollingUpdate strategy in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: B. Set maxSurge to 2 and set maxUnavailable to 2 in the deployment strategy section

    Setting maxUnavailable to 2 ensures at least 8 pods remain available during the rollout, meeting the traffic requirement. Setting maxSurge to 2 restricts the total number of pods to 12, successfully preventing node resource overload.

  502. Question 502 of 597A legacy microservice named legacy-client is being migrated to a Kubernetes cluster. The application needs to communicate with an external third-party API that strictly requires mutual TLS (mTLS) for every connection. However, the legacy application code is frozen and does not have the built-in capability to handle client-side certificates or perform the mTLS handshake. The security team mandates that the connection must be encrypted and authenticated before leaving the cluster. Which design pattern should be implemented to meet these requirements without modifying the source code?

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

    Show answer & explanation

    Correct answer: A. Deploy an Ambassador container within the same Pod to act as a local proxy that manages the mTLS handshake with the external API.

    The Ambassador pattern abstracts external service complexity by running a proxy container in the same network namespace. The legacy application connects locally while the proxy transparently handles the complex mTLS handshake.

  503. Question 503 of 597A Python-based backend application is frequently losing in-flight data when the Deployment is scaled down or during a rolling update. The application needs approximately 15 seconds to finish processing current requests and close database connections cleanly after receiving a termination signal. You need to implement a mechanism to ensure the application has enough time to shut down gracefully.

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

    Show answer & explanation

    Correct answer: A. Set the terminationGracePeriodSeconds in the Pod specification to 30 and implement a preStop hook that executes a sleep command for 15 seconds.

    A preStop hook delays container shutdown while an extended terminationGracePeriodSeconds provides ample time for cleanup. Relying solely on readiness probes does not guarantee the application enough time to process in-flight requests before termination.

  504. Question 504 of 597You are deploying a distributed database system where each individual Pod must have a stable, unique network identity (hostname) that can be reached by other Pods in the cluster. The application logic requires Pods to discover each other directly via DNS queries rather than through a single virtual IP that load balances traffic. The database instances are managed by a StatefulSet named db-node. How should the networking service be configured to support this requirement?

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

    Show answer & explanation

    Correct answer: C. Create a Headless Service by setting the clusterIP field to None and ensuring the service name matches the serviceName of the StatefulSet.

    A Headless Service sets clusterIP to None, which creates individual DNS A records for each Pod managed by the StatefulSet. This allows applications to discover specific peers directly via DNS instead of routing through a load balancer.

  505. Question 505 of 597A legacy auditing microservice in your production environment generates system logs in a proprietary XML format and saves them to a local shared volume at the path /var/log/audit.xml. Your organization's central logging server has recently been upgraded and now only accepts logs in JSON format via a standard POST request. You need to implement a solution within the same Pod to read the XML file, convert the entries to JSON, and forward them to the external server without modifying the legacy tool's source code or its container image.

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

    Show answer & explanation

    Correct answer: D. Deploy an Adapter container within the Pod that monitors the /var/log/audit.xml file, transforms the data to JSON, and forwards it to the central logging server.

    The Adapter pattern transforms primary container output to match external system standards without modifying the original image. Using a shared volume, the adapter container reads the XML logs, translates them to JSON, and forwards them successfully.

  506. Question 506 of 597A Python-based application named batch-job frequently crashes due to memory exhaustion, but the standard container logs do not capture the final error code or the reason for the crash because the process terminates too quickly for the logging agent to sync. The application is programmed to write a specific JSON error summary to /dev/termination-log just before it exits. You need to retrieve this specific error summary for troubleshooting using kubectl. How should you configure the Pod?

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

    Show answer & explanation

    Correct answer: C. Set the terminationMessagePath field in the container specification to /dev/termination-log to capture the specific exit data.

    Setting the terminationMessagePath directs Kubernetes to capture specific exit data from a designated file. This diagnostic message is then easily retrieved later using standard kubectl describe pod commands when troubleshooting crashes.

  507. Question 507 of 597A multi-tenant cluster contains a namespace 'db-layer' hosting sensitive PostgreSQL pods and a namespace 'web-layer' hosting public-facing Nginx pods. You must implement a security policy that allows the PostgreSQL pods to only accept incoming traffic on port 5432 from pods located in the 'web-layer' namespace that are labeled with 'role=frontend'. Which NetworkPolicy configuration is required?

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

    Show answer & explanation

    Correct answer: B. An ingress rule in the 'db-layer' namespace using both a namespaceSelector matching the 'web-layer' namespace and a podSelector matching 'role=frontend'.

    Combining namespaceSelector and podSelector inside a single ingress rule restricts traffic to the specified pods. Applying the rule to a service is invalid because network policies target pods directly.

  508. Question 508 of 597You are performing a canary release for a service named 'order-service'. You have the stable version (v1) running with 10 replicas and a label 'app=order-service,version=v1'. You deploy the canary version (v2) with 1 replica and a label 'app=order-service,version=v2'. The Service uses a selector 'app=order-service'. What is the effect on traffic distribution for this setup?

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

    Show answer & explanation

    Correct answer: B. Approximately 9% of the traffic will be routed to the v2 canary pod, while 91% will continue to be routed to the v1 stable pods.

    The Service load balances equally across all matching Pods, so the single v2 Pod receives roughly nine percent of the traffic. Remember that Services route based on selectors, not Deployment objects, avoiding the trap of assuming fifty-fifty traffic splits.

  509. Question 509 of 597A legacy billing microservice is being migrated to a Kubernetes cluster. This application was originally designed to write its internal transaction logs directly to a local disk file at /data/logs/transaction.log. The company requires these logs to be converted from a proprietary binary format into standard JSON format before they are processed by the cluster-wide logging agent. How should you design the Pod to meet this requirement without modifying the original application source code?

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

    Show answer & explanation

    Correct answer: B. Implement an adapter container that shares a volume with the main application, reads the binary logs, converts them to JSON, and exposes them via its own standard output.

    An adapter container modifies files or output from the main application to meet external requirements without changing the core code. Do not use a basic sidecar, because it typically forwards logs untouched rather than converting the proprietary binary format.

  510. Question 510 of 597You are designing a solution for a company that has multiple heterogeneous applications (one in Go, one in Java, and one in Ruby) all running in a single Pod for performance reasons. Each application produces logs in a different format (JSON, Plain Text, and Key-Value). A centralized logging system requires all logs to be in a unified XML format. You cannot modify the code of these applications. Which design pattern should be used to transform these logs before they are sent to the central server?

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

    Show answer & explanation

    Correct answer: D. Implement the Adapter pattern by adding a container that reads the logs from a shared volume and converts them to the required XML format.

    The Adapter container pattern translates heterogeneous outputs into a unified format before sending them to external systems. A standard sidecar container usually forwards raw logs untouched, whereas an adapter specifically performs the required XML transformation.

  511. Question 511 of 597A sophisticated data-processing Java application requires a long initialization period to load large machine learning models into memory before it can handle any requests. This process takes approximately 180 seconds. You have configured a liveness probe to ensure the container is healthy, but the probe starts failing and restarts the container before the initialization is complete. What is the most effective way to resolve this while maintaining health monitoring?

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

    Show answer & explanation

    Correct answer: D. Configure a startupProbe with a failureThreshold of 30 and a periodSeconds of 10 to protect the container during boot

    A startup probe disables liveness checks until it succeeds, perfectly protecting slow-starting applications during initialization. Relying heavily on high initialDelaySeconds values is less efficient because fast-booting pods will wait unnecessarily before receiving traffic.

  512. Question 512 of 597A security-auditing Pod named 'secret-checker' is deployed in the 'security-ops' namespace. This Pod needs to list and inspect the content of all Secrets within the 'customer-data' namespace to ensure compliance with encryption policies. Following the principle of least privilege, you must configure the necessary Kubernetes objects to grant this specific Pod the required permissions across namespace boundaries without granting cluster-wide administrative access.

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

    Show answer & explanation

    Correct answer: D. Create a Role in the 'customer-data' namespace and a RoleBinding in the same namespace that associates the Role with the ServiceAccount from 'security-ops'.

    Creating a Role and RoleBinding in the target namespace allows you to securely grant cross-namespace access to a specific ServiceAccount. ClusterRoles grant access across the entire cluster, which violates the principle of least privilege required for security compliance.

  513. Question 513 of 597An application named 'data-analyzer' requires a large configuration file (approx. 50MB) that is generated dynamically and stored in a central S3 bucket. The main application container cannot start until this file is successfully downloaded to a shared volume at /config/settings.json. This download process involves a heavy CLI tool and authentication steps that are not needed by the main application once it is running. How should this workflow be architected in the Pod?

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

    Show answer & explanation

    Correct answer: C. Use an initContainer to execute the download script and store the result in an emptyDir volume shared with the main container.

    InitContainers run sequentially to completion before any application containers start. Use an initContainer to fetch dependencies into a shared volume, ensuring the main container only starts once its required files are present.

  514. Question 514 of 597Your organization is deploying a high-traffic web application using a Deployment named web-v2 with 20 replicas. During the update process from version 2.1 to 2.2, you must ensure that the cluster always maintains at least 80 percent of the desired capacity to prevent performance degradation. Additionally, you want to limit the total number of Pods in the cluster during the update so that it does not exceed 125 percent of the desired replica count at any given time. Which specific configuration should be applied to the Deployment strategy?

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

    Show answer & explanation

    Correct answer: D. Set the RollingUpdate strategy with maxUnavailable: 4 and maxSurge: 5 to maintain capacity and limit total Pod count.

    Setting maxUnavailable to 4 and maxSurge to 5 maintains 16 available pods and limits total pods to 25. During the exam, calculate these values using the exact replica count rather than defaulting to standard percentages.

  515. Question 515 of 597An analytics application requires a large configuration file to be downloaded from an external secure server and decrypted before the main application starts. The decryption process requires a specific utility that is not included in the main application image for security reasons. How should you structure the Pod to handle this initialization sequence?

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

    Show answer & explanation

    Correct answer: C. Use an initContainer with the decryption utility image to download and process the file, saving the result into a shared emptyDir volume.

    InitContainers run to completion before the main application starts, making them perfect for preparing data. By saving the decrypted file into a shared volume, the main container securely accesses the prepared data without needing the utility.

  516. Question 516 of 597You are designing a Pod for a web application that has a hard dependency on an external legacy database and a configuration service. Both dependencies are exposed as Kubernetes Services ('db-service' and 'config-service'). If the main application starts before these services are resolvable in the cluster DNS, it fails to initialize and enters a 'CrashLoopBackOff' state. You want to implement a robust solution that delays the startup of the main application container until both service names can be successfully resolved.

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

    Show answer & explanation

    Correct answer: C. Add an 'initContainer' that runs a script using 'nslookup' in a loop to check the resolution of both service names.

    InitContainers block the main container from starting until they complete successfully. This pattern guarantees your application will not crash loop if it relies on external services that need time to register in DNS.

  517. Question 517 of 597A high-performance data processing application is experiencing high latency when fetching large static assets from a remote storage bucket. To optimize performance, the architecture team decides to implement a local caching sidecar using Nginx. This sidecar container will reside in the same Pod as the application, sharing the network stack. The application should be able to request cached assets via 'localhost' on port 8080. How must the Pod be configured to allow the application container and the Nginx sidecar to communicate this way?

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

    Show answer & explanation

    Correct answer: C. No special configuration is needed because containers within the same Pod automatically share the same network namespace.

    Containers within the same Pod share the exact same network namespace, meaning they communicate via localhost. You do not need a Service or host networking for inter-container traffic on the same loopback interface.

  518. Question 518 of 597An analytics namespace named 'data-prod' contains multiple Pods that are experiencing frequent restarts. You are required to generate a report using kubectl that lists the Pod name, the restart count of the container named 'engine-worker', and the image version currently assigned to that specific container. You must use a single command with the jsonpath output format to extract this data for all Pods in the namespace. Which jsonpath expression will correctly retrieve these three specific fields?

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

    Show answer & explanation

    Correct answer: A. jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.containerStatuses[?(@.name=="engine-worker")].restartCount}{" "}{.spec.containers[?(@.name=="engine-worker")].image}{"\n"}{end}'

    It uses the range operator to iterate over items, then applies filters inside brackets to target the specific container by name for both the restart count and the image. Remember that restart counts live under status containerStatuses, while the image is under spec containers.

  519. Question 519 of 597Your organization is adopting a Blue-Green deployment strategy. You have a Deployment named 'web-v1' (Blue) currently receiving all production traffic through a Service named 'web-prod-svc' which selects pods using 'app: web, version: v1'. You have successfully deployed 'web-v2' (Green) with 'app: web, version: v2'. What is the final step to perform the switch and direct all traffic to the new version?

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

    Show answer & explanation

    Correct answer: A. Modify the 'web-prod-svc' Service selector to point to 'version: v2' instead of 'version: v1' to reroute the traffic

    Changing the Service label selector instantly routes production traffic to the new version v2 pods. Do not delete the old deployment immediately, as you need it for a quick rollback if the green deployment fails.

  520. Question 520 of 597You are configuring an Ingress resource to manage traffic for a corporate website. The requirement is to route all traffic for 'example.com/shop' to a Service named 'shopping-svc' on port 8080, and all traffic for 'example.com/checkout' to a Service named 'payment-svc' on port 9000. All other traffic to 'example.com' should be directed to a 'static-frontend' Service on port 80. How should the paths be defined in the Ingress manifest?

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

    Show answer & explanation

    Correct answer: C. Use a single Ingress with path '/shop' (Prefix), path '/checkout' (Prefix), and path '/' (Prefix) for the frontend

    A single Ingress using Prefix path types handles all routing needs efficiently. The Ingress controller automatically evaluates the longest, most specific paths first, so the slash prefix safely acts as a catch-all backend.

  521. Question 521 of 597You are managing a specialized data-crunching application called 'analytics-worker' that performs heavy file I/O operations. The application is designed to process data from a shared directory that must be initialized with a specific dataset from a remote storage server before the main process begins. The main container is running a hardened image that does not have 'wget' or 'curl' installed for security reasons, and you cannot modify the image. How can you ensure the required data is available in the shared volume before the 'analytics-worker' starts its processing?

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

    Show answer & explanation

    Correct answer: B. Implement an InitContainer with a base utility image to download the dataset into a shared volume before the main container starts

    An init container runs to completion before the main application starts, using a separate utility image to fetch the data. Sidecars run concurrently, which risks race conditions if the main container needs the data immediately upon starting.

  522. Question 522 of 597You are securing a backend microservice in the 'internal-api' namespace. A strict security mandate requires that the microservice only accept incoming traffic from the corporate subnet '10.50.0.0/16'. Within that subnet, there is a specific range '10.50.20.0/24' used by legacy systems that are considered untrusted and must be explicitly blocked from reaching the microservice. All other traffic from any other CIDR range must be denied by default. You are implementing this using a Kubernetes NetworkPolicy resource.

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

    Show answer & explanation

    Correct answer: C. Configure an 'ingress' rule with 'ipBlock' specifying 'cidr: 10.50.0.0/16' and 'except: [10.50.20.0/24]'.

    The ipBlock selector natively supports a comma-separated except field to exclude untrusted subnets from an allowed range. NetworkPolicies are allow-lists by default, so defining allowed traffic inherently blocks everything else.

  523. Question 523 of 597Your engineering team is troubleshooting a custom proprietary message broker deployed as a Pod. The broker does not support HTTP or gRPC; it uses a custom binary protocol on TCP port 9000. You need to implement a liveness probe to ensure that the container is restarted if the service stops listening on that port. However, you want to avoid the overhead of running a full 'exec' command inside the container. What is the most efficient probe configuration for this scenario?

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using the tcpSocket field targeting port 9000 to perform a simple TCP connection check.

    The tcpSocket probe verifies basic network connectivity by attempting to open a TCP connection to the designated port. It avoids the processing overhead and security risks associated with running shell commands inside the container.

  524. Question 524 of 597An analytics application uses a 'PersistentVolumeClaim' (PVC) named 'data-log' which is bound to a 'PersistentVolume' (PV) from a dynamic provisioner. The current volume size is 10Gi, but the logs are growing rapidly and the volume is nearly full. The 'StorageClass' used by this PVC has 'allowVolumeExpansion' set to 'true'. You need to increase the volume size to 50Gi without losing any existing data or manually deleting and recreating the Kubernetes objects.

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

    Show answer & explanation

    Correct answer: B. Update the 'spec.resources.requests.storage' field of the existing PVC to 50Gi and apply the change.

    Patching the storage request on the PVC triggers the dynamic provisioner to expand the volume seamlessly. Directly modifying the PersistentVolume is discouraged because Kubernetes manages the lifecycle and reconciliation of the bound claim.

  525. Question 525 of 597To comply with new corporate security standards, all pods in the 'finance-prod' namespace must run with restricted privileges. Specifically, the 'transaction-logger' container must not run as the root user, must not be able to escalate privileges, and must have its root filesystem mounted as read-only. How should these constraints be implemented in the Pod manifest?

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

    Show answer & explanation

    Correct answer: D. Apply a securityContext at the container level setting runAsNonRoot to true, allowPrivilegeEscalation to false, and readOnlyRootFilesystem to true.

    A container-level security context directly applies required restrictions like read-only filesystems and non-root execution. Resource quotas only limit resource consumption across namespaces, while environment variables lack actual enforcement capabilities.

  526. Question 526 of 597A distributed order-processing application consists of a main container that requires a specific directory structure and several configuration files to be present on a shared volume before the application starts. These files are generated by a script that queries a remote metadata service. If the script fails, the main application container will crash and potentially corrupt the shared volume. You must ensure that the configuration is successfully prepared before the main container starts and that failures in preparation prevent the Pod from running.

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

    Show answer & explanation

    Correct answer: C. Use an initContainer to execute the setup script. Ensure the script returns a non-zero exit code on failure and mounts the same volume as the main container.

    Init containers block the main container from starting until they complete successfully, guaranteeing the environment is fully prepared. If the setup script fails, the init container aborts, safely preventing the main pod from crashing.

  527. Question 527 of 597Your legacy e-commerce application produces log files in a proprietary text format at /opt/app/logs/server.log. Your organization's central logging system requires logs to be transmitted via an HTTP POST request in JSON format. To avoid modifying the legacy application code, you decide to use a multi-container Pod approach where a secondary container reads the log file and performs the transformation and transmission. Which container design pattern is most appropriate for this scenario?

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

    Show answer & explanation

    Correct answer: C. Implement an adapter container that reads the local log file and exports it to the external monitoring system format

    The adapter container pattern transforms the main application's output into a format required by an external system. While a sidecar shares the same lifecycle, an adapter specifically standardizes logs or metrics without altering the core application code.

  528. Question 528 of 597Your development team has provided a ConfigMap named 'global-config' that contains 50 different application settings required for a Node.js microservice. Instead of manually mapping each key to a specific environment variable in the Pod manifest, you want to ensure that every single key-value pair currently in the ConfigMap (and any added in the future) is automatically made available as an environment variable to the container process. This must be done using the most efficient and maintainable syntax possible in the YAML manifest.

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

    Show answer & explanation

    Correct answer: B. Use the envFrom field with the configMapRef attribute pointing to the 'global-config' ConfigMap name.

    The envFrom field populates all ConfigMap keys as environment variables automatically. Manual mapping using env with configMapKeyRef is tedious and fails the requirement to dynamically include future additions without manifest edits.

  529. Question 529 of 597You are deploying a security-hardened 'vault-sync' Pod that must access a sensitive API token and a certificate file. These items are stored in a Kubernetes Secret named 'auth-materials'. The application code is hardcoded to look for the API token at '/mnt/secrets/token' and the certificate at '/mnt/secrets/cert.pem'. You must ensure these values are provided as files on the local filesystem and are not accessible via environment variables to prevent accidental exposure in process logs.

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

    Show answer & explanation

    Correct answer: C. Create a Volume of type 'secret' referencing 'auth-materials' and add a volumeMount in the container to mount it at '/mnt/secrets/'.

    Mounting a Secret as a volume projects its keys as individual files into the specified directory path. Environment variables expose values in process logs, violating the strict security requirement to keep them strictly on the filesystem.

  530. Question 530 of 597A web application named catalog-api is being deployed into a production cluster where the external traffic is managed by an Ingress controller. The application takes a long time to boot and depends on an external cache being fully populated. If traffic is sent to the Pod too early, the application crashes under the load. Beyond standard readiness probes, you need to ensure the Pod is only included in the Ingress load balancer when a specific external verification service also reports that the environment is ready. Which Kubernetes feature supports this?

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

    Show answer & explanation

    Correct answer: B. Define readinessGates in the Pod spec to specify additional conditions that must be met before the Pod is considered ready.

    Readiness gates allow external services to inject custom readiness conditions directly into a Pod's status. Startup probes only delay traffic until the application boots, whereas readiness gates hold traffic until external verification passes.

  531. Question 531 of 597A developer needs to configure a Node.js microservice that requires 50 different environment variables. These variables are already defined as key-value pairs in a ConfigMap named 'service-env-vars'. Instead of manually mapping each key to an environment variable in the Pod specification, the developer wants a more efficient way to inject all entries at once.

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

    Show answer & explanation

    Correct answer: C. Use the envFrom field in the container specification and provide a configMapRef that points to the 'service-env-vars' ConfigMap.

    The envFrom field automatically populates the container environment with all keys from a referenced ConfigMap. Manual mounting requires custom scripts, which fails the requirement for efficient, native Kubernetes manifest syntax.

  532. Question 532 of 597You are configuring an Ingress resource to manage external access for a corporate portal. The requirement is to route traffic based on the requested hostname to different internal backend services. Specifically, traffic for 'api.corp.com' must be routed to the 'api-service' on port 8080, while traffic for 'dashboard.corp.com' must be routed to the 'web-service' on port 9090. Both services are located in the same 'internal' namespace and the Ingress controller is already installed and functional.

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

    Show answer & explanation

    Correct answer: D. Create an Ingress resource with two separate entries in the 'rules' list, each specifying a 'host' and a corresponding 'http' path pointing to its respective service.

    Defining multiple rules with distinct host fields in a single Ingress resource directs traffic based on the requested hostname. Wildcard hosts or path-based routing are unnecessary here since the exact internal domain names are fully specified.

  533. Question 533 of 597A security-sensitive application named 'network-analyzer' must be deployed in a cluster with strict hardening policies. The container image is configured to run as a non-privileged user with UID 5000. However, the application requires the ability to use the 'ping' utility and capture raw network packets for diagnostic purposes, which are operations that normally require CAP_NET_RAW privileges. You need to configure the Pod's security settings to allow these specific network operations while strictly ensuring the container continues to run as UID 5000 and not as root.

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

    Show answer & explanation

    Correct answer: D. Define a securityContext at the container level with runAsUser: 5000 and add the NET_RAW capability under the capabilities field.

    Adding NET_RAW capabilities explicitly grants packet capture privileges while runAsUser enforces the UID. Privileged containers bypass least privilege rules and violate the strict security policy demanding a non-root identity.

  534. Question 534 of 597A Node.js microservice takes roughly 45 seconds to initialize its internal cache and connect to a remote database. During this period, it responds with a 503 error code to any incoming HTTP requests. Once initialized, the service is stable but might occasionally hang if the cache becomes corrupted. Which probe configuration is most appropriate to ensure traffic only hits the pod when it is ready and that it is restarted if it hangs?

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

    Show answer & explanation

    Correct answer: B. Configure a startupProbe to handle the 45-second initialization, combined with a readinessProbe for traffic and a livenessProbe for health.

    A startup probe safeguards slow-booting applications by disabling liveness checks during initialization. Without a startup probe, using initialDelaySeconds forces you to guess maximum boot times, delaying actual crash detection later.

  535. Question 535 of 597You are deploying a data-processing Pod that runs as a non-privileged user with UID 2000. The Pod mounts a 'PersistentVolumeClaim' (PVC) at '/data/output'. In many cluster environments, the mounted volume defaults to being owned by the 'root' user (UID 0), which prevents your application user (UID 2000) from writing any data to the disk. You need a way to ensure that the volume's ownership is correctly set so the application has write access without running the container as root.

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

    Show answer & explanation

    Correct answer: C. Define 'fsGroup: 2000' within the Pod-level 'securityContext' in the manifest.

    Setting fsGroup in the Pod security context dynamically changes the mounted volume's group ownership. Using privileged root containers violates security requirements, and manual chown commands fail if the user lacks root permissions.

  536. Question 536 of 597Your application requires a specific configuration file named 'settings.ini' to be mounted from a ConfigMap into the directory '/etc/config/'. The application binary includes a strict security check: it will refuse to start if the configuration file has 'write' or 'execute' permissions for the group or other users. It specifically mandates that the file must have 'read-only' permissions for the owner and no permissions for anyone else, which corresponds to the octal mode 0400. You need to configure the Pod's volume specification to ensure the file is mounted with these exact permissions.

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

    Show answer & explanation

    Correct answer: C. Set the 'defaultMode' field to 0400 within the ConfigMap volume definition in the Pod spec.

    The defaultMode field in a ConfigMap volume sets exact Unix permissions for mounted files. Setting readOnly on the volumeMount prevents writing but leaves default permissions untouched, failing the strict octal mode requirement.

  537. Question 537 of 597An application container requires access to several pieces of metadata at runtime: an API key stored in a 'Secret', a set of feature flags in a 'ConfigMap', and the Pod's own name and namespace provided by the Downward API. You want to present all these files to the application in a single, unified directory at '/etc/app-meta' instead of mounting three separate volumes to different paths.

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

    Show answer & explanation

    Correct answer: B. Use a 'projected' volume type that aggregates the Secret, ConfigMap, and downwardAPI into one volume.

    A projected volume combines several volume sources into a single directory. While an initContainer could technically stage files, it requires unnecessary scripting and violates the direct native integration expected for the exam.

  538. Question 538 of 597A mission-critical financial API is deployed in a cluster that spans three availability zones: us-east-1a, us-east-1b, and us-east-1c. To ensure maximum resilience during a zone-wide failure, you must guarantee that the 12 replicas of the application are distributed as evenly as possible across these zones. The cluster uses the standard topology.kubernetes.io/zone label to identify the location of each node.

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

    Show answer & explanation

    Correct answer: C. Configure topologySpreadConstraints with the topologyKey for zones and set whenUnsatisfiable to DoNotSchedule with a maxSkew value of 1.

    Topology spread constraints with a low maxSkew force the scheduler to distribute pods evenly across the specified topology domains. Pod anti-affinity lacks the granular control needed for exact proportional distribution across multiple zones.

  539. Question 539 of 597Your mission-critical 'order-processing' Deployment currently runs with 10 replicas. To ensure high availability during updates, you have been instructed to configure a rolling update strategy where at least 8 replicas must always be available to handle traffic, and no more than 13 replicas should exist in the cluster at any given time during the transition. Which configuration for the RollingUpdate strategy should you apply to the Deployment manifest?

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

    Show answer & explanation

    Correct answer: C. Set maxSurge to 3 and maxUnavailable to 2 in the deployment strategy section.

    Setting maxSurge to 3 permits the cluster to temporarily create up to 13 pods, and maxUnavailable to 2 guarantees 8 remain active. Using percentages fails the strict integer constraints outlined in the scenario.

  540. Question 540 of 597A mission-critical deployment named 'stock-feeder' is currently running with 8 replicas in a cluster that is operating at 90% resource capacity. Due to these tight resource constraints, the cluster can only accommodate 1 additional Pod during an update process. At the same time, the business requires that at least 7 replicas remain available at all times to handle the baseline traffic load. You are tasked with configuring the 'rollingUpdate' strategy in the Deployment manifest to allow for a version update from v1 to v2 without exceeding the node capacity or violating the availability requirement.

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

    Show answer & explanation

    Correct answer: C. Configure the strategy with 'maxUnavailable: 1' and 'maxSurge: 1' in the Deployment spec.

    Setting maxUnavailable to 1 permits exactly 7 replicas during updates, and maxSurge to 1 respects the single spare pod capacity. Option A fails because maxUnavailable zero demands higher surge capacity the cluster lacks.

  541. Question 541 of 597You are deploying a network security tool as a Pod in your cluster. This tool needs to monitor network traffic by capturing packets on the host's network interfaces and requires the ability to change the system clock to synchronize with a central time server. By default, Kubernetes containers are restricted from these actions for security. How should you configure the Pod to allow these specific operations while following the principle of least privilege?

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

    Show answer & explanation

    Correct answer: A. Add the 'NET_RAW' and 'SYS_TIME' capabilities to the securityContext section of the container specification

    Adding specific Linux capabilities like NET_RAW and SYS_TIME adheres to the principle of least privilege by granting only the exact permissions needed. Using privileged mode or root access violates this security principle unnecessarily for the monitoring tool.

  542. Question 542 of 597A financial transaction microservice named 'secure-pay' is being deployed into a production cluster where strict network isolation is mandatory. The 'secure-pay' Pod needs to communicate with a specific database Pod named 'postgres-db' in the 'data' namespace on port 5432. All other ingress and egress traffic for the 'secure-pay' Pod must be explicitly blocked to comply with security regulations and minimize the attack surface. You are tasked with creating a NetworkPolicy that ensures this specific connectivity while maintaining a default-deny posture for all other directions. How should you structure this policy?

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

    Show answer & explanation

    Correct answer: C. Define a NetworkPolicy for the 'secure-pay' Pod with an egress rule targeting the 'data' namespace and a podSelector for 'postgres-db' on port 5432

    An egress rule using both namespaceSelector and podSelector restricts outgoing traffic to the exact database pod. Remember that default deny requires separate policies, but this option correctly identifies the egress target components.

  543. Question 543 of 597You are managing a multi-tier application consisting of a 'frontend' deployment and a 'database' deployment in the 'production' namespace. A security audit requires that the 'database' pods should only accept incoming traffic on port 5432 from pods that have the label 'role: frontend'. Any other traffic from within the cluster, including from other pods in the same namespace, must be blocked. Which NetworkPolicy configuration achieves this?

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

    Show answer & explanation

    Correct answer: C. An ingress policy on the 'database' pods with a 'from' rule containing a 'podSelector' matching 'role: frontend'

    Applying an ingress policy to the database pods with a podSelector for the frontend implicitly denies all other traffic. Egress policies control outbound traffic, not incoming requests, making option B the wrong direction.

  544. Question 544 of 597A legacy Python-based background worker occasionally enters a 'zombie' state where the process remains running but it stops processing tasks. When this happens, the heartbeat file located at '/tmp/heartbeat.txt' inside the container stops being updated. You need to configure a Kubernetes probe that restarts the container if the heartbeat file hasn't been modified in the last 60 seconds. Which probe configuration is most appropriate?

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

    Show answer & explanation

    Correct answer: C. A livenessProbe using an exec command that runs a shell script to check the modification time of the file and returns a non-zero exit code if it exceeds the limit.

    A liveness probe with an exec command checks file staleness and restarts the container upon failure. A readiness probe would only remove the pod from the service without actually restarting the frozen process.

  545. Question 545 of 597An application container named data-processor runs as a non-root user with UID 5000 for security reasons. The application must write large amounts of temporary data to a PersistentVolumeClaim (PVC) mounted at /data/scratch. During testing, the application fails with a Permission Denied error because the mounted volume is owned by the root user by default. You cannot change the image or the volume provider's default settings. What is the correct way to grant the application write access to the volume?

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

    Show answer & explanation

    Correct answer: C. Define the securityContext at the Pod level and set the fsGroup field to 5000 to ensure the volume is re-permissioned for the user.

    Setting fsGroup in the pod security context automatically adjusts volume permissions for non-root users. Using a privileged container defeats the security purpose, and a chmod init container is less reliable.

  546. Question 546 of 597A production Deployment named user-api currently runs 10 replicas of a critical microservice. During an upcoming update to version 2.0.0, the engineering lead specifies that the system must never drop below the current processing capacity to maintain high availability. Additionally, to prevent overloading the Kubernetes nodes during the rollout, no more than 3 extra Pods should be created at any given time above the desired replica count. You need to configure the rolling update strategy to meet these specific infrastructure and availability constraints.

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

    Show answer & explanation

    Correct answer: C. Define a RollingUpdate strategy with maxSurge set to 3 and maxUnavailable set to 0 to maintain at least 10 active Pods while allowing up to 13 during the transition.

    Setting maxUnavailable to zero maintains processing capacity, while maxSurge limits overhead to three pods. A strategy with maxSurge zero and maxUnavailable three would immediately drop below capacity, violating the requirement.

  547. Question 547 of 597A batch processing system is required to handle 200 independent tasks stored in a message queue. Each task takes approximately 10 minutes to complete. To meet business deadlines, the system must process at least 5 tasks simultaneously. The entire Job must be considered successful only when all 200 tasks have been processed successfully. If a single task fails, it should be retried a maximum of 3 times before the entire Job is marked as failed. Which Job configuration parameters should be utilized to achieve this behavior?

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

    Show answer & explanation

    Correct answer: B. Set 'completions' to 200, 'parallelism' to 5, and 'backoffLimit' to 3 in the Job specification to control execution and retries

    Completions sets the required successful finishes, parallelism sets concurrent pods, and backoffLimit handles retries. The activeDeadlineSeconds parameter restricts total runtime but does not define the retry behavior.

  548. Question 548 of 597A production Deployment named 'payment-service' currently runs 4 replicas. During an upcoming cluster maintenance, several nodes will be drained for kernel updates. You need to ensure that at least 3 replicas of this service remain available at all times to meet the Service Level Agreement (SLA). The deployment must be protected from voluntary disruptions while still allowing the administrator to perform necessary node maintenance.

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

    Show answer & explanation

    Correct answer: D. Create a PodDisruptionBudget resource targeting the payment-service labels and set the minAvailable field to a value of 3.

    A PodDisruptionBudget with minAvailable set to three protects the application during voluntary disruptions like node drains. A PriorityClass only prevents preemption by other workloads, not evictions requested by administrators.

  549. Question 549 of 597An e-commerce platform's frontend deployment, 'web-shop', currently runs 10 replicas in a production environment. To improve update reliability, the engineering team wants to ensure that during a rolling update, the cluster always maintains at least 80 percent of the desired capacity at all times. Simultaneously, they want to limit the additional resource consumption during the update process so that no more than 13 total replicas exist at any point in time. Which specific configuration parameters should be defined in the Deployment's rollingUpdate strategy to meet these precise constraints?

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

    Show answer & explanation

    Correct answer: D. Set the maxSurge parameter to 3 and the maxUnavailable parameter to 2 to maintain capacity while limiting the maximum number of concurrent pods

    Setting maxSurge to 3 allows up to 13 total pods, while maxUnavailable 2 keeps at least 8 pods available during the rollout. Do not confuse absolute integer values with percentages, as percentages would yield different pod counts here.

  550. Question 550 of 597Your team is deploying a high-performance microservice that communicates exclusively via the gRPC protocol on port 50051. Standard HTTP-based liveness probes are not feasible because the application does not expose a REST interface. To ensure the container is automatically restarted if the internal gRPC server hangs or becomes unresponsive, you must implement a native health check mechanism that is supported by Kubernetes 1.24+ without relying on custom scripts or third-party binaries inside the image.

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

    Show answer & explanation

    Correct answer: A. Implement a livenessProbe using the grpc field, specifying the port as 50051 and leaving the service field empty or set to a specific gRPC service name.

    Native gRPC probes use the grpc protocol field to directly check the gRPC Health Checking Protocol. An exec probe requires bundling a separate binary, which the scenario explicitly prohibits.

  551. Question 551 of 597Your team is running 'app-v1' with 10 replicas managed by a Deployment. You want to perform a manual canary release of 'app-v2'. You need to route approximately 10% of the traffic to the new version using the existing Service named 'app-service' which currently points to 'app-v1'. How can you achieve this using standard Kubernetes objects without modifying the existing Service's type or using an Ingress controller?

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

    Show answer & explanation

    Correct answer: D. Create a second Deployment for 'app-v2' with 1 replica, and ensure both Deployments have the same labels that match the Service's selector.

    Services balance traffic across all Pods matching their selector regardless of the managing Deployment. Creating one new replica alongside nine existing replicas achieves the exact ten percent traffic split.

  552. Question 552 of 597A legacy financial application named legacy-proxy is designed to connect to a local database instance hardcoded at 127.0.0.1:5432. However, the organization has recently moved its database to a managed cloud service with a dynamic external endpoint. To avoid refactoring the legacy code, your team decides to use a multi-container Pod pattern that intercepts local traffic and redirects it to the cloud database. You need to configure this additional container effectively within the same Pod definition to ensure connectivity for the application.

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

    Show answer & explanation

    Correct answer: C. Implement an ambassador container running a lightweight TCP proxy like HAProxy or Envoy to forward traffic from localhost:5432 to the external cloud database address.

    The ambassador pattern uses a local proxy container to broker connections to external services. This allows the legacy application to connect to localhost while the proxy handles the complex external routing.

  553. Question 553 of 597A development team is migrating a microservice that depends on a legacy database hosted on a static IP address outside the Kubernetes cluster. To ensure the application remains portable and to avoid hardcoding external IP addresses in the code, you want to create a Kubernetes abstraction that allows the application to connect to 'legacy-db-svc' as if it were a standard internal service. The external database has a stable DNS record 'db.corporate-legacy.net'. What is the most efficient way to implement this?

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

    Show answer & explanation

    Correct answer: A. Define a Service of type ExternalName with the externalName field set to 'db.corporate-legacy.net'.

    An ExternalName Service returns a CNAME record pointing to the specified external DNS name. This cleanly abstracts external dependencies without creating unnecessary proxy pods or manual endpoint management.

  554. Question 554 of 597You are configuring a Pod named 'log-aggregator' that contains two containers: 'app-engine' and 'log-shipper'. The 'app-engine' container writes its operational logs to a local directory at '/var/log/app/'. The 'log-shipper' container must read these logs in real-time and send them to a remote storage backend. Neither container should have access to the underlying node's host filesystem for security reasons. Which Kubernetes volume type is most suitable for sharing this log data between the two containers in the same Pod?

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

    Show answer & explanation

    Correct answer: C. An EmptyDir volume mounted at '/var/log/app/' in both containers, providing a shared temporary storage space that exists only for the life of the Pod

    An emptyDir volume provides shared temporary storage tied directly to the Pod's lifecycle for multiple containers. HostPath volumes violate the security requirement by exposing the node filesystem.

  555. Question 555 of 597A high-performance microservice written in C++ occasionally experiences a thread deadlock where the main process remains running but stops processing the incoming message queue effectively. The application does not expose an HTTP health endpoint or a dedicated status port. To detect this specific locked state, the development team has provided a diagnostic script located at /usr/local/bin/check-health.sh inside the container image that returns an exit code of 0 if the internal queue is active and 1 if it is stuck. You must configure the Pod to restart the container automatically whenever this script detects a deadlock.

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

    Show answer & explanation

    Correct answer: A. Configure a LivenessProbe using the exec field to run the /usr/local/bin/check-health.sh script periodically.

    A LivenessProbe using the exec action runs the diagnostic script and restarts the container upon failure. A ReadinessProbe only removes the Pod from Service endpoints without triggering a restart.

  556. Question 556 of 597A financial data processing team uses a CronJob to run a heavy reconciliation script every 15 minutes. They have noticed that on several occasions, the Job failed, and the cluster is now cluttered with a large number of failed Pods from previous executions. They want to ensure that only the last 2 failed executions and the last 3 successful executions are kept in the history to simplify troubleshooting. Which fields should be configured in the CronJob manifest?

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

    Show answer & explanation

    Correct answer: A. Set 'successfulJobsHistoryLimit: 3' and 'failedJobsHistoryLimit: 2' in the CronJob spec section

    The successfulJobsHistoryLimit and failedJobsHistoryLimit fields directly control automatic cleanup of old Job objects. The concurrencyPolicy only manages overlapping schedules, not historical retention.

  557. Question 557 of 597An engineering team is managing a mission-critical deployment named 'inventory-api' that currently has 10 replicas. To maintain high availability during updates, the team requires that at least 10 replicas must always be available to handle traffic, and to avoid overloading the nodes, no more than 13 total pods should ever exist during the rolling update process. Which deployment strategy configuration should be applied to the 'inventory-api' manifest?

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

    Show answer & explanation

    Correct answer: A. Configure a RollingUpdate strategy with maxSurge set to 3 and maxUnavailable set to 0 to ensure capacity is never reduced below the desired count.

    A RollingUpdate strategy with maxSurge of three and maxUnavailable of zero keeps the active replica count at ten while temporarily allowing up to thirteen total pods. Avoid using the Recreate strategy, as it immediately terminates all pods.

  558. Question 558 of 597Your team is deploying a sensitive application that requires both a database password and a complex configuration file containing 50 environment-specific parameters. The password must be stored securely and not exposed in plain text in the Pod specification, while the configuration file should be easily updateable without rebuilding the container image. The application expects the configuration file at '/etc/app/config.yaml' and the password as an environment variable named 'DB_PASSWORD'. What is the most secure and maintainable way to provide these to the Pod?

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

    Show answer & explanation

    Correct answer: A. Store the password in a Secret and the configuration in a ConfigMap, then mount the ConfigMap as a volume and the Secret as an environment variable

    Using a Secret for the password and a ConfigMap for the configuration keeps sensitive data secure while allowing easy updates. Injecting large files via environment variables is not recommended because it increases the risk of exposing sensitive values in logs.

  559. Question 559 of 597You are managing a multi-tier financial application where the 'transaction-db' Pod handles sensitive ledger data in the 'finance' namespace. To meet regulatory compliance, you must implement a network isolation strategy where only Pods that are explicitly labeled with 'app: backend' within the same 'finance' namespace are permitted to initiate TCP connections to the database on port 5432. You must also ensure that all other incoming traffic from any Pod in any namespace (including the 'finance' namespace) is denied by default.

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

    Show answer & explanation

    Correct answer: A. Create a NetworkPolicy that selects the 'transaction-db' pod, defines a single ingress rule for port 5432 from pods matching 'app: backend', and includes an empty podSelector policy elsewhere to deny all other traffic.

    A NetworkPolicy applied to the database pod restricts incoming traffic exclusively to the specified backend pods while blocking all other connections. LoadBalancer source ranges restrict external access, whereas NetworkPolicies are required to isolate internal pod traffic.

  560. Question 560 of 597You are managing a microservice named payment-processor in the finance namespace. For compliance reasons, this microservice is only allowed to communicate with the internal database service in the same namespace and a specific external auditing service located at the IP address 192.168.10.50. All other egress traffic to the internet or other internal services must be strictly blocked. Which NetworkPolicy configuration correctly implements these egress rules?

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

    Show answer & explanation

    Correct answer: D. Define an egress policy with a rule allowing traffic to the database service name and a second rule with an ipBlock for 192.168.10.50/32.

    NetworkPolicies are additive and deny all non-matching egress traffic once applied. Defining specific rules using a podSelector for the database and an ipBlock for the external service restricts egress to only the approved destinations.

  561. Question 561 of 597You are managing a critical 'checkout-service' Deployment with 10 replicas in a cluster that is running near its resource limits. You need to perform a RollingUpdate to a new version. The infrastructure can only tolerate a maximum of 12 total Pods running during the update process to avoid triggering node pressure, and at least 8 replicas must remain available at all times to handle the baseline production traffic. How should you configure the rollingUpdate strategy in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: A. Set maxSurge to 2 and maxUnavailable to 2 to ensure the total Pod count never exceeds 12 and the available Pod count never drops below 8.

    Setting maxSurge to two and maxUnavailable to two strictly guarantees that total pods never exceed twelve and available pods never drop below eight. Options using percentages should be avoided here because they can result in unpredictable rounding that violates hard limits.

  562. Question 562 of 597An engineering team is deploying a data-intensive batch Job named 'record-validator' that processes 50 independent chunks of data. Each execution of the Job is resource-heavy and takes roughly 10 minutes to complete. The team has observed that occasional network blips cause the container to fail intermittently. They want to ensure that the Job controller attempts to retry failed executions, but to prevent a loop of expensive failures, the Job should be completely abandoned and marked as failed after a total of 3 unsuccessful pod attempts. Which configuration should be applied?

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

    Show answer & explanation

    Correct answer: A. Set the backoffLimit field to 3 in the Job specification to limit the number of retries before the Job is considered failed.

    The backoffLimit field specifies the maximum number of failed Pod retries before the Job is marked as failed. For the exam, remember that parallelism and completions control scaling, while activeDeadlineSeconds restricts total execution time.

  563. Question 563 of 597Your security policy requires that the 'frontend' microservice in the 'production' namespace must only be able to send outgoing (egress) traffic to a specific on-premises subnet with the CIDR range 192.168.10.0/24. All other outgoing traffic to the internet or other internal subnets must be blocked to prevent data exfiltration. Which NetworkPolicy configuration correctly implements this restriction for the 'frontend' pods?

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

    Show answer & explanation

    Correct answer: C. Create an egress policy with a single rule containing to: ipBlock: cidr: 192.168.10.0/24.

    Defining an egress policy with a specific ipBlock creates an implicit deny rule for all other traffic. Remember that podSelector chooses destinations, whereas ipBlock is required for external subnets.

  564. Question 564 of 597You are tasked with configuring an Ingress resource to host multiple microservices for a company portal. Traffic arriving at 'company.com/orders' must be routed to the 'orders-svc' Service on port 8080, while traffic for 'company.com/inventory' must be directed to the 'inventory-svc' Service on port 9000. Both services are in the 'production' namespace. Which Ingress rule configuration correctly implements this path-based routing?

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

    Show answer & explanation

    Correct answer: A. Create a single Ingress with a 'rules' section containing the 'host', and a 'http' section with two entries under 'paths', each specifying the path, pathType, and backend.

    Path-based routing is configured under a single host rule with multiple backend paths. For the exam, recall that each path requires a path type, such as Prefix or Exact, along with the backend service and port.

  565. Question 565 of 597A security audit of your Kubernetes cluster has revealed that several containers are running with excessive privileges. One specific requirement is to ensure that no process within a container can gain more privileges than its parent process. You are tasked with hardening the Pod specification for a web scraper application to comply with this security policy.

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

    Show answer & explanation

    Correct answer: B. Configure the securityContext of the container to set allowPrivilegeEscalation to false within the container specification.

    Setting allowPrivilegeEscalation to false prevents child processes from gaining more privileges than their parent. Remember that runAsNonRoot only prevents root execution, while privilege escalation controls setuid behavior.

  566. Question 566 of 597A mission-critical 'auth-engine' application uses a Secret named 'api-keys' mounted as a volume at '/etc/keys'. The application is designed to dynamically watch for file changes and reload its configuration without needing a restart. You need to update one of the keys in the Secret. Which behavior should you expect regarding the updates in the Pod and what is the best practice for this scenario?

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

    Show answer & explanation

    Correct answer: C. The mounted files in /etc/keys will be updated eventually by the kubelet, and the application's file watcher will trigger a reload of the new keys.

    When a Secret is mounted as a volume, the kubelet eventually updates the symlinks for the mounted files. Remember that Secrets injected as environment variables are not updated automatically and require a pod restart.

  567. Question 567 of 597A development team has reported that their Java-based microservice, 'order-api', is frequently restarting in the production environment. Upon investigation, you find that the Pod is being terminated with an 'OOMKilled' status. The Deployment currently has a memory limit of 512Mi, but the Java Virtual Machine (JVM) is configured with a maximum heap size (-Xmx) of 512Mi. The cluster has plenty of available memory on its nodes. What is the most appropriate technical resolution to stabilize this microservice while following Kubernetes best practices?

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

    Show answer & explanation

    Correct answer: A. Increase the memory limit in the Deployment to at least 768Mi to account for the JVM's non-heap memory and stack overhead

    Increasing the limit provides room for the JVM heap plus overhead like Metaspace and thread stacks, preventing the OS from killing the process. A Kubernetes OOMKilled error means the container exceeded its limit, not the physical node memory.

  568. Question 568 of 597A microservices application consists of a web frontend in the 'public' namespace and a sensitive database backend in the 'secure-data' namespace. A strict network security policy is required: the database Pods (labeled app=pi-db) must only accept incoming traffic on port 5432 from Pods in the 'public' namespace that are labeled app=frontend. Additionally, all other ingress and egress traffic for the database Pods must be explicitly blocked to prevent data exfiltration. You are tasked with creating a NetworkPolicy that achieves this isolation.

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

    Show answer & explanation

    Correct answer: C. Create a NetworkPolicy in the 'secure-data' namespace with a podSelector for app=pi-db, an ingress rule with a namespaceSelector for 'public' and a podSelector for app=frontend.

    This policy correctly targets the database pods in their own namespace. By defining an ingress rule with both namespaceSelector and podSelector, it restricts access precisely to the authorized frontend pods.

  569. Question 569 of 597In a high-security environment, you have a 'database' Pod running in the 'backend' namespace. You need to implement a NetworkPolicy that restricts traffic so that only Pods with the label 'role: web-server' located in the 'frontend' namespace can access the database on port 5432. Additionally, the database Pod must still be able to perform DNS lookups via the 'kube-dns' service in the 'kube-system' namespace. Which NetworkPolicy configuration achieves this requirement?

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

    Show answer & explanation

    Correct answer: C. An ingress rule with a namespaceSelector for 'frontend' combined with a podSelector for 'role: web-server', and an egress rule to the 'kube-system' namespace on UDP port 53.

    For cross-namespace ingress, you must use both namespaceSelector and podSelector within the same rule. For DNS, you need an egress rule specifically targeting UDP port 53 in the kube-system namespace.

  570. Question 570 of 597A data analysis team uses a Kubernetes CronJob to run a heavy reconciliation script every night at 2:00 AM. Occasionally, the script fails due to transient database connectivity issues. The team needs to keep a history of the last 5 successful runs and the last 2 failed runs for debugging purposes. Furthermore, they want to ensure that if a previous execution is still running when the next one is scheduled, the new execution is skipped to avoid resource contention.

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

    Show answer & explanation

    Correct answer: B. Set 'successfulJobsHistoryLimit: 5', 'failedJobsHistoryLimit: 2', and 'concurrencyPolicy: Forbid' in the CronJob's spec section.

    This configuration precisely meets all requirements: it manages the cleanup of old jobs and prevents concurrent runs. The concurrencyPolicy Forbid specifically skips new runs if an existing one is still active.

  571. Question 571 of 597Your application deployment consists of a main container that requires a specific external configuration database to be reachable before it can start successfully. If the database is not ready, the application crashes immediately. To make the Pod more resilient, you want to ensure the main container only starts once the database service is reachable via a network check. What is the most efficient design to implement this logic?

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

    Show answer & explanation

    Correct answer: A. Define an initContainer in the Pod that executes a 'while' loop checking for network connectivity to the database service

    InitContainers must complete successfully before the main application container starts. A script in an initContainer can effectively block the startup sequence until the external database is completely ready. Avoid using liveness probes for startup dependencies.

  572. Question 572 of 597A security audit has mandated that all containers in the 'processing' namespace must adhere to strict hardening guidelines. Specifically, containers must not be allowed to gain more privileges than their parent process, and they must run as a non-root user with a specific UID of 10001. You are required to configure the Pod manifest for an application named 'data-worker' to comply with these security requirements at both the Pod and container levels.

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

    Show answer & explanation

    Correct answer: C. Define 'allowPrivilegeEscalation: false' and 'runAsUser: 10001' within the securityContext section of the specific container's definition.

    The allowPrivilegeEscalation false setting specifically prevents a process from gaining more privileges than its parent. The runAsUser field enforces that the container process starts with the exact specified non-root UID.

  573. Question 573 of 597Your engineering team is deploying a data-processing workload that consists of 10 identical tasks. Each task needs to know its specific rank or index to determine which partition of a large dataset to process. The team wants to avoid hardcoding individual task IDs into separate Pod manifests and prefers a native Kubernetes solution that automatically assigns a unique, stable index from 0 to 9 to each task in the workload.

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

    Show answer & explanation

    Correct answer: B. Implement a Kubernetes Job with the completionMode set to Indexed and access the JOB_COMPLETION_INDEX environment variable within the container.

    Setting completionMode to Indexed ensures that each Pod is assigned an immutable completion index. This index is automatically injected into the JOB_COMPLETION_INDEX environment variable for reliable programmatic access.

  574. Question 574 of 597You are troubleshooting a complex microservice that occasionally hangs without crashing. To diagnose the issue, you need to run a sidecar container in the same Pod that can inspect the process tree of the main application container and run 'gdb' or 'strace' against the specific process IDs of the application.

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

    Show answer & explanation

    Correct answer: D. Grant the sidecar container the SYS_PTRACE capability and set the shareProcessNamespace field to true in the Pod specification.

    Setting shareProcessNamespace to true allows containers in a Pod to see and interact with each other's processes. Combined with the SYS_PTRACE capability, it enables deep debugging tools like strace against peer containers.

  575. Question 575 of 597You are managing a long-running Kubernetes Job named 'monthly-data-sync' that processes several thousand records. Occasionally, due to external API throttling or network instability, the Job's process hangs indefinitely without failing. This consumes cluster resources and prevents subsequent scheduled tasks from running. You need to ensure that the Job is automatically terminated if it does not finish within 2 hours (7200 seconds). Which Job specification field should you configure?

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

    Show answer & explanation

    Correct answer: D. Configure activeDeadlineSeconds: 7200 in the Job's spec to limit the total duration of the Job execution.

    The activeDeadlineSeconds field limits the total duration of a Job from the moment it starts. Once the deadline is reached, Kubernetes terminates all associated Pods and marks the Job as failed with reason DeadlineExceeded.

  576. Question 576 of 597Your organization is implementing a private container registry that requires authentication for all image pulls. You need to deploy a microservice named 'secure-api' that uses an image from this private registry. You have already created a Secret named 'regcred' of type 'kubernetes.io/dockerconfigjson' in the same namespace. How should you configure the Pod to ensure it can successfully pull the image?

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

    Show answer & explanation

    Correct answer: A. Define the 'imagePullSecrets' field at the Pod specification level and reference the 'regcred' Secret to provide authentication to the Kubelet.

    The imagePullSecrets field in the Pod spec is the standard mechanism to pass registry credentials to the Kubelet. The Kubelet securely handles the image pull operation before the container runtime initializes.

  577. Question 577 of 597A data analytics application writes heavy temporary logs and cache files to the /tmp directory within the container. On several occasions, these files have grown so large that they filled the node's local disk, causing the node to become unstable and evicting other critical pods. You need to limit the amount of local storage a pod can consume.

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

    Show answer & explanation

    Correct answer: C. Update the container's resource limits to include a request and limit for the 'ephemeral-storage' resource type.

    Setting ephemeral-storage limits in the resources section is the standard way to manage local disk usage, ensuring the pod is evicted if it exceeds its quota. While emptyDir sizeLimits exist, they only constrain individual mounted volumes, whereas resource limits apply to the entire pod.

  578. Question 578 of 597Your production environment currently runs a critical 'user-session-manager' Deployment with exactly 20 replicas. To ensure high availability during an upcoming update to version 2.0, the business requirement states that at least 15 replicas must remain available and ready at all times to handle the incoming traffic load. Additionally, the cluster capacity is limited, so no more than 25 total pods (including old and new versions) should exist at any single point during the rollout. You need to configure the rolling update strategy in the Deployment manifest to strictly adhere to these specific constraints.

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

    Show answer & explanation

    Correct answer: A. Set maxSurge to 5 and maxUnavailable to 5 in the rollingUpdate strategy block.

    This is correct because maxSurge 5 allows for 25 total pods, and maxUnavailable 5 ensures that 15 pods are always running, perfectly matching the capacity and availability constraints. Be careful with absolute values versus percentages, as percentages calculate dynamically based on replica counts.

  579. Question 579 of 597You are deploying a web application that depends on a configuration file generated by a complex script. This script requires several specialized tools that are not included in the main application image to keep it slim and secure. You need to ensure the configuration file is created and placed in '/etc/config/app.json' before the main application starts. The main container must have read-only access to this file. Which design approach should you implement?

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

    Show answer & explanation

    Correct answer: A. Use an InitContainer to run the generation script and save the output to an emptyDir volume that is mounted by both the InitContainer and the main container.

    InitContainers run to completion before the main container starts. By sharing an emptyDir volume, the InitContainer can write the file and the main container can consume it securely. Sidecars run concurrently, so they cannot guarantee file creation before the main app starts.

  580. Question 580 of 597A security-sensitive financial application uses a ConfigMap named api-config to store endpoint URLs and non-secret metadata. To prevent unauthorized or accidental changes to the production configuration that could lead to routing errors, the DevOps team requires that once the ConfigMap is created, it cannot be modified by any user or process without deleting and recreating the resource entirely. This is intended to ensure that any change to the configuration results in a predictable rollout. How can this be achieved in Kubernetes?

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

    Show answer & explanation

    Correct answer: C. Set the immutable: true field in the ConfigMap manifest to prevent any further updates to the data field of the resource.

    The immutable field is a built-in feature for ConfigMaps and Secrets. Once set to true, it prevents any modifications to the data, ensuring configuration stability and reducing kubelet load. Mounting a volume as read-only only restricts the container, not the API server.

  581. Question 581 of 597Your company hosts a web platform on Kubernetes. You need to expose two different backend services, 'marketing-site' and 'customer-portal', using a single external IP address. Traffic for 'example.com/marketing' must go to the 'marketing-site' service on port 80, and traffic for 'example.com/portal' must go to the 'customer-portal' service on port 8080. Which Kubernetes resource should be configured?

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

    Show answer & explanation

    Correct answer: A. An Ingress resource with a single host 'example.com' and a list of paths mapping '/marketing' and '/portal' to their respective services and ports.

    Ingress resources operate at Layer 7 and are specifically designed for path-based or host-based routing of HTTP traffic to internal services. Services operate at Layer 4 and cannot inspect URL paths to differentiate traffic between backend deployments.

  582. Question 582 of 597A legacy data-client application is hardcoded to communicate with a database instance at localhost:5432. The development team is migrating this application to a Kubernetes cluster where the PostgreSQL database is hosted as a separate Service named 'postgres-db'. To avoid modifying the legacy application source code to point to the new Service DNS, you decide to implement a multi-container Pod design. Which configuration pattern should you use to satisfy this requirement?

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

    Show answer & explanation

    Correct answer: D. Include an Ambassador container in the Pod that runs a TCP proxy configured to listen on localhost:5432 and forward traffic to the 'postgres-db' Service address.

    The Ambassador pattern acts as a proxy for the main container. By running a proxy on localhost inside the same Pod, the legacy application connects locally while traffic is seamlessly forwarded to the actual Service. Adapters are for standardizing output, not proxying traffic.

  583. Question 583 of 597A specialized custom message broker is being deployed that does not provide an HTTP-based health check endpoint. To be considered healthy, the container must satisfy two conditions: it must be listening for connections on TCP port 9090, and a local heartbeat file created by the application at '/var/run/broker.heartbeat' must exist and be recently updated. If either the port is unreachable or the file is missing, Kubernetes should terminate the Pod and restart it to restore service. You need to implement a livenessProbe that checks both conditions effectively.

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using 'exec' that runs a shell command to verify both the file existence and the port status.

    Since a container can only have one livenessProbe, using exec to run a combined shell script is the only way to validate multiple distinct conditions for health. A readiness probe would only pause traffic, whereas the mandate requires failing and restarting the pod.

  584. Question 584 of 597Your application consumes a Secret named 'api-credentials' which is mounted as a volume at /etc/api-keys. The security team performs a manual rotation of the API keys in the Kubernetes Secret. You need to understand how this update will propagate to the running containers and what steps are necessary for the application to utilize the new credentials without a full pod restart.

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

    Show answer & explanation

    Correct answer: B. The Kubelet will eventually update the files in the volume, and the application must be designed to periodically re-read the files from the disk.

    When Secrets are mounted as volumes, the kubelet eventually refreshes the data on disk. Applications must be designed to periodically re-read these files to pick up changes without requiring a process restart. Environment variables are immutable and never update dynamically.

  585. Question 585 of 597The security team has audited the 'payment-processing' namespace and issued a new mandate. All application containers must run with a read-only root filesystem to minimize the attack surface. However, the 'transaction-logger' application requires a writable directory at '/var/log/app' to store temporary execution logs that do not need to persist after the Pod is deleted. How should you configure the Pod manifest to comply with the security mandate while allowing the application to function?

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

    Show answer & explanation

    Correct answer: A. Set readOnlyRootFilesystem: true in the securityContext and mount an emptyDir volume at the /var/log/app mount path.

    Enabling readOnlyRootFilesystem protects the container, and mounting an emptyDir at the specific logging path provides a writable scratch space that is isolated from the root filesystem. Using privileged mode or HostPath directly violates the required security mandates.

  586. Question 586 of 597A legacy enterprise microservice named 'registry-client' is being deployed into a production namespace. The application was designed to manually register its IP address into a legacy external service discovery system whenever it starts up. To automate this process without modifying the existing application code, you decide to use a Kubernetes mechanism that executes a script immediately after the container is created. The script requires the Pod's IP address, which is available via the downward API. How should this be implemented in the Pod specification?

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

    Show answer & explanation

    Correct answer: B. Define a postStart lifecycle hook within the container specification to execute the registration script.

    A postStart hook executes a registration script immediately after container creation without altering the core application code. Init containers run before the primary container starts, so they cannot expose the pod IP.

  587. Question 587 of 597Your company uses a single Ingress controller to manage traffic for multiple internal services. You need to configure an Ingress resource for the 'corporate-portal' application. The requirements are: traffic to 'portal.example.com/finance' should be routed to the 'finance-srv' Service on port 8080, and traffic to 'portal.example.com/hr' should be routed to the 'hr-srv' Service on port 9000. Additionally, you must ensure that only exact path matches or sub-paths are allowed, and SSL termination should use a secret named 'portal-tls'.

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

    Show answer & explanation

    Correct answer: A. Define an Ingress with two rules for the same host, using pathType: Prefix for both /finance and /hr, and specify the 'portal-tls' secret in the tls section.

    The Prefix path type satisfies the requirement to match exact paths or sub-paths by validating the URI prefix. The word exact in the prompt creates slight ambiguity, but Prefix is ultimately the correct technical match.

  588. Question 588 of 597A development team is working in a shared namespace called dev-team-alpha. They are attempting to deploy a new microservice, but the Pod remains in the Pending state. Upon investigation, the kubectl describe pod command reveals a message stating that the request exceeds the current ResourceQuota limits defined for the namespace. The namespace has a quota of 4 CPU cores, and currently, there are 3 Pods running, each requesting 1 CPU core. How should you fix this for the new Pod that requires 1.5 CPU cores? Correct answer

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

    Show answer & explanation

    Correct answer: A. Update the new Pod's manifest to decrease its CPU request to 1 CPU core or less to fit within the remaining quota

    Lowering the CPU request to 1 core or less fits the remaining namespace quota. While deleting the ResourceQuota would also allow scheduling, it violates the implicit organizational constraints and removes cluster guardrails.

  589. Question 589 of 597Your enterprise application, 'legacy-metrics-engine', generates performance data in a proprietary binary format that cannot be directly scraped by the cluster's Prometheus monitoring system. To ensure visibility without modifying the application's source code, you must deploy a solution that transforms these binary metrics into a Prometheus-compatible text format and exposes them on a dedicated port. The transformation process is computationally intensive but only required for external monitoring purposes. Which architectural pattern should you implement to meet these requirements efficiently while keeping the main container unchanged?

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

    Show answer & explanation

    Correct answer: C. Deploy an Adapter container within the same Pod to read the binary metrics and expose them in the required Prometheus format

    The Adapter pattern standardizes or simplifies the application output for external systems, fitting perfectly for translating metrics. The Sidecar and Ambassador patterns manage inbound traffic or logs, failing to address the required transformation.

  590. Question 590 of 597A legacy web application, 'customer-portal', is being migrated to Kubernetes. The application takes 3 minutes to perform a self-check and load its internal cache from an external database. During this time, the application is running but cannot handle any HTTP requests. If the application receives traffic before the cache is loaded, it crashes and must be restarted. Which health check configuration is essential to ensure that the Ingress controller does not send traffic to the Pod until it is fully ready to process requests?

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

    Show answer & explanation

    Correct answer: A. Configure a ReadinessProbe with a 'periodSeconds' of 10 and a check that only succeeds after the cache loading process is complete

    A readiness probe removes the pod from service endpoints until the cache finishes loading, preventing premature traffic. A liveness probe would only prevent restarts, leaving the unresponsive pod exposed to user requests.

  591. Question 591 of 597Your organization is deploying a microservice that requires a specific API key to communicate with a third-party billing provider. This key is stored in a Kubernetes Secret named 'provider-credentials' along with fifty other sensitive keys used by different teams. To follow the principle of least privilege and minimize resource consumption in the environment variables of the container, you must inject only the key named 'BILLING_AUTH_TOKEN' from the Secret into an environment variable called 'SERVICE_TOKEN'. Which configuration fragment achieves this?

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

    Show answer & explanation

    Correct answer: A. Define an environment variable in the Pod spec using valueFrom with the secretKeyRef property specifying the key.

    Using secretKeyRef inside valueFrom exposes only the specific key needed to the container environment. Using envFrom would mount all fifty keys, violating the required principle of least privilege.

  592. Question 592 of 597A data processing Pod named 'heavy-worker' is stuck in a 'Pending' state. Upon investigation, you find that the target nodes for this workload have been tainted with 'dedicated=high-mem:NoSchedule' to reserve them for specific memory-intensive tasks. The 'heavy-worker' Pod is indeed memory-intensive and should be allowed to run on these nodes. What is the most appropriate action to resolve this scheduling issue?

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

    Show answer & explanation

    Correct answer: C. Update the Pod specification to include a toleration that matches the key, value, and effect of the taint on the high-memory nodes.

    Adding a toleration matching the node taint allows the scheduler to place the memory-intensive pod on the reserved hardware. Using a nodeSelector or node affinity does not override a NoSchedule taint.

  593. Question 593 of 597Your cluster administrator has enabled the Pod Security Admission controller to enforce strict security standards. You are attempting to deploy a network monitoring tool into the 'restricted-workloads' namespace, which is labeled with 'pod-security.kubernetes.io/enforce: restricted'. Your current Deployment manifest includes a container that requests the 'NET_ADMIN' capability to capture packets. Upon applying the manifest, the API server rejects the request with a validation error citing violations of the restricted profile. You must modify the manifest to align with the required security level while maintaining as much functionality as possible.

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

    Show answer & explanation

    Correct answer: C. Remove the NET_ADMIN capability and ensure 'allowPrivilegeEscalation' is set to false in the securityContext.

    The restricted profile strictly blocks adding Linux capabilities like NET_ADMIN and requires privilege escalation to be disabled. Changing namespace labels to privileged undermines cluster security and violates baseline governance rules.

  594. Question 594 of 597A stateful database cluster is managed using a StatefulSet named 'db-store' with 3 replicas. Each Pod in the StatefulSet is associated with a PersistentVolumeClaim (PVC) through a volumeClaimTemplate. Due to a change in demand, you are instructed to scale the StatefulSet down to 1 replica. You need to understand the behavior of the associated PersistentVolumeClaims and the data they contain during and after this scaling operation to ensure no data is unexpectedly lost.

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

    Show answer & explanation

    Correct answer: A. The PVCs for replicas 1 and 2 are retained in the cluster, preserving the data; they must be manually deleted if the storage is no longer required.

    PersistentVolumeClaims created by a StatefulSet are not automatically deleted when scaled down. This retains data for potential scale-up operations, meaning admins must manually clean up unused volumes.

  595. Question 595 of 597A data-processing application named log-analyzer requires a specific directory structure and a configuration file to be dynamically generated on the local node's file system before the main container starts. The generation script is a complex shell command that needs to run in the exact same environment as the application but should not be part of the main container's long-running process. The application will fail immediately if the file is missing at startup. What is the most efficient way to ensure this setup is completed successfully?

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

    Show answer & explanation

    Correct answer: A. Configure an InitContainer in the Pod manifest to run the generation script and share the directory via an emptyDir volume.

    Init containers run to completion before the main application starts, using shared volumes to pass generated files. A postStart hook executes concurrently with the main container, risking a race condition where the app starts before setup finishes.

  596. Question 596 of 597Your organization is hosting a multi-tenant platform where a single Ingress controller handles traffic for various departments. You need to configure the Ingress resource so that requests to 'api.company.com/v1/orders' are routed to the 'orders-service' on port 8080, while requests to 'api.company.com/v1/billing' are directed to the 'billing-service' on port 9000. Both services reside in the same namespace. Which Ingress configuration structure is required to implement this path-based routing correctly?

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

    Show answer & explanation

    Correct answer: A. Define a single Ingress resource with a 'rules' section for the host 'api.company.com' containing multiple paths under the 'http' attribute

    A single Ingress resource uses a rules section with multiple http paths to route traffic based on the URL. Creating multiple Ingress resources for the same host is unnecessary and complicates path management.

  597. Question 597 of 597You are managing an Ingress resource that routes traffic to several microservices. You have a legacy service named 'v1-service' mapped to the path '/api' and a new service named 'v2-service' mapped to '/api/v2'. During testing, you notice that requests intended for '/api/v2' are being handled by 'v1-service' because of how the Ingress controller evaluates path matching rules. How should you resolve this?

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

    Show answer & explanation

    Correct answer: C. Modify the Ingress resource to use pathType: Exact for both paths and ensure the more specific path is listed first in the rules.

    Using pathType Exact forces exact string matching, preventing broader prefix paths from catching specific routes. The Prefix path type can also work if configured correctly, making the provided options slightly ambiguous.

More free practice tests at certpunch.com and new video rounds on @CertPunch.

Scroll to Top