Skip to content

Linux Foundation

Certified Kubernetes Application Developer (CKAD)

Exam 6 · 100 questions · Untimed · Choose another exam

  1. Question 498 of 597You are deploying a stateful application that runs as a non-root user with UID 1000. The application needs to write logs and data to a PersistentVolume mounted at /data. During initial testing, the application fails to start with a 'Permission Denied' error because the mounted volume is owned by the root user by default. You must ensure the application has the necessary permissions to write to the volume without changing the container's user or using an InitContainer to chmod the directory. Which SecurityContext setting should be used?

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

    Show answer & explanation

    Correct answer: B. Specify the fsGroup: 2000 in the Pod-level SecurityContext to allow Kubernetes to change the ownership of the volume.

    The fsGroup setting in the pod security context instructs Kubernetes to change the ownership of mounted volumes to the specified group ID. This directly grants the non-root application process the required write permissions without using privileged mode or init containers.

  2. Question 499 of 597You are migrating a legacy web portal to Kubernetes that was not designed for stateless operation. The portal stores active user sessions in its local memory. If a user is routed to Pod-A for their first request and Pod-B for their second, they are automatically logged out. You are exposing these Pods via a 'Service' of type 'LoadBalancer'. You need to ensure that a specific user's traffic is always sent to the same Pod replica to maintain session continuity.

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

    Show answer & explanation

    Correct answer: D. Set 'spec.sessionAffinity: ClientIP' in the Service manifest to enable session persistence based on the source IP.

    Setting sessionAffinity to ClientIP on the Service ensures requests from the same source IP are routed to the same backend Pod. This provides the required session stickiness for legacy applications, unlike standard round-robin load balancing.

  3. Question 500 of 597A sophisticated Java-based microservice takes approximately 45 seconds to initialize its internal cache and verify connections to a database. If the main 'app-server' container starts and begins accepting traffic before the database is ready, it enters a non-recoverable error state. You need to implement a mechanism within the Pod manifest to ensure that a check script, which pings the database, completes successfully before the main 'app-server' container is even allowed to start.

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

    Show answer & explanation

    Correct answer: A. Add an InitContainer to the Pod specification that runs a shell loop script to check database connectivity before exiting successfully.

    Init containers run to completion before any regular containers in a Pod are started, making them the perfect place for dependency checks. Readiness probes only prevent traffic routing and do not delay the main container's startup process.

  4. Question 501 of 597You are managing a mission-critical web application that currently runs with 10 replicas. During the deployment of a new version, your team has a strict requirement that at least 8 Pods must remain available at all times to handle the incoming traffic load. Additionally, to avoid overloading the node resources, the cluster should never run more than 12 Pods total during the rollout process. How should you configure the rollingUpdate strategy in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: B. Set maxSurge to 2 and set maxUnavailable to 2 in the deployment strategy section

    Setting maxUnavailable to 2 ensures at least 8 pods remain available during the rollout, meeting the traffic requirement. Setting maxSurge to 2 restricts the total number of pods to 12, successfully preventing node resource overload.

  5. Question 502 of 597A legacy microservice named legacy-client is being migrated to a Kubernetes cluster. The application needs to communicate with an external third-party API that strictly requires mutual TLS (mTLS) for every connection. However, the legacy application code is frozen and does not have the built-in capability to handle client-side certificates or perform the mTLS handshake. The security team mandates that the connection must be encrypted and authenticated before leaving the cluster. Which design pattern should be implemented to meet these requirements without modifying the source code?

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

    Show answer & explanation

    Correct answer: A. Deploy an Ambassador container within the same Pod to act as a local proxy that manages the mTLS handshake with the external API.

    The Ambassador pattern abstracts external service complexity by running a proxy container in the same network namespace. The legacy application connects locally while the proxy transparently handles the complex mTLS handshake.

  6. Question 503 of 597A Python-based backend application is frequently losing in-flight data when the Deployment is scaled down or during a rolling update. The application needs approximately 15 seconds to finish processing current requests and close database connections cleanly after receiving a termination signal. You need to implement a mechanism to ensure the application has enough time to shut down gracefully.

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

    Show answer & explanation

    Correct answer: A. Set the terminationGracePeriodSeconds in the Pod specification to 30 and implement a preStop hook that executes a sleep command for 15 seconds.

    A preStop hook delays container shutdown while an extended terminationGracePeriodSeconds provides ample time for cleanup. Relying solely on readiness probes does not guarantee the application enough time to process in-flight requests before termination.

  7. Question 504 of 597You are deploying a distributed database system where each individual Pod must have a stable, unique network identity (hostname) that can be reached by other Pods in the cluster. The application logic requires Pods to discover each other directly via DNS queries rather than through a single virtual IP that load balances traffic. The database instances are managed by a StatefulSet named db-node. How should the networking service be configured to support this requirement?

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

    Show answer & explanation

    Correct answer: C. Create a Headless Service by setting the clusterIP field to None and ensuring the service name matches the serviceName of the StatefulSet.

    A Headless Service sets clusterIP to None, which creates individual DNS A records for each Pod managed by the StatefulSet. This allows applications to discover specific peers directly via DNS instead of routing through a load balancer.

  8. Question 505 of 597A legacy auditing microservice in your production environment generates system logs in a proprietary XML format and saves them to a local shared volume at the path /var/log/audit.xml. Your organization's central logging server has recently been upgraded and now only accepts logs in JSON format via a standard POST request. You need to implement a solution within the same Pod to read the XML file, convert the entries to JSON, and forward them to the external server without modifying the legacy tool's source code or its container image.

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

    Show answer & explanation

    Correct answer: D. Deploy an Adapter container within the Pod that monitors the /var/log/audit.xml file, transforms the data to JSON, and forwards it to the central logging server.

    The Adapter pattern transforms primary container output to match external system standards without modifying the original image. Using a shared volume, the adapter container reads the XML logs, translates them to JSON, and forwards them successfully.

  9. Question 506 of 597A Python-based application named batch-job frequently crashes due to memory exhaustion, but the standard container logs do not capture the final error code or the reason for the crash because the process terminates too quickly for the logging agent to sync. The application is programmed to write a specific JSON error summary to /dev/termination-log just before it exits. You need to retrieve this specific error summary for troubleshooting using kubectl. How should you configure the Pod?

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

    Show answer & explanation

    Correct answer: C. Set the terminationMessagePath field in the container specification to /dev/termination-log to capture the specific exit data.

    Setting the terminationMessagePath directs Kubernetes to capture specific exit data from a designated file. This diagnostic message is then easily retrieved later using standard kubectl describe pod commands when troubleshooting crashes.

  10. Question 507 of 597A multi-tenant cluster contains a namespace 'db-layer' hosting sensitive PostgreSQL pods and a namespace 'web-layer' hosting public-facing Nginx pods. You must implement a security policy that allows the PostgreSQL pods to only accept incoming traffic on port 5432 from pods located in the 'web-layer' namespace that are labeled with 'role=frontend'. Which NetworkPolicy configuration is required?

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

    Show answer & explanation

    Correct answer: B. An ingress rule in the 'db-layer' namespace using both a namespaceSelector matching the 'web-layer' namespace and a podSelector matching 'role=frontend'.

    Combining namespaceSelector and podSelector inside a single ingress rule restricts traffic to the specified pods. Applying the rule to a service is invalid because network policies target pods directly.

  11. Question 508 of 597You are performing a canary release for a service named 'order-service'. You have the stable version (v1) running with 10 replicas and a label 'app=order-service,version=v1'. You deploy the canary version (v2) with 1 replica and a label 'app=order-service,version=v2'. The Service uses a selector 'app=order-service'. What is the effect on traffic distribution for this setup?

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

    Show answer & explanation

    Correct answer: B. Approximately 9% of the traffic will be routed to the v2 canary pod, while 91% will continue to be routed to the v1 stable pods.

    The Service load balances equally across all matching Pods, so the single v2 Pod receives roughly nine percent of the traffic. Remember that Services route based on selectors, not Deployment objects, avoiding the trap of assuming fifty-fifty traffic splits.

  12. Question 509 of 597A legacy billing microservice is being migrated to a Kubernetes cluster. This application was originally designed to write its internal transaction logs directly to a local disk file at /data/logs/transaction.log. The company requires these logs to be converted from a proprietary binary format into standard JSON format before they are processed by the cluster-wide logging agent. How should you design the Pod to meet this requirement without modifying the original application source code?

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

    Show answer & explanation

    Correct answer: B. Implement an adapter container that shares a volume with the main application, reads the binary logs, converts them to JSON, and exposes them via its own standard output.

    An adapter container modifies files or output from the main application to meet external requirements without changing the core code. Do not use a basic sidecar, because it typically forwards logs untouched rather than converting the proprietary binary format.

  13. Question 510 of 597You are designing a solution for a company that has multiple heterogeneous applications (one in Go, one in Java, and one in Ruby) all running in a single Pod for performance reasons. Each application produces logs in a different format (JSON, Plain Text, and Key-Value). A centralized logging system requires all logs to be in a unified XML format. You cannot modify the code of these applications. Which design pattern should be used to transform these logs before they are sent to the central server?

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

    Show answer & explanation

    Correct answer: D. Implement the Adapter pattern by adding a container that reads the logs from a shared volume and converts them to the required XML format.

    The Adapter container pattern translates heterogeneous outputs into a unified format before sending them to external systems. A standard sidecar container usually forwards raw logs untouched, whereas an adapter specifically performs the required XML transformation.

  14. Question 511 of 597A sophisticated data-processing Java application requires a long initialization period to load large machine learning models into memory before it can handle any requests. This process takes approximately 180 seconds. You have configured a liveness probe to ensure the container is healthy, but the probe starts failing and restarts the container before the initialization is complete. What is the most effective way to resolve this while maintaining health monitoring?

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

    Show answer & explanation

    Correct answer: D. Configure a startupProbe with a failureThreshold of 30 and a periodSeconds of 10 to protect the container during boot

    A startup probe disables liveness checks until it succeeds, perfectly protecting slow-starting applications during initialization. Relying heavily on high initialDelaySeconds values is less efficient because fast-booting pods will wait unnecessarily before receiving traffic.

  15. Question 512 of 597A security-auditing Pod named 'secret-checker' is deployed in the 'security-ops' namespace. This Pod needs to list and inspect the content of all Secrets within the 'customer-data' namespace to ensure compliance with encryption policies. Following the principle of least privilege, you must configure the necessary Kubernetes objects to grant this specific Pod the required permissions across namespace boundaries without granting cluster-wide administrative access.

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

    Show answer & explanation

    Correct answer: D. Create a Role in the 'customer-data' namespace and a RoleBinding in the same namespace that associates the Role with the ServiceAccount from 'security-ops'.

    Creating a Role and RoleBinding in the target namespace allows you to securely grant cross-namespace access to a specific ServiceAccount. ClusterRoles grant access across the entire cluster, which violates the principle of least privilege required for security compliance.

  16. Question 513 of 597An application named 'data-analyzer' requires a large configuration file (approx. 50MB) that is generated dynamically and stored in a central S3 bucket. The main application container cannot start until this file is successfully downloaded to a shared volume at /config/settings.json. This download process involves a heavy CLI tool and authentication steps that are not needed by the main application once it is running. How should this workflow be architected in the Pod?

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

    Show answer & explanation

    Correct answer: C. Use an initContainer to execute the download script and store the result in an emptyDir volume shared with the main container.

    InitContainers run sequentially to completion before any application containers start. Use an initContainer to fetch dependencies into a shared volume, ensuring the main container only starts once its required files are present.

  17. Question 514 of 597Your organization is deploying a high-traffic web application using a Deployment named web-v2 with 20 replicas. During the update process from version 2.1 to 2.2, you must ensure that the cluster always maintains at least 80 percent of the desired capacity to prevent performance degradation. Additionally, you want to limit the total number of Pods in the cluster during the update so that it does not exceed 125 percent of the desired replica count at any given time. Which specific configuration should be applied to the Deployment strategy?

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

    Show answer & explanation

    Correct answer: D. Set the RollingUpdate strategy with maxUnavailable: 4 and maxSurge: 5 to maintain capacity and limit total Pod count.

    Setting maxUnavailable to 4 and maxSurge to 5 maintains 16 available pods and limits total pods to 25. During the exam, calculate these values using the exact replica count rather than defaulting to standard percentages.

  18. Question 515 of 597An analytics application requires a large configuration file to be downloaded from an external secure server and decrypted before the main application starts. The decryption process requires a specific utility that is not included in the main application image for security reasons. How should you structure the Pod to handle this initialization sequence?

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

    Show answer & explanation

    Correct answer: C. Use an initContainer with the decryption utility image to download and process the file, saving the result into a shared emptyDir volume.

    InitContainers run to completion before the main application starts, making them perfect for preparing data. By saving the decrypted file into a shared volume, the main container securely accesses the prepared data without needing the utility.

  19. Question 516 of 597You are designing a Pod for a web application that has a hard dependency on an external legacy database and a configuration service. Both dependencies are exposed as Kubernetes Services ('db-service' and 'config-service'). If the main application starts before these services are resolvable in the cluster DNS, it fails to initialize and enters a 'CrashLoopBackOff' state. You want to implement a robust solution that delays the startup of the main application container until both service names can be successfully resolved.

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

    Show answer & explanation

    Correct answer: C. Add an 'initContainer' that runs a script using 'nslookup' in a loop to check the resolution of both service names.

    InitContainers block the main container from starting until they complete successfully. This pattern guarantees your application will not crash loop if it relies on external services that need time to register in DNS.

  20. Question 517 of 597A high-performance data processing application is experiencing high latency when fetching large static assets from a remote storage bucket. To optimize performance, the architecture team decides to implement a local caching sidecar using Nginx. This sidecar container will reside in the same Pod as the application, sharing the network stack. The application should be able to request cached assets via 'localhost' on port 8080. How must the Pod be configured to allow the application container and the Nginx sidecar to communicate this way?

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

    Show answer & explanation

    Correct answer: C. No special configuration is needed because containers within the same Pod automatically share the same network namespace.

    Containers within the same Pod share the exact same network namespace, meaning they communicate via localhost. You do not need a Service or host networking for inter-container traffic on the same loopback interface.

  21. Question 518 of 597An analytics namespace named 'data-prod' contains multiple Pods that are experiencing frequent restarts. You are required to generate a report using kubectl that lists the Pod name, the restart count of the container named 'engine-worker', and the image version currently assigned to that specific container. You must use a single command with the jsonpath output format to extract this data for all Pods in the namespace. Which jsonpath expression will correctly retrieve these three specific fields?

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

    Show answer & explanation

    Correct answer: A. jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.containerStatuses[?(@.name=="engine-worker")].restartCount}{" "}{.spec.containers[?(@.name=="engine-worker")].image}{"\n"}{end}'

    It uses the range operator to iterate over items, then applies filters inside brackets to target the specific container by name for both the restart count and the image. Remember that restart counts live under status containerStatuses, while the image is under spec containers.

  22. Question 519 of 597Your organization is adopting a Blue-Green deployment strategy. You have a Deployment named 'web-v1' (Blue) currently receiving all production traffic through a Service named 'web-prod-svc' which selects pods using 'app: web, version: v1'. You have successfully deployed 'web-v2' (Green) with 'app: web, version: v2'. What is the final step to perform the switch and direct all traffic to the new version?

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

    Show answer & explanation

    Correct answer: A. Modify the 'web-prod-svc' Service selector to point to 'version: v2' instead of 'version: v1' to reroute the traffic

    Changing the Service label selector instantly routes production traffic to the new version v2 pods. Do not delete the old deployment immediately, as you need it for a quick rollback if the green deployment fails.

  23. Question 520 of 597You are configuring an Ingress resource to manage traffic for a corporate website. The requirement is to route all traffic for 'example.com/shop' to a Service named 'shopping-svc' on port 8080, and all traffic for 'example.com/checkout' to a Service named 'payment-svc' on port 9000. All other traffic to 'example.com' should be directed to a 'static-frontend' Service on port 80. How should the paths be defined in the Ingress manifest?

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

    Show answer & explanation

    Correct answer: C. Use a single Ingress with path '/shop' (Prefix), path '/checkout' (Prefix), and path '/' (Prefix) for the frontend

    A single Ingress using Prefix path types handles all routing needs efficiently. The Ingress controller automatically evaluates the longest, most specific paths first, so the slash prefix safely acts as a catch-all backend.

  24. Question 521 of 597You are managing a specialized data-crunching application called 'analytics-worker' that performs heavy file I/O operations. The application is designed to process data from a shared directory that must be initialized with a specific dataset from a remote storage server before the main process begins. The main container is running a hardened image that does not have 'wget' or 'curl' installed for security reasons, and you cannot modify the image. How can you ensure the required data is available in the shared volume before the 'analytics-worker' starts its processing?

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

    Show answer & explanation

    Correct answer: B. Implement an InitContainer with a base utility image to download the dataset into a shared volume before the main container starts

    An init container runs to completion before the main application starts, using a separate utility image to fetch the data. Sidecars run concurrently, which risks race conditions if the main container needs the data immediately upon starting.

  25. Question 522 of 597You are securing a backend microservice in the 'internal-api' namespace. A strict security mandate requires that the microservice only accept incoming traffic from the corporate subnet '10.50.0.0/16'. Within that subnet, there is a specific range '10.50.20.0/24' used by legacy systems that are considered untrusted and must be explicitly blocked from reaching the microservice. All other traffic from any other CIDR range must be denied by default. You are implementing this using a Kubernetes NetworkPolicy resource.

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

    Show answer & explanation

    Correct answer: C. Configure an 'ingress' rule with 'ipBlock' specifying 'cidr: 10.50.0.0/16' and 'except: [10.50.20.0/24]'.

    The ipBlock selector natively supports a comma-separated except field to exclude untrusted subnets from an allowed range. NetworkPolicies are allow-lists by default, so defining allowed traffic inherently blocks everything else.

  26. Question 523 of 597Your engineering team is troubleshooting a custom proprietary message broker deployed as a Pod. The broker does not support HTTP or gRPC; it uses a custom binary protocol on TCP port 9000. You need to implement a liveness probe to ensure that the container is restarted if the service stops listening on that port. However, you want to avoid the overhead of running a full 'exec' command inside the container. What is the most efficient probe configuration for this scenario?

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using the tcpSocket field targeting port 9000 to perform a simple TCP connection check.

    The tcpSocket probe verifies basic network connectivity by attempting to open a TCP connection to the designated port. It avoids the processing overhead and security risks associated with running shell commands inside the container.

  27. Question 524 of 597An analytics application uses a 'PersistentVolumeClaim' (PVC) named 'data-log' which is bound to a 'PersistentVolume' (PV) from a dynamic provisioner. The current volume size is 10Gi, but the logs are growing rapidly and the volume is nearly full. The 'StorageClass' used by this PVC has 'allowVolumeExpansion' set to 'true'. You need to increase the volume size to 50Gi without losing any existing data or manually deleting and recreating the Kubernetes objects.

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

    Show answer & explanation

    Correct answer: B. Update the 'spec.resources.requests.storage' field of the existing PVC to 50Gi and apply the change.

    Patching the storage request on the PVC triggers the dynamic provisioner to expand the volume seamlessly. Directly modifying the PersistentVolume is discouraged because Kubernetes manages the lifecycle and reconciliation of the bound claim.

  28. Question 525 of 597To comply with new corporate security standards, all pods in the 'finance-prod' namespace must run with restricted privileges. Specifically, the 'transaction-logger' container must not run as the root user, must not be able to escalate privileges, and must have its root filesystem mounted as read-only. How should these constraints be implemented in the Pod manifest?

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

    Show answer & explanation

    Correct answer: D. Apply a securityContext at the container level setting runAsNonRoot to true, allowPrivilegeEscalation to false, and readOnlyRootFilesystem to true.

    A container-level security context directly applies required restrictions like read-only filesystems and non-root execution. Resource quotas only limit resource consumption across namespaces, while environment variables lack actual enforcement capabilities.

  29. Question 526 of 597A distributed order-processing application consists of a main container that requires a specific directory structure and several configuration files to be present on a shared volume before the application starts. These files are generated by a script that queries a remote metadata service. If the script fails, the main application container will crash and potentially corrupt the shared volume. You must ensure that the configuration is successfully prepared before the main container starts and that failures in preparation prevent the Pod from running.

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

    Show answer & explanation

    Correct answer: C. Use an initContainer to execute the setup script. Ensure the script returns a non-zero exit code on failure and mounts the same volume as the main container.

    Init containers block the main container from starting until they complete successfully, guaranteeing the environment is fully prepared. If the setup script fails, the init container aborts, safely preventing the main pod from crashing.

  30. Question 527 of 597Your legacy e-commerce application produces log files in a proprietary text format at /opt/app/logs/server.log. Your organization's central logging system requires logs to be transmitted via an HTTP POST request in JSON format. To avoid modifying the legacy application code, you decide to use a multi-container Pod approach where a secondary container reads the log file and performs the transformation and transmission. Which container design pattern is most appropriate for this scenario?

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

    Show answer & explanation

    Correct answer: C. Implement an adapter container that reads the local log file and exports it to the external monitoring system format

    The adapter container pattern transforms the main application's output into a format required by an external system. While a sidecar shares the same lifecycle, an adapter specifically standardizes logs or metrics without altering the core application code.

  31. Question 528 of 597Your development team has provided a ConfigMap named 'global-config' that contains 50 different application settings required for a Node.js microservice. Instead of manually mapping each key to a specific environment variable in the Pod manifest, you want to ensure that every single key-value pair currently in the ConfigMap (and any added in the future) is automatically made available as an environment variable to the container process. This must be done using the most efficient and maintainable syntax possible in the YAML manifest.

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

    Show answer & explanation

    Correct answer: B. Use the envFrom field with the configMapRef attribute pointing to the 'global-config' ConfigMap name.

    The envFrom field populates all ConfigMap keys as environment variables automatically. Manual mapping using env with configMapKeyRef is tedious and fails the requirement to dynamically include future additions without manifest edits.

  32. Question 529 of 597You are deploying a security-hardened 'vault-sync' Pod that must access a sensitive API token and a certificate file. These items are stored in a Kubernetes Secret named 'auth-materials'. The application code is hardcoded to look for the API token at '/mnt/secrets/token' and the certificate at '/mnt/secrets/cert.pem'. You must ensure these values are provided as files on the local filesystem and are not accessible via environment variables to prevent accidental exposure in process logs.

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

    Show answer & explanation

    Correct answer: C. Create a Volume of type 'secret' referencing 'auth-materials' and add a volumeMount in the container to mount it at '/mnt/secrets/'.

    Mounting a Secret as a volume projects its keys as individual files into the specified directory path. Environment variables expose values in process logs, violating the strict security requirement to keep them strictly on the filesystem.

  33. Question 530 of 597A web application named catalog-api is being deployed into a production cluster where the external traffic is managed by an Ingress controller. The application takes a long time to boot and depends on an external cache being fully populated. If traffic is sent to the Pod too early, the application crashes under the load. Beyond standard readiness probes, you need to ensure the Pod is only included in the Ingress load balancer when a specific external verification service also reports that the environment is ready. Which Kubernetes feature supports this?

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

    Show answer & explanation

    Correct answer: B. Define readinessGates in the Pod spec to specify additional conditions that must be met before the Pod is considered ready.

    Readiness gates allow external services to inject custom readiness conditions directly into a Pod's status. Startup probes only delay traffic until the application boots, whereas readiness gates hold traffic until external verification passes.

  34. Question 531 of 597A developer needs to configure a Node.js microservice that requires 50 different environment variables. These variables are already defined as key-value pairs in a ConfigMap named 'service-env-vars'. Instead of manually mapping each key to an environment variable in the Pod specification, the developer wants a more efficient way to inject all entries at once.

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

    Show answer & explanation

    Correct answer: C. Use the envFrom field in the container specification and provide a configMapRef that points to the 'service-env-vars' ConfigMap.

    The envFrom field automatically populates the container environment with all keys from a referenced ConfigMap. Manual mounting requires custom scripts, which fails the requirement for efficient, native Kubernetes manifest syntax.

  35. Question 532 of 597You are configuring an Ingress resource to manage external access for a corporate portal. The requirement is to route traffic based on the requested hostname to different internal backend services. Specifically, traffic for 'api.corp.com' must be routed to the 'api-service' on port 8080, while traffic for 'dashboard.corp.com' must be routed to the 'web-service' on port 9090. Both services are located in the same 'internal' namespace and the Ingress controller is already installed and functional.

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

    Show answer & explanation

    Correct answer: D. Create an Ingress resource with two separate entries in the 'rules' list, each specifying a 'host' and a corresponding 'http' path pointing to its respective service.

    Defining multiple rules with distinct host fields in a single Ingress resource directs traffic based on the requested hostname. Wildcard hosts or path-based routing are unnecessary here since the exact internal domain names are fully specified.

  36. Question 533 of 597A security-sensitive application named 'network-analyzer' must be deployed in a cluster with strict hardening policies. The container image is configured to run as a non-privileged user with UID 5000. However, the application requires the ability to use the 'ping' utility and capture raw network packets for diagnostic purposes, which are operations that normally require CAP_NET_RAW privileges. You need to configure the Pod's security settings to allow these specific network operations while strictly ensuring the container continues to run as UID 5000 and not as root.

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

    Show answer & explanation

    Correct answer: D. Define a securityContext at the container level with runAsUser: 5000 and add the NET_RAW capability under the capabilities field.

    Adding NET_RAW capabilities explicitly grants packet capture privileges while runAsUser enforces the UID. Privileged containers bypass least privilege rules and violate the strict security policy demanding a non-root identity.

  37. Question 534 of 597A Node.js microservice takes roughly 45 seconds to initialize its internal cache and connect to a remote database. During this period, it responds with a 503 error code to any incoming HTTP requests. Once initialized, the service is stable but might occasionally hang if the cache becomes corrupted. Which probe configuration is most appropriate to ensure traffic only hits the pod when it is ready and that it is restarted if it hangs?

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

    Show answer & explanation

    Correct answer: B. Configure a startupProbe to handle the 45-second initialization, combined with a readinessProbe for traffic and a livenessProbe for health.

    A startup probe safeguards slow-booting applications by disabling liveness checks during initialization. Without a startup probe, using initialDelaySeconds forces you to guess maximum boot times, delaying actual crash detection later.

  38. Question 535 of 597You are deploying a data-processing Pod that runs as a non-privileged user with UID 2000. The Pod mounts a 'PersistentVolumeClaim' (PVC) at '/data/output'. In many cluster environments, the mounted volume defaults to being owned by the 'root' user (UID 0), which prevents your application user (UID 2000) from writing any data to the disk. You need a way to ensure that the volume's ownership is correctly set so the application has write access without running the container as root.

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

    Show answer & explanation

    Correct answer: C. Define 'fsGroup: 2000' within the Pod-level 'securityContext' in the manifest.

    Setting fsGroup in the Pod security context dynamically changes the mounted volume's group ownership. Using privileged root containers violates security requirements, and manual chown commands fail if the user lacks root permissions.

  39. Question 536 of 597Your application requires a specific configuration file named 'settings.ini' to be mounted from a ConfigMap into the directory '/etc/config/'. The application binary includes a strict security check: it will refuse to start if the configuration file has 'write' or 'execute' permissions for the group or other users. It specifically mandates that the file must have 'read-only' permissions for the owner and no permissions for anyone else, which corresponds to the octal mode 0400. You need to configure the Pod's volume specification to ensure the file is mounted with these exact permissions.

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

    Show answer & explanation

    Correct answer: C. Set the 'defaultMode' field to 0400 within the ConfigMap volume definition in the Pod spec.

    The defaultMode field in a ConfigMap volume sets exact Unix permissions for mounted files. Setting readOnly on the volumeMount prevents writing but leaves default permissions untouched, failing the strict octal mode requirement.

  40. Question 537 of 597An application container requires access to several pieces of metadata at runtime: an API key stored in a 'Secret', a set of feature flags in a 'ConfigMap', and the Pod's own name and namespace provided by the Downward API. You want to present all these files to the application in a single, unified directory at '/etc/app-meta' instead of mounting three separate volumes to different paths.

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

    Show answer & explanation

    Correct answer: B. Use a 'projected' volume type that aggregates the Secret, ConfigMap, and downwardAPI into one volume.

    A projected volume combines several volume sources into a single directory. While an initContainer could technically stage files, it requires unnecessary scripting and violates the direct native integration expected for the exam.

  41. Question 538 of 597A mission-critical financial API is deployed in a cluster that spans three availability zones: us-east-1a, us-east-1b, and us-east-1c. To ensure maximum resilience during a zone-wide failure, you must guarantee that the 12 replicas of the application are distributed as evenly as possible across these zones. The cluster uses the standard topology.kubernetes.io/zone label to identify the location of each node.

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

    Show answer & explanation

    Correct answer: C. Configure topologySpreadConstraints with the topologyKey for zones and set whenUnsatisfiable to DoNotSchedule with a maxSkew value of 1.

    Topology spread constraints with a low maxSkew force the scheduler to distribute pods evenly across the specified topology domains. Pod anti-affinity lacks the granular control needed for exact proportional distribution across multiple zones.

  42. Question 539 of 597Your mission-critical 'order-processing' Deployment currently runs with 10 replicas. To ensure high availability during updates, you have been instructed to configure a rolling update strategy where at least 8 replicas must always be available to handle traffic, and no more than 13 replicas should exist in the cluster at any given time during the transition. Which configuration for the RollingUpdate strategy should you apply to the Deployment manifest?

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

    Show answer & explanation

    Correct answer: C. Set maxSurge to 3 and maxUnavailable to 2 in the deployment strategy section.

    Setting maxSurge to 3 permits the cluster to temporarily create up to 13 pods, and maxUnavailable to 2 guarantees 8 remain active. Using percentages fails the strict integer constraints outlined in the scenario.

  43. Question 540 of 597A mission-critical deployment named 'stock-feeder' is currently running with 8 replicas in a cluster that is operating at 90% resource capacity. Due to these tight resource constraints, the cluster can only accommodate 1 additional Pod during an update process. At the same time, the business requires that at least 7 replicas remain available at all times to handle the baseline traffic load. You are tasked with configuring the 'rollingUpdate' strategy in the Deployment manifest to allow for a version update from v1 to v2 without exceeding the node capacity or violating the availability requirement.

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

    Show answer & explanation

    Correct answer: C. Configure the strategy with 'maxUnavailable: 1' and 'maxSurge: 1' in the Deployment spec.

    Setting maxUnavailable to 1 permits exactly 7 replicas during updates, and maxSurge to 1 respects the single spare pod capacity. Option A fails because maxUnavailable zero demands higher surge capacity the cluster lacks.

  44. Question 541 of 597You are deploying a network security tool as a Pod in your cluster. This tool needs to monitor network traffic by capturing packets on the host's network interfaces and requires the ability to change the system clock to synchronize with a central time server. By default, Kubernetes containers are restricted from these actions for security. How should you configure the Pod to allow these specific operations while following the principle of least privilege?

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

    Show answer & explanation

    Correct answer: A. Add the 'NET_RAW' and 'SYS_TIME' capabilities to the securityContext section of the container specification

    Adding specific Linux capabilities like NET_RAW and SYS_TIME adheres to the principle of least privilege by granting only the exact permissions needed. Using privileged mode or root access violates this security principle unnecessarily for the monitoring tool.

  45. Question 542 of 597A financial transaction microservice named 'secure-pay' is being deployed into a production cluster where strict network isolation is mandatory. The 'secure-pay' Pod needs to communicate with a specific database Pod named 'postgres-db' in the 'data' namespace on port 5432. All other ingress and egress traffic for the 'secure-pay' Pod must be explicitly blocked to comply with security regulations and minimize the attack surface. You are tasked with creating a NetworkPolicy that ensures this specific connectivity while maintaining a default-deny posture for all other directions. How should you structure this policy?

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

    Show answer & explanation

    Correct answer: C. Define a NetworkPolicy for the 'secure-pay' Pod with an egress rule targeting the 'data' namespace and a podSelector for 'postgres-db' on port 5432

    An egress rule using both namespaceSelector and podSelector restricts outgoing traffic to the exact database pod. Remember that default deny requires separate policies, but this option correctly identifies the egress target components.

  46. Question 543 of 597You are managing a multi-tier application consisting of a 'frontend' deployment and a 'database' deployment in the 'production' namespace. A security audit requires that the 'database' pods should only accept incoming traffic on port 5432 from pods that have the label 'role: frontend'. Any other traffic from within the cluster, including from other pods in the same namespace, must be blocked. Which NetworkPolicy configuration achieves this?

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

    Show answer & explanation

    Correct answer: C. An ingress policy on the 'database' pods with a 'from' rule containing a 'podSelector' matching 'role: frontend'

    Applying an ingress policy to the database pods with a podSelector for the frontend implicitly denies all other traffic. Egress policies control outbound traffic, not incoming requests, making option B the wrong direction.

  47. Question 544 of 597A legacy Python-based background worker occasionally enters a 'zombie' state where the process remains running but it stops processing tasks. When this happens, the heartbeat file located at '/tmp/heartbeat.txt' inside the container stops being updated. You need to configure a Kubernetes probe that restarts the container if the heartbeat file hasn't been modified in the last 60 seconds. Which probe configuration is most appropriate?

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

    Show answer & explanation

    Correct answer: C. A livenessProbe using an exec command that runs a shell script to check the modification time of the file and returns a non-zero exit code if it exceeds the limit.

    A liveness probe with an exec command checks file staleness and restarts the container upon failure. A readiness probe would only remove the pod from the service without actually restarting the frozen process.

  48. Question 545 of 597An application container named data-processor runs as a non-root user with UID 5000 for security reasons. The application must write large amounts of temporary data to a PersistentVolumeClaim (PVC) mounted at /data/scratch. During testing, the application fails with a Permission Denied error because the mounted volume is owned by the root user by default. You cannot change the image or the volume provider's default settings. What is the correct way to grant the application write access to the volume?

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

    Show answer & explanation

    Correct answer: C. Define the securityContext at the Pod level and set the fsGroup field to 5000 to ensure the volume is re-permissioned for the user.

    Setting fsGroup in the pod security context automatically adjusts volume permissions for non-root users. Using a privileged container defeats the security purpose, and a chmod init container is less reliable.

  49. Question 546 of 597A production Deployment named user-api currently runs 10 replicas of a critical microservice. During an upcoming update to version 2.0.0, the engineering lead specifies that the system must never drop below the current processing capacity to maintain high availability. Additionally, to prevent overloading the Kubernetes nodes during the rollout, no more than 3 extra Pods should be created at any given time above the desired replica count. You need to configure the rolling update strategy to meet these specific infrastructure and availability constraints.

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

    Show answer & explanation

    Correct answer: C. Define a RollingUpdate strategy with maxSurge set to 3 and maxUnavailable set to 0 to maintain at least 10 active Pods while allowing up to 13 during the transition.

    Setting maxUnavailable to zero maintains processing capacity, while maxSurge limits overhead to three pods. A strategy with maxSurge zero and maxUnavailable three would immediately drop below capacity, violating the requirement.

  50. Question 547 of 597A batch processing system is required to handle 200 independent tasks stored in a message queue. Each task takes approximately 10 minutes to complete. To meet business deadlines, the system must process at least 5 tasks simultaneously. The entire Job must be considered successful only when all 200 tasks have been processed successfully. If a single task fails, it should be retried a maximum of 3 times before the entire Job is marked as failed. Which Job configuration parameters should be utilized to achieve this behavior?

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

    Show answer & explanation

    Correct answer: B. Set 'completions' to 200, 'parallelism' to 5, and 'backoffLimit' to 3 in the Job specification to control execution and retries

    Completions sets the required successful finishes, parallelism sets concurrent pods, and backoffLimit handles retries. The activeDeadlineSeconds parameter restricts total runtime but does not define the retry behavior.

  51. Question 548 of 597A production Deployment named 'payment-service' currently runs 4 replicas. During an upcoming cluster maintenance, several nodes will be drained for kernel updates. You need to ensure that at least 3 replicas of this service remain available at all times to meet the Service Level Agreement (SLA). The deployment must be protected from voluntary disruptions while still allowing the administrator to perform necessary node maintenance.

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

    Show answer & explanation

    Correct answer: D. Create a PodDisruptionBudget resource targeting the payment-service labels and set the minAvailable field to a value of 3.

    A PodDisruptionBudget with minAvailable set to three protects the application during voluntary disruptions like node drains. A PriorityClass only prevents preemption by other workloads, not evictions requested by administrators.

  52. Question 549 of 597An e-commerce platform's frontend deployment, 'web-shop', currently runs 10 replicas in a production environment. To improve update reliability, the engineering team wants to ensure that during a rolling update, the cluster always maintains at least 80 percent of the desired capacity at all times. Simultaneously, they want to limit the additional resource consumption during the update process so that no more than 13 total replicas exist at any point in time. Which specific configuration parameters should be defined in the Deployment's rollingUpdate strategy to meet these precise constraints?

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

    Show answer & explanation

    Correct answer: D. Set the maxSurge parameter to 3 and the maxUnavailable parameter to 2 to maintain capacity while limiting the maximum number of concurrent pods

    Setting maxSurge to 3 allows up to 13 total pods, while maxUnavailable 2 keeps at least 8 pods available during the rollout. Do not confuse absolute integer values with percentages, as percentages would yield different pod counts here.

  53. Question 550 of 597Your team is deploying a high-performance microservice that communicates exclusively via the gRPC protocol on port 50051. Standard HTTP-based liveness probes are not feasible because the application does not expose a REST interface. To ensure the container is automatically restarted if the internal gRPC server hangs or becomes unresponsive, you must implement a native health check mechanism that is supported by Kubernetes 1.24+ without relying on custom scripts or third-party binaries inside the image.

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

    Show answer & explanation

    Correct answer: A. Implement a livenessProbe using the grpc field, specifying the port as 50051 and leaving the service field empty or set to a specific gRPC service name.

    Native gRPC probes use the grpc protocol field to directly check the gRPC Health Checking Protocol. An exec probe requires bundling a separate binary, which the scenario explicitly prohibits.

  54. Question 551 of 597Your team is running 'app-v1' with 10 replicas managed by a Deployment. You want to perform a manual canary release of 'app-v2'. You need to route approximately 10% of the traffic to the new version using the existing Service named 'app-service' which currently points to 'app-v1'. How can you achieve this using standard Kubernetes objects without modifying the existing Service's type or using an Ingress controller?

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

    Show answer & explanation

    Correct answer: D. Create a second Deployment for 'app-v2' with 1 replica, and ensure both Deployments have the same labels that match the Service's selector.

    Services balance traffic across all Pods matching their selector regardless of the managing Deployment. Creating one new replica alongside nine existing replicas achieves the exact ten percent traffic split.

  55. Question 552 of 597A legacy financial application named legacy-proxy is designed to connect to a local database instance hardcoded at 127.0.0.1:5432. However, the organization has recently moved its database to a managed cloud service with a dynamic external endpoint. To avoid refactoring the legacy code, your team decides to use a multi-container Pod pattern that intercepts local traffic and redirects it to the cloud database. You need to configure this additional container effectively within the same Pod definition to ensure connectivity for the application.

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

    Show answer & explanation

    Correct answer: C. Implement an ambassador container running a lightweight TCP proxy like HAProxy or Envoy to forward traffic from localhost:5432 to the external cloud database address.

    The ambassador pattern uses a local proxy container to broker connections to external services. This allows the legacy application to connect to localhost while the proxy handles the complex external routing.

  56. Question 553 of 597A development team is migrating a microservice that depends on a legacy database hosted on a static IP address outside the Kubernetes cluster. To ensure the application remains portable and to avoid hardcoding external IP addresses in the code, you want to create a Kubernetes abstraction that allows the application to connect to 'legacy-db-svc' as if it were a standard internal service. The external database has a stable DNS record 'db.corporate-legacy.net'. What is the most efficient way to implement this?

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

    Show answer & explanation

    Correct answer: A. Define a Service of type ExternalName with the externalName field set to 'db.corporate-legacy.net'.

    An ExternalName Service returns a CNAME record pointing to the specified external DNS name. This cleanly abstracts external dependencies without creating unnecessary proxy pods or manual endpoint management.

  57. Question 554 of 597You are configuring a Pod named 'log-aggregator' that contains two containers: 'app-engine' and 'log-shipper'. The 'app-engine' container writes its operational logs to a local directory at '/var/log/app/'. The 'log-shipper' container must read these logs in real-time and send them to a remote storage backend. Neither container should have access to the underlying node's host filesystem for security reasons. Which Kubernetes volume type is most suitable for sharing this log data between the two containers in the same Pod?

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

    Show answer & explanation

    Correct answer: C. An EmptyDir volume mounted at '/var/log/app/' in both containers, providing a shared temporary storage space that exists only for the life of the Pod

    An emptyDir volume provides shared temporary storage tied directly to the Pod's lifecycle for multiple containers. HostPath volumes violate the security requirement by exposing the node filesystem.

  58. Question 555 of 597A high-performance microservice written in C++ occasionally experiences a thread deadlock where the main process remains running but stops processing the incoming message queue effectively. The application does not expose an HTTP health endpoint or a dedicated status port. To detect this specific locked state, the development team has provided a diagnostic script located at /usr/local/bin/check-health.sh inside the container image that returns an exit code of 0 if the internal queue is active and 1 if it is stuck. You must configure the Pod to restart the container automatically whenever this script detects a deadlock.

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

    Show answer & explanation

    Correct answer: A. Configure a LivenessProbe using the exec field to run the /usr/local/bin/check-health.sh script periodically.

    A LivenessProbe using the exec action runs the diagnostic script and restarts the container upon failure. A ReadinessProbe only removes the Pod from Service endpoints without triggering a restart.

  59. Question 556 of 597A financial data processing team uses a CronJob to run a heavy reconciliation script every 15 minutes. They have noticed that on several occasions, the Job failed, and the cluster is now cluttered with a large number of failed Pods from previous executions. They want to ensure that only the last 2 failed executions and the last 3 successful executions are kept in the history to simplify troubleshooting. Which fields should be configured in the CronJob manifest?

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

    Show answer & explanation

    Correct answer: A. Set 'successfulJobsHistoryLimit: 3' and 'failedJobsHistoryLimit: 2' in the CronJob spec section

    The successfulJobsHistoryLimit and failedJobsHistoryLimit fields directly control automatic cleanup of old Job objects. The concurrencyPolicy only manages overlapping schedules, not historical retention.

  60. Question 557 of 597An engineering team is managing a mission-critical deployment named 'inventory-api' that currently has 10 replicas. To maintain high availability during updates, the team requires that at least 10 replicas must always be available to handle traffic, and to avoid overloading the nodes, no more than 13 total pods should ever exist during the rolling update process. Which deployment strategy configuration should be applied to the 'inventory-api' manifest?

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

    Show answer & explanation

    Correct answer: A. Configure a RollingUpdate strategy with maxSurge set to 3 and maxUnavailable set to 0 to ensure capacity is never reduced below the desired count.

    A RollingUpdate strategy with maxSurge of three and maxUnavailable of zero keeps the active replica count at ten while temporarily allowing up to thirteen total pods. Avoid using the Recreate strategy, as it immediately terminates all pods.

  61. Question 558 of 597Your team is deploying a sensitive application that requires both a database password and a complex configuration file containing 50 environment-specific parameters. The password must be stored securely and not exposed in plain text in the Pod specification, while the configuration file should be easily updateable without rebuilding the container image. The application expects the configuration file at '/etc/app/config.yaml' and the password as an environment variable named 'DB_PASSWORD'. What is the most secure and maintainable way to provide these to the Pod?

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

    Show answer & explanation

    Correct answer: A. Store the password in a Secret and the configuration in a ConfigMap, then mount the ConfigMap as a volume and the Secret as an environment variable

    Using a Secret for the password and a ConfigMap for the configuration keeps sensitive data secure while allowing easy updates. Injecting large files via environment variables is not recommended because it increases the risk of exposing sensitive values in logs.

  62. Question 559 of 597You are managing a multi-tier financial application where the 'transaction-db' Pod handles sensitive ledger data in the 'finance' namespace. To meet regulatory compliance, you must implement a network isolation strategy where only Pods that are explicitly labeled with 'app: backend' within the same 'finance' namespace are permitted to initiate TCP connections to the database on port 5432. You must also ensure that all other incoming traffic from any Pod in any namespace (including the 'finance' namespace) is denied by default.

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

    Show answer & explanation

    Correct answer: A. Create a NetworkPolicy that selects the 'transaction-db' pod, defines a single ingress rule for port 5432 from pods matching 'app: backend', and includes an empty podSelector policy elsewhere to deny all other traffic.

    A NetworkPolicy applied to the database pod restricts incoming traffic exclusively to the specified backend pods while blocking all other connections. LoadBalancer source ranges restrict external access, whereas NetworkPolicies are required to isolate internal pod traffic.

  63. Question 560 of 597You are managing a microservice named payment-processor in the finance namespace. For compliance reasons, this microservice is only allowed to communicate with the internal database service in the same namespace and a specific external auditing service located at the IP address 192.168.10.50. All other egress traffic to the internet or other internal services must be strictly blocked. Which NetworkPolicy configuration correctly implements these egress rules?

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

    Show answer & explanation

    Correct answer: D. Define an egress policy with a rule allowing traffic to the database service name and a second rule with an ipBlock for 192.168.10.50/32.

    NetworkPolicies are additive and deny all non-matching egress traffic once applied. Defining specific rules using a podSelector for the database and an ipBlock for the external service restricts egress to only the approved destinations.

  64. Question 561 of 597You are managing a critical 'checkout-service' Deployment with 10 replicas in a cluster that is running near its resource limits. You need to perform a RollingUpdate to a new version. The infrastructure can only tolerate a maximum of 12 total Pods running during the update process to avoid triggering node pressure, and at least 8 replicas must remain available at all times to handle the baseline production traffic. How should you configure the rollingUpdate strategy in the Deployment manifest?

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

    Show answer & explanation

    Correct answer: A. Set maxSurge to 2 and maxUnavailable to 2 to ensure the total Pod count never exceeds 12 and the available Pod count never drops below 8.

    Setting maxSurge to two and maxUnavailable to two strictly guarantees that total pods never exceed twelve and available pods never drop below eight. Options using percentages should be avoided here because they can result in unpredictable rounding that violates hard limits.

  65. Question 562 of 597An engineering team is deploying a data-intensive batch Job named 'record-validator' that processes 50 independent chunks of data. Each execution of the Job is resource-heavy and takes roughly 10 minutes to complete. The team has observed that occasional network blips cause the container to fail intermittently. They want to ensure that the Job controller attempts to retry failed executions, but to prevent a loop of expensive failures, the Job should be completely abandoned and marked as failed after a total of 3 unsuccessful pod attempts. Which configuration should be applied?

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

    Show answer & explanation

    Correct answer: A. Set the backoffLimit field to 3 in the Job specification to limit the number of retries before the Job is considered failed.

    The backoffLimit field specifies the maximum number of failed Pod retries before the Job is marked as failed. For the exam, remember that parallelism and completions control scaling, while activeDeadlineSeconds restricts total execution time.

  66. Question 563 of 597Your security policy requires that the 'frontend' microservice in the 'production' namespace must only be able to send outgoing (egress) traffic to a specific on-premises subnet with the CIDR range 192.168.10.0/24. All other outgoing traffic to the internet or other internal subnets must be blocked to prevent data exfiltration. Which NetworkPolicy configuration correctly implements this restriction for the 'frontend' pods?

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

    Show answer & explanation

    Correct answer: C. Create an egress policy with a single rule containing to: ipBlock: cidr: 192.168.10.0/24.

    Defining an egress policy with a specific ipBlock creates an implicit deny rule for all other traffic. Remember that podSelector chooses destinations, whereas ipBlock is required for external subnets.

  67. Question 564 of 597You are tasked with configuring an Ingress resource to host multiple microservices for a company portal. Traffic arriving at 'company.com/orders' must be routed to the 'orders-svc' Service on port 8080, while traffic for 'company.com/inventory' must be directed to the 'inventory-svc' Service on port 9000. Both services are in the 'production' namespace. Which Ingress rule configuration correctly implements this path-based routing?

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

    Show answer & explanation

    Correct answer: A. Create a single Ingress with a 'rules' section containing the 'host', and a 'http' section with two entries under 'paths', each specifying the path, pathType, and backend.

    Path-based routing is configured under a single host rule with multiple backend paths. For the exam, recall that each path requires a path type, such as Prefix or Exact, along with the backend service and port.

  68. Question 565 of 597A security audit of your Kubernetes cluster has revealed that several containers are running with excessive privileges. One specific requirement is to ensure that no process within a container can gain more privileges than its parent process. You are tasked with hardening the Pod specification for a web scraper application to comply with this security policy.

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

    Show answer & explanation

    Correct answer: B. Configure the securityContext of the container to set allowPrivilegeEscalation to false within the container specification.

    Setting allowPrivilegeEscalation to false prevents child processes from gaining more privileges than their parent. Remember that runAsNonRoot only prevents root execution, while privilege escalation controls setuid behavior.

  69. Question 566 of 597A mission-critical 'auth-engine' application uses a Secret named 'api-keys' mounted as a volume at '/etc/keys'. The application is designed to dynamically watch for file changes and reload its configuration without needing a restart. You need to update one of the keys in the Secret. Which behavior should you expect regarding the updates in the Pod and what is the best practice for this scenario?

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

    Show answer & explanation

    Correct answer: C. The mounted files in /etc/keys will be updated eventually by the kubelet, and the application's file watcher will trigger a reload of the new keys.

    When a Secret is mounted as a volume, the kubelet eventually updates the symlinks for the mounted files. Remember that Secrets injected as environment variables are not updated automatically and require a pod restart.

  70. Question 567 of 597A development team has reported that their Java-based microservice, 'order-api', is frequently restarting in the production environment. Upon investigation, you find that the Pod is being terminated with an 'OOMKilled' status. The Deployment currently has a memory limit of 512Mi, but the Java Virtual Machine (JVM) is configured with a maximum heap size (-Xmx) of 512Mi. The cluster has plenty of available memory on its nodes. What is the most appropriate technical resolution to stabilize this microservice while following Kubernetes best practices?

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

    Show answer & explanation

    Correct answer: A. Increase the memory limit in the Deployment to at least 768Mi to account for the JVM's non-heap memory and stack overhead

    Increasing the limit provides room for the JVM heap plus overhead like Metaspace and thread stacks, preventing the OS from killing the process. A Kubernetes OOMKilled error means the container exceeded its limit, not the physical node memory.

  71. Question 568 of 597A microservices application consists of a web frontend in the 'public' namespace and a sensitive database backend in the 'secure-data' namespace. A strict network security policy is required: the database Pods (labeled app=pi-db) must only accept incoming traffic on port 5432 from Pods in the 'public' namespace that are labeled app=frontend. Additionally, all other ingress and egress traffic for the database Pods must be explicitly blocked to prevent data exfiltration. You are tasked with creating a NetworkPolicy that achieves this isolation.

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

    Show answer & explanation

    Correct answer: C. Create a NetworkPolicy in the 'secure-data' namespace with a podSelector for app=pi-db, an ingress rule with a namespaceSelector for 'public' and a podSelector for app=frontend.

    This policy correctly targets the database pods in their own namespace. By defining an ingress rule with both namespaceSelector and podSelector, it restricts access precisely to the authorized frontend pods.

  72. Question 569 of 597In a high-security environment, you have a 'database' Pod running in the 'backend' namespace. You need to implement a NetworkPolicy that restricts traffic so that only Pods with the label 'role: web-server' located in the 'frontend' namespace can access the database on port 5432. Additionally, the database Pod must still be able to perform DNS lookups via the 'kube-dns' service in the 'kube-system' namespace. Which NetworkPolicy configuration achieves this requirement?

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

    Show answer & explanation

    Correct answer: C. An ingress rule with a namespaceSelector for 'frontend' combined with a podSelector for 'role: web-server', and an egress rule to the 'kube-system' namespace on UDP port 53.

    For cross-namespace ingress, you must use both namespaceSelector and podSelector within the same rule. For DNS, you need an egress rule specifically targeting UDP port 53 in the kube-system namespace.

  73. Question 570 of 597A data analysis team uses a Kubernetes CronJob to run a heavy reconciliation script every night at 2:00 AM. Occasionally, the script fails due to transient database connectivity issues. The team needs to keep a history of the last 5 successful runs and the last 2 failed runs for debugging purposes. Furthermore, they want to ensure that if a previous execution is still running when the next one is scheduled, the new execution is skipped to avoid resource contention.

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

    Show answer & explanation

    Correct answer: B. Set 'successfulJobsHistoryLimit: 5', 'failedJobsHistoryLimit: 2', and 'concurrencyPolicy: Forbid' in the CronJob's spec section.

    This configuration precisely meets all requirements: it manages the cleanup of old jobs and prevents concurrent runs. The concurrencyPolicy Forbid specifically skips new runs if an existing one is still active.

  74. Question 571 of 597Your application deployment consists of a main container that requires a specific external configuration database to be reachable before it can start successfully. If the database is not ready, the application crashes immediately. To make the Pod more resilient, you want to ensure the main container only starts once the database service is reachable via a network check. What is the most efficient design to implement this logic?

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

    Show answer & explanation

    Correct answer: A. Define an initContainer in the Pod that executes a 'while' loop checking for network connectivity to the database service

    InitContainers must complete successfully before the main application container starts. A script in an initContainer can effectively block the startup sequence until the external database is completely ready. Avoid using liveness probes for startup dependencies.

  75. Question 572 of 597A security audit has mandated that all containers in the 'processing' namespace must adhere to strict hardening guidelines. Specifically, containers must not be allowed to gain more privileges than their parent process, and they must run as a non-root user with a specific UID of 10001. You are required to configure the Pod manifest for an application named 'data-worker' to comply with these security requirements at both the Pod and container levels.

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

    Show answer & explanation

    Correct answer: C. Define 'allowPrivilegeEscalation: false' and 'runAsUser: 10001' within the securityContext section of the specific container's definition.

    The allowPrivilegeEscalation false setting specifically prevents a process from gaining more privileges than its parent. The runAsUser field enforces that the container process starts with the exact specified non-root UID.

  76. Question 573 of 597Your engineering team is deploying a data-processing workload that consists of 10 identical tasks. Each task needs to know its specific rank or index to determine which partition of a large dataset to process. The team wants to avoid hardcoding individual task IDs into separate Pod manifests and prefers a native Kubernetes solution that automatically assigns a unique, stable index from 0 to 9 to each task in the workload.

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

    Show answer & explanation

    Correct answer: B. Implement a Kubernetes Job with the completionMode set to Indexed and access the JOB_COMPLETION_INDEX environment variable within the container.

    Setting completionMode to Indexed ensures that each Pod is assigned an immutable completion index. This index is automatically injected into the JOB_COMPLETION_INDEX environment variable for reliable programmatic access.

  77. Question 574 of 597You are troubleshooting a complex microservice that occasionally hangs without crashing. To diagnose the issue, you need to run a sidecar container in the same Pod that can inspect the process tree of the main application container and run 'gdb' or 'strace' against the specific process IDs of the application.

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

    Show answer & explanation

    Correct answer: D. Grant the sidecar container the SYS_PTRACE capability and set the shareProcessNamespace field to true in the Pod specification.

    Setting shareProcessNamespace to true allows containers in a Pod to see and interact with each other's processes. Combined with the SYS_PTRACE capability, it enables deep debugging tools like strace against peer containers.

  78. Question 575 of 597You are managing a long-running Kubernetes Job named 'monthly-data-sync' that processes several thousand records. Occasionally, due to external API throttling or network instability, the Job's process hangs indefinitely without failing. This consumes cluster resources and prevents subsequent scheduled tasks from running. You need to ensure that the Job is automatically terminated if it does not finish within 2 hours (7200 seconds). Which Job specification field should you configure?

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

    Show answer & explanation

    Correct answer: D. Configure activeDeadlineSeconds: 7200 in the Job's spec to limit the total duration of the Job execution.

    The activeDeadlineSeconds field limits the total duration of a Job from the moment it starts. Once the deadline is reached, Kubernetes terminates all associated Pods and marks the Job as failed with reason DeadlineExceeded.

  79. Question 576 of 597Your organization is implementing a private container registry that requires authentication for all image pulls. You need to deploy a microservice named 'secure-api' that uses an image from this private registry. You have already created a Secret named 'regcred' of type 'kubernetes.io/dockerconfigjson' in the same namespace. How should you configure the Pod to ensure it can successfully pull the image?

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

    Show answer & explanation

    Correct answer: A. Define the 'imagePullSecrets' field at the Pod specification level and reference the 'regcred' Secret to provide authentication to the Kubelet.

    The imagePullSecrets field in the Pod spec is the standard mechanism to pass registry credentials to the Kubelet. The Kubelet securely handles the image pull operation before the container runtime initializes.

  80. Question 577 of 597A data analytics application writes heavy temporary logs and cache files to the /tmp directory within the container. On several occasions, these files have grown so large that they filled the node's local disk, causing the node to become unstable and evicting other critical pods. You need to limit the amount of local storage a pod can consume.

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

    Show answer & explanation

    Correct answer: C. Update the container's resource limits to include a request and limit for the 'ephemeral-storage' resource type.

    Setting ephemeral-storage limits in the resources section is the standard way to manage local disk usage, ensuring the pod is evicted if it exceeds its quota. While emptyDir sizeLimits exist, they only constrain individual mounted volumes, whereas resource limits apply to the entire pod.

  81. Question 578 of 597Your production environment currently runs a critical 'user-session-manager' Deployment with exactly 20 replicas. To ensure high availability during an upcoming update to version 2.0, the business requirement states that at least 15 replicas must remain available and ready at all times to handle the incoming traffic load. Additionally, the cluster capacity is limited, so no more than 25 total pods (including old and new versions) should exist at any single point during the rollout. You need to configure the rolling update strategy in the Deployment manifest to strictly adhere to these specific constraints.

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

    Show answer & explanation

    Correct answer: A. Set maxSurge to 5 and maxUnavailable to 5 in the rollingUpdate strategy block.

    This is correct because maxSurge 5 allows for 25 total pods, and maxUnavailable 5 ensures that 15 pods are always running, perfectly matching the capacity and availability constraints. Be careful with absolute values versus percentages, as percentages calculate dynamically based on replica counts.

  82. Question 579 of 597You are deploying a web application that depends on a configuration file generated by a complex script. This script requires several specialized tools that are not included in the main application image to keep it slim and secure. You need to ensure the configuration file is created and placed in '/etc/config/app.json' before the main application starts. The main container must have read-only access to this file. Which design approach should you implement?

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

    Show answer & explanation

    Correct answer: A. Use an InitContainer to run the generation script and save the output to an emptyDir volume that is mounted by both the InitContainer and the main container.

    InitContainers run to completion before the main container starts. By sharing an emptyDir volume, the InitContainer can write the file and the main container can consume it securely. Sidecars run concurrently, so they cannot guarantee file creation before the main app starts.

  83. Question 580 of 597A security-sensitive financial application uses a ConfigMap named api-config to store endpoint URLs and non-secret metadata. To prevent unauthorized or accidental changes to the production configuration that could lead to routing errors, the DevOps team requires that once the ConfigMap is created, it cannot be modified by any user or process without deleting and recreating the resource entirely. This is intended to ensure that any change to the configuration results in a predictable rollout. How can this be achieved in Kubernetes?

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

    Show answer & explanation

    Correct answer: C. Set the immutable: true field in the ConfigMap manifest to prevent any further updates to the data field of the resource.

    The immutable field is a built-in feature for ConfigMaps and Secrets. Once set to true, it prevents any modifications to the data, ensuring configuration stability and reducing kubelet load. Mounting a volume as read-only only restricts the container, not the API server.

  84. Question 581 of 597Your company hosts a web platform on Kubernetes. You need to expose two different backend services, 'marketing-site' and 'customer-portal', using a single external IP address. Traffic for 'example.com/marketing' must go to the 'marketing-site' service on port 80, and traffic for 'example.com/portal' must go to the 'customer-portal' service on port 8080. Which Kubernetes resource should be configured?

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

    Show answer & explanation

    Correct answer: A. An Ingress resource with a single host 'example.com' and a list of paths mapping '/marketing' and '/portal' to their respective services and ports.

    Ingress resources operate at Layer 7 and are specifically designed for path-based or host-based routing of HTTP traffic to internal services. Services operate at Layer 4 and cannot inspect URL paths to differentiate traffic between backend deployments.

  85. Question 582 of 597A legacy data-client application is hardcoded to communicate with a database instance at localhost:5432. The development team is migrating this application to a Kubernetes cluster where the PostgreSQL database is hosted as a separate Service named 'postgres-db'. To avoid modifying the legacy application source code to point to the new Service DNS, you decide to implement a multi-container Pod design. Which configuration pattern should you use to satisfy this requirement?

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

    Show answer & explanation

    Correct answer: D. Include an Ambassador container in the Pod that runs a TCP proxy configured to listen on localhost:5432 and forward traffic to the 'postgres-db' Service address.

    The Ambassador pattern acts as a proxy for the main container. By running a proxy on localhost inside the same Pod, the legacy application connects locally while traffic is seamlessly forwarded to the actual Service. Adapters are for standardizing output, not proxying traffic.

  86. Question 583 of 597A specialized custom message broker is being deployed that does not provide an HTTP-based health check endpoint. To be considered healthy, the container must satisfy two conditions: it must be listening for connections on TCP port 9090, and a local heartbeat file created by the application at '/var/run/broker.heartbeat' must exist and be recently updated. If either the port is unreachable or the file is missing, Kubernetes should terminate the Pod and restart it to restore service. You need to implement a livenessProbe that checks both conditions effectively.

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

    Show answer & explanation

    Correct answer: D. Define a livenessProbe using 'exec' that runs a shell command to verify both the file existence and the port status.

    Since a container can only have one livenessProbe, using exec to run a combined shell script is the only way to validate multiple distinct conditions for health. A readiness probe would only pause traffic, whereas the mandate requires failing and restarting the pod.

  87. Question 584 of 597Your application consumes a Secret named 'api-credentials' which is mounted as a volume at /etc/api-keys. The security team performs a manual rotation of the API keys in the Kubernetes Secret. You need to understand how this update will propagate to the running containers and what steps are necessary for the application to utilize the new credentials without a full pod restart.

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

    Show answer & explanation

    Correct answer: B. The Kubelet will eventually update the files in the volume, and the application must be designed to periodically re-read the files from the disk.

    When Secrets are mounted as volumes, the kubelet eventually refreshes the data on disk. Applications must be designed to periodically re-read these files to pick up changes without requiring a process restart. Environment variables are immutable and never update dynamically.

  88. Question 585 of 597The security team has audited the 'payment-processing' namespace and issued a new mandate. All application containers must run with a read-only root filesystem to minimize the attack surface. However, the 'transaction-logger' application requires a writable directory at '/var/log/app' to store temporary execution logs that do not need to persist after the Pod is deleted. How should you configure the Pod manifest to comply with the security mandate while allowing the application to function?

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

    Show answer & explanation

    Correct answer: A. Set readOnlyRootFilesystem: true in the securityContext and mount an emptyDir volume at the /var/log/app mount path.

    Enabling readOnlyRootFilesystem protects the container, and mounting an emptyDir at the specific logging path provides a writable scratch space that is isolated from the root filesystem. Using privileged mode or HostPath directly violates the required security mandates.

  89. Question 586 of 597A legacy enterprise microservice named 'registry-client' is being deployed into a production namespace. The application was designed to manually register its IP address into a legacy external service discovery system whenever it starts up. To automate this process without modifying the existing application code, you decide to use a Kubernetes mechanism that executes a script immediately after the container is created. The script requires the Pod's IP address, which is available via the downward API. How should this be implemented in the Pod specification?

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

    Show answer & explanation

    Correct answer: B. Define a postStart lifecycle hook within the container specification to execute the registration script.

    A postStart hook executes a registration script immediately after container creation without altering the core application code. Init containers run before the primary container starts, so they cannot expose the pod IP.

  90. Question 587 of 597Your company uses a single Ingress controller to manage traffic for multiple internal services. You need to configure an Ingress resource for the 'corporate-portal' application. The requirements are: traffic to 'portal.example.com/finance' should be routed to the 'finance-srv' Service on port 8080, and traffic to 'portal.example.com/hr' should be routed to the 'hr-srv' Service on port 9000. Additionally, you must ensure that only exact path matches or sub-paths are allowed, and SSL termination should use a secret named 'portal-tls'.

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

    Show answer & explanation

    Correct answer: A. Define an Ingress with two rules for the same host, using pathType: Prefix for both /finance and /hr, and specify the 'portal-tls' secret in the tls section.

    The Prefix path type satisfies the requirement to match exact paths or sub-paths by validating the URI prefix. The word exact in the prompt creates slight ambiguity, but Prefix is ultimately the correct technical match.

  91. Question 588 of 597A development team is working in a shared namespace called dev-team-alpha. They are attempting to deploy a new microservice, but the Pod remains in the Pending state. Upon investigation, the kubectl describe pod command reveals a message stating that the request exceeds the current ResourceQuota limits defined for the namespace. The namespace has a quota of 4 CPU cores, and currently, there are 3 Pods running, each requesting 1 CPU core. How should you fix this for the new Pod that requires 1.5 CPU cores? Correct answer

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

    Show answer & explanation

    Correct answer: A. Update the new Pod's manifest to decrease its CPU request to 1 CPU core or less to fit within the remaining quota

    Lowering the CPU request to 1 core or less fits the remaining namespace quota. While deleting the ResourceQuota would also allow scheduling, it violates the implicit organizational constraints and removes cluster guardrails.

  92. Question 589 of 597Your enterprise application, 'legacy-metrics-engine', generates performance data in a proprietary binary format that cannot be directly scraped by the cluster's Prometheus monitoring system. To ensure visibility without modifying the application's source code, you must deploy a solution that transforms these binary metrics into a Prometheus-compatible text format and exposes them on a dedicated port. The transformation process is computationally intensive but only required for external monitoring purposes. Which architectural pattern should you implement to meet these requirements efficiently while keeping the main container unchanged?

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

    Show answer & explanation

    Correct answer: C. Deploy an Adapter container within the same Pod to read the binary metrics and expose them in the required Prometheus format

    The Adapter pattern standardizes or simplifies the application output for external systems, fitting perfectly for translating metrics. The Sidecar and Ambassador patterns manage inbound traffic or logs, failing to address the required transformation.

  93. Question 590 of 597A legacy web application, 'customer-portal', is being migrated to Kubernetes. The application takes 3 minutes to perform a self-check and load its internal cache from an external database. During this time, the application is running but cannot handle any HTTP requests. If the application receives traffic before the cache is loaded, it crashes and must be restarted. Which health check configuration is essential to ensure that the Ingress controller does not send traffic to the Pod until it is fully ready to process requests?

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

    Show answer & explanation

    Correct answer: A. Configure a ReadinessProbe with a 'periodSeconds' of 10 and a check that only succeeds after the cache loading process is complete

    A readiness probe removes the pod from service endpoints until the cache finishes loading, preventing premature traffic. A liveness probe would only prevent restarts, leaving the unresponsive pod exposed to user requests.

  94. Question 591 of 597Your organization is deploying a microservice that requires a specific API key to communicate with a third-party billing provider. This key is stored in a Kubernetes Secret named 'provider-credentials' along with fifty other sensitive keys used by different teams. To follow the principle of least privilege and minimize resource consumption in the environment variables of the container, you must inject only the key named 'BILLING_AUTH_TOKEN' from the Secret into an environment variable called 'SERVICE_TOKEN'. Which configuration fragment achieves this?

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

    Show answer & explanation

    Correct answer: A. Define an environment variable in the Pod spec using valueFrom with the secretKeyRef property specifying the key.

    Using secretKeyRef inside valueFrom exposes only the specific key needed to the container environment. Using envFrom would mount all fifty keys, violating the required principle of least privilege.

  95. Question 592 of 597A data processing Pod named 'heavy-worker' is stuck in a 'Pending' state. Upon investigation, you find that the target nodes for this workload have been tainted with 'dedicated=high-mem:NoSchedule' to reserve them for specific memory-intensive tasks. The 'heavy-worker' Pod is indeed memory-intensive and should be allowed to run on these nodes. What is the most appropriate action to resolve this scheduling issue?

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

    Show answer & explanation

    Correct answer: C. Update the Pod specification to include a toleration that matches the key, value, and effect of the taint on the high-memory nodes.

    Adding a toleration matching the node taint allows the scheduler to place the memory-intensive pod on the reserved hardware. Using a nodeSelector or node affinity does not override a NoSchedule taint.

  96. Question 593 of 597Your cluster administrator has enabled the Pod Security Admission controller to enforce strict security standards. You are attempting to deploy a network monitoring tool into the 'restricted-workloads' namespace, which is labeled with 'pod-security.kubernetes.io/enforce: restricted'. Your current Deployment manifest includes a container that requests the 'NET_ADMIN' capability to capture packets. Upon applying the manifest, the API server rejects the request with a validation error citing violations of the restricted profile. You must modify the manifest to align with the required security level while maintaining as much functionality as possible.

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

    Show answer & explanation

    Correct answer: C. Remove the NET_ADMIN capability and ensure 'allowPrivilegeEscalation' is set to false in the securityContext.

    The restricted profile strictly blocks adding Linux capabilities like NET_ADMIN and requires privilege escalation to be disabled. Changing namespace labels to privileged undermines cluster security and violates baseline governance rules.

  97. Question 594 of 597A stateful database cluster is managed using a StatefulSet named 'db-store' with 3 replicas. Each Pod in the StatefulSet is associated with a PersistentVolumeClaim (PVC) through a volumeClaimTemplate. Due to a change in demand, you are instructed to scale the StatefulSet down to 1 replica. You need to understand the behavior of the associated PersistentVolumeClaims and the data they contain during and after this scaling operation to ensure no data is unexpectedly lost.

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

    Show answer & explanation

    Correct answer: A. The PVCs for replicas 1 and 2 are retained in the cluster, preserving the data; they must be manually deleted if the storage is no longer required.

    PersistentVolumeClaims created by a StatefulSet are not automatically deleted when scaled down. This retains data for potential scale-up operations, meaning admins must manually clean up unused volumes.

  98. Question 595 of 597A data-processing application named log-analyzer requires a specific directory structure and a configuration file to be dynamically generated on the local node's file system before the main container starts. The generation script is a complex shell command that needs to run in the exact same environment as the application but should not be part of the main container's long-running process. The application will fail immediately if the file is missing at startup. What is the most efficient way to ensure this setup is completed successfully?

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

    Show answer & explanation

    Correct answer: A. Configure an InitContainer in the Pod manifest to run the generation script and share the directory via an emptyDir volume.

    Init containers run to completion before the main application starts, using shared volumes to pass generated files. A postStart hook executes concurrently with the main container, risking a race condition where the app starts before setup finishes.

  99. Question 596 of 597Your organization is hosting a multi-tenant platform where a single Ingress controller handles traffic for various departments. You need to configure the Ingress resource so that requests to 'api.company.com/v1/orders' are routed to the 'orders-service' on port 8080, while requests to 'api.company.com/v1/billing' are directed to the 'billing-service' on port 9000. Both services reside in the same namespace. Which Ingress configuration structure is required to implement this path-based routing correctly?

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

    Show answer & explanation

    Correct answer: A. Define a single Ingress resource with a 'rules' section for the host 'api.company.com' containing multiple paths under the 'http' attribute

    A single Ingress resource uses a rules section with multiple http paths to route traffic based on the URL. Creating multiple Ingress resources for the same host is unnecessary and complicates path management.

  100. Question 597 of 597You are managing an Ingress resource that routes traffic to several microservices. You have a legacy service named 'v1-service' mapped to the path '/api' and a new service named 'v2-service' mapped to '/api/v2'. During testing, you notice that requests intended for '/api/v2' are being handled by 'v1-service' because of how the Ingress controller evaluates path matching rules. How should you resolve this?

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

    Show answer & explanation

    Correct answer: C. Modify the Ingress resource to use pathType: Exact for both paths and ensure the more specific path is listed first in the rules.

    Using pathType Exact forces exact string matching, preventing broader prefix paths from catching specific routes. The Prefix path type can also work if configured correctly, making the provided options slightly ambiguous.

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