Skip to content

Linux Foundation

Certified Kubernetes Application Developer (CKAD)

Exam 4 · 100 questions · Choose another exam

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. 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.

  23. 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.

  24. 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.

  25. 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.

  26. 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.

  27. 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.

  28. 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.

  29. 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.

  30. 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.

  31. 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.

  32. 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.

  33. 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.

  34. 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.

  35. 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.

  36. 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.

  37. 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.

  38. 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.

  39. 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.

  40. 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.

  41. 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.

  42. 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.

  43. 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.

  44. 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.

  45. 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.

  46. 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.

  47. 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.

  48. 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.

  49. 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.

  50. 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.

  51. 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.

  52. 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.

  53. 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.

  54. 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.

  55. 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.

  56. 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.

  57. 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.

  58. 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.

  59. 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.

  60. 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.

  61. 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.

  62. 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.

  63. 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.

  64. 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.

  65. 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.

  66. 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.

  67. 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.

  68. 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.

  69. 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.

  70. 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.

  71. 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.

  72. 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.

  73. 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.

  74. 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.

  75. 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.

  76. 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.

  77. 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.

  78. 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.

  79. 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.

  80. 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.

  81. 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.

  82. 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.

  83. 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.

  84. 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.

  85. 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.

  86. 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.

  87. 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.

  88. 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.

  89. 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.

  90. 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.

  91. 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.

  92. 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.

  93. 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.

  94. 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.

  95. 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.

  96. 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.

  97. 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.

  98. 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.

  99. 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.

  100. 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.

Study on mobile

Get CertPunch for iOS or Android.

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

Scroll to Top