CKAD · domain
scenario questions
Practise Certified Kubernetes Application Developer CKAD scenario questions practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.
Focused practice
Practice scenario questions questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about scenario questions
scenario questions questions test whether you can apply the concept in context, not just recognise a definition.
How the topic appears in realistic exam-style scenarios.
Which detail in the question changes the correct answer.
How to eliminate plausible but wrong options.
How to connect the question back to the wider exam objective.
Watch out for
Common scenario questions exam traps
- ▸Answering from memory before reading the full scenario.
- ▸Missing a constraint such as cost, availability, security, scope or command context.
- ▸Choosing a broad answer when the question asks for the most specific fix.
- ▸Ignoring why the wrong options are tempting.
Question index
All scenario questions questions (826)
Click any question to see the full explanation, or start a practice session above.
Which command creates a ConfigMap named 'app-config' from a file named 'config.properties'?
Easy2A developer creates a Deployment with 3 replicas that uses a ConfigMap mounted as a volume. After updating the ConfigMap, the developer expects the pods to pick up the new configuration immediately, but the old configuration is still in use. What is the most likely reason?
Medium3Which TWO of the following are valid fields in a Job spec? (Select TWO.)
Medium4A security requirement states: 'The container must drop all capabilities and add only NET_BIND_SERVICE'. Which YAML snippet correctly implements this in the securityContext?
Hard5Refer to the exhibit. A pod named 'app-backend-6b4c9d8f7-2x4z5' is in CrashLoopBackOff state. What is the MOST likely cause of this issue?
Easy6A developer deploys a Pod that reads configuration from a ConfigMap named 'app-config' using a volume mount at /etc/config. Later, the ConfigMap is updated with new values. The application running in the Pod is designed to re-read the file periodically but continues to see the old values. What is the most likely reason the application is not seeing the updated configuration?
Medium7You have a Deployment with 'replicas: 3' and the HPA is configured with 'targetCPUUtilizationPercentage: 80'. The current CPU usage is at 60% across all pods, but the HPA has scaled up to 5 replicas. What is the most likely reason?
Medium8A container needs to run with the NET_ADMIN capability. Which securityContext field should be used?
Medium9A developer runs `kubectl expose deployment web-deploy --port=80 --target-port=8080 --type=NodePort` and later wants to access the Service from outside the cluster. What is the correct way to find the external port?
Medium10Which command scales a Deployment named 'web' to 5 replicas?
Easy11You create a ServiceAccount 'my-sa' with automountServiceAccountToken: false. A pod that references this ServiceAccount also sets automountServiceAccountToken: true in its spec. Will the service account token be mounted?
Hard12A pod is running with the following SecurityContext: securityContext: runAsUser: 1000 runAsGroup: 2000 fsGroup: 3000 What UID and GID does the process inside the container use?
Medium13Match each Kubernetes probe to its check behavior.
Medium14A pod is stuck in 'Pending' state. You run 'kubectl describe pod my-pod' and see the event: '0/3 nodes are available: 3 Insufficient cpu.' Which action should you take?
Medium15A pod uses a ServiceAccount 'my-sa' with a RoleBinding that grants get and list on pods. The pod makes an API call to list pods in its own namespace. Which RBAC resource is necessary?
Medium16A pod's container needs to run as non-root user with UID 1000 and ensure its filesystem is read-only. Which SecurityContext settings achieve this?
Medium17A pod is running but not responding to traffic. You suspect the application inside the container is unhealthy but the pod is still marked as 'Running'. Which probe should be configured to remove the pod from the service's endpoints automatically?
Easy18A team uses a Service named 'backend' in namespace 'prod' to reach Pods in namespace 'staging'. The Service in 'prod' has no endpoints. What is the most likely cause?
Hard19A developer needs to create a Kubernetes Secret for Docker registry authentication. The registry URL is 'myregistry.io', username 'user', password 'pass', email 'user@example.com'. Which command creates this Secret?
Easy20A DevOps engineer needs to set up resource monitoring for pods in a namespace. Which built-in Kubernetes resource provides CPU and memory metrics out-of-the-box?
Easy21Which command creates an Opaque Secret named 'my-secret' with key 'password' and value 'p@ssw0rd'?
Easy22Given the following NetworkPolicy YAML: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress - Egress What is the effect of this policy?
Hard23A team wants a Pod to expose two containers: a web server container listening on port 8080 and a metrics exporter container listening on port 9100. The Pod manifest must give each container its own containerPort so that monitoring tools can discover them. Which YAML snippet correctly declares both container ports in a single Pod?
Easy24Which annotation is used to enforce Pod Security Admission at the 'restricted' level on a namespace?
Medium25You are performing a rolling update of a Deployment. You set maxSurge=2 and maxUnavailable=1. The Deployment has 5 replicas. During the update, how many pods can be running simultaneously?
Medium26Which two statements about ConfigMaps and Secrets are correct? (Select TWO.)
Medium27A Pod is in 'CrashLoopBackOff' state. 'kubectl logs mypod' shows: 'Error: listen tcp :8080: bind: address already in use'. What is the most likely cause?
Medium28When using 'kubectl expose', which flag creates a NodePort service?
Medium29Which THREE of the following are true about the 'kubectl describe pod' output? (Select 3)
Hard30Which TWO of the following are valid Ingress path types? (Select 2)
Easy31You have a Deployment with the following strategy: type: Recreate. What happens when you update the pod template?
Easy32An administrator needs to create a ConfigMap named 'app-config' from a file called 'config.properties'. Which kubectl command accomplishes this?
Medium33Which command exposes a deployment named 'web' as a ClusterIP service on port 80?
Easy34A developer wants to ensure that a container runs as a non-root user and the filesystem is read-only except for a tmpfs volume. Which fields should be set in the container's securityContext?
Medium35What is the purpose of a readiness probe?
Easy36A developer wants to expose a set of Pods on a specific port on each node's IP. Which Service type should be used?
Easy37You are using Kustomize with a base and an overlay. The base sets a Deployment's replicas to 3. The overlay sets replicas to 5 using a patch. What is the final replica count after running 'kubectl apply -k overlay/'?
Hard38A pod has a container with 'readOnlyRootFilesystem: true' in its securityContext. The container writes to /tmp. What is the expected outcome?
Medium39Which Kubernetes API version is used for creating a CronJob?
Easy40Which of the following are valid concurrencyPolicy values for a CronJob? (Select all that apply.)
Medium41Which Helm command installs a chart from a repository?
Easy42You want to block all ingress traffic to pods labeled 'app=api' except from pods labeled 'app=frontend'. Which NetworkPolicy rule is correct?
Medium43You want to debug a pod that is failing to start. The pod does not have a shell installed. Which command can you use to attach an ephemeral debug container to the running (or failed) pod?
Hard44You run 'kubectl run debug-pod --image=busybox -it --restart=Never -- sh' but the pod starts and immediately exits. You want to keep the container running to execute commands later. What flag should you add?
Medium45Which TWO are valid ways to debug a pod using ephemeral containers?
Easy46Which THREE of the following are correct statements about the terminationGracePeriodSeconds field? (Select 3)
Medium47A PodSecurityPolicy (PSP) has been replaced by Pod Security Admission. Which of the following commands applies a baseline pod security standard to the namespace 'dev'?
Medium48What is the effect of setting 'readOnlyRootFilesystem: true' in a container's securityContext?
Easy49You deploy a pod with the following specification: apiVersion: v1 kind: Pod metadata: name: probe-pod spec: containers: - name: app image: nginx livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 periodSeconds: 10 failureThreshold: 3 The application listens on port 80, not 8080. What will happen to the pod?
Hard50You have installed a Helm chart for 'wordpress' using 'helm install my-wordpress bitnami/wordpress'. Later, you want to check the status of the release. Which command lists the status of all releases?
Medium51You have a pod 'app-pod' that keeps restarting. You want to see the logs from the previous (crashed) container instance. Which command should you use?
Easy52A pod named 'web-app' is experiencing high CPU usage. You want to investigate which process inside the container is consuming the most CPU. Which command should you run?
Medium53A user runs 'kubectl run nginx --image=nginx --restart=Never' and the pod goes into 'Pending' state. What is a likely reason?
Medium54Which TWO practices optimize Docker image size? (Select 2)
Medium55You have a CronJob that runs every 5 minutes. The previous job is still running when the next scheduled time arrives. You want the new job to be skipped if the previous one is still running. Which concurrencyPolicy should you set?
Hard56Which kubectl command can you use to pause a rolling update of a Deployment?
Medium57A developer wants to perform a canary deployment where 10% of traffic goes to a new version (v2) of an application. They create two Deployments (app-v1 and app-v2) and a Service. The Service selector is configured to match labels: 'app: myapp, version: v1'. How can they route 10% of traffic to v2 with minimal changes?
Hard58Which TWO of the following are valid approaches to debug a pod that is in a CrashLoopBackOff state? (Select 2)
Hard59You create a Service with `kubectl expose deployment web --port=80 --target-port=8080`. What type of Service is created by default?
Easy60A deployment 'web-app' is running with 3 replicas. Users report that the application is slow. The team suspects a memory leak. Which command provides the most immediate insight into the memory usage of the pods?
Easy61A pod needs to run as a non-root user with UID 1000. Which SecurityContext field should be set?
Easy62A developer is writing a multi-stage Dockerfile for a Go application. The builder stage compiles the binary, and the final stage uses a minimal base image. The developer wants the final image to contain only the compiled binary and CA certificates, and wants to copy the binary from the builder stage. Which Dockerfile instruction correctly copies the compiled binary from the builder stage into the final stage?
Hard63Which kubectl command creates a ConfigMap named 'app-config' from a file called 'config.properties'?
Easy64A pod is running with the default service account. An administrator wants to prevent the pod from automatically mounting the service account token. Which field in the pod spec accomplishes this?
Easy65A company wants to deploy a stateful database on Kubernetes. The database requires stable network identities and persistent storage per pod. Which resource should be used?
Medium66You have a Deployment with replicas: 5 and update strategy type: RollingUpdate with maxSurge: 25% and maxUnavailable: 25%. During a rolling update, what is the maximum number of pods that can be unavailable at any given time?
Medium67Which THREE of the following are valid parameters for configuring probes? (Select 3)
Medium68Which THREE of the following are best practices for configuring readiness probes?
Hard69Which of the following is a correct Kustomize kustomization.yaml configuration for setting an image tag to 'v2'?
Hard70You have a NetworkPolicy named 'deny-all' in namespace 'secure' that selects all pods and has no ingress rules. You need to allow incoming traffic to pods with label 'app: db' on port 5432 from pods with label 'app: api' in the same namespace. Which NetworkPolicy should you create?
Hard71You need to create a TLS secret for an ingress with certificate and key. Which command correctly creates the secret?
Hard72Which TWO of the following are correct methods to implement a canary deployment using Kubernetes resources?
Hard73Which TWO of the following conditions must be met for a RollingUpdate to proceed?
Hard74A team is deploying a multi-container pod with a main application container and a sidecar container for logging. Which THREE statements about pod design are correct?
Medium75Which probe type is used to indicate that a container is ready to serve traffic and should be added to Service endpoints?
Easy76Which THREE of the following are valid fields in a PodSecurityPolicy (PSP) that control Linux capabilities? (Select exactly 3)
Medium77A NetworkPolicy named 'default-deny-ingress' is applied to a namespace but contains no rules. What is the effect on pods in that namespace?
Medium78Which of the following Dockerfile instructions is used to set a command that runs when the container starts and can be overridden by command-line arguments?
Easy79A DevOps engineer wants to deploy a logging sidecar container that reads log files from the main application container. Which volume type should be used to share files between the two containers?
Medium80A Pod is configured with securityContext: { runAsUser: 1000, runAsGroup: 2000, fsGroup: 3000 }. The container's image runs a process that must listen on a TCP port below 1024 (e.g., port 80). The process is currently failing to start. What should you modify to allow the process to bind to a privileged port?
Hard81Which command is used to rollback a Deployment to the previous revision?
Easy82What is the purpose of a ResourceQuota in Kubernetes?
Easy83During a rolling update, you want to ensure that at most 2 pods are unavailable at any time. Which field should you set in the Deployment spec?
Easy84You need to grant a ServiceAccount 'my-sa' read-only access to pods in the 'test' namespace. Which RBAC YAML should you create?
Medium85A pod named 'test-pod' in namespace 'test' has a service account 'my-sa' attached. The service account has a RoleBinding to a Role that allows get/list pods. However, the pod cannot list pods. What is the most likely issue?
Medium86A developer needs to create a Secret named 'db-credentials' in the 'staging' namespace using the literal values username=admin and password=S3cr3t!. Which kubectl command will accomplish this?
Easy87A developer wants to deploy a stateless application as a set of identical pods. They need the pods to be distributed across nodes and have stable network identities. Which resource should they use?
Easy88A developer needs to view the logs of a pod named 'web-app-84b7f6f5b6-abcde' that crashed and has been restarted. Which kubectl command should they use to see the logs from the previous (crashed) instance?
Easy89Which command outputs the pod's full YAML specification including status?
Medium90A developer needs to expose a deployment named 'web-app' running on port 8080 to external traffic. The cluster is on-premises with no cloud load balancer. Which service type should be used?
Medium91You have an Ingress that should route requests to 'api.example.com' to a service named 'api-svc' on port 80, and requests to 'www.example.com' to 'web-svc' on port 80. Which host-based routing rule is correct?
Medium92A StatefulSet named 'web' is created with 3 replicas. What is the DNS name for the second pod (index 1)?
Medium93You want to enforce a Pod Security Standard of 'restricted' in a namespace. Which command applies the correct label?
Hard94A CronJob is configured with 'concurrencyPolicy: Forbid'. If a job from the previous schedule is still running when the next scheduled time arrives, what happens?
Hard95You want to restrict total memory usage in a namespace to 10 Gi. Which resource should you create?
Medium96An Ingress has two rules: - host: app.example.com, path: /api -> service-a:80 - host: api.example.com, path: / -> service-b:80 A request to `app.example.com/api/v1` reaches which service?
Hard97Which THREE of the following are valid fields in a CronJob specification?
Hard98Which TWO statements about init containers are true?
Medium99You are asked to ensure that a pod with a slow-starting container (requires 60 seconds to initialize) is not prematurely restarted by the liveness probe. The liveness probe should start only after the container is fully initialized. Which probe type should you add to the pod spec?
Hard100A developer runs 'kubectl run mypod --image=nginx --restart=Never' and the pod is created. However, when the container exits, the pod terminates. Which restart policy ensures the pod does NOT restart after completion?
Medium101You create a Service with the following YAML: ``` apiVersion: v1 kind: Service metadata: name: my-service spec: ports: - name: http port: 80 targetPort: 8080 selector: app: my-app ``` What is the default Service type?
Medium102A developer is creating a Deployment with 4 replicas. The application requires a rolling update with zero downtime. Which TWO strategies ensure zero downtime during an update?
Easy103A Deployment is configured with strategy type 'Recreate'. What happens during an update to the pod template?
Medium104You need to perform a rolling update of a Deployment named 'web-app' with a new image version. Which command should you use?
Easy105An admin wants to expose a Service only for internal cluster communication, without external access. Which Service type should they use?
Medium106You need to run a one-time batch job that processes 10 work items in parallel, with a maximum of 3 pods running at the same time. Which Job YAML fields should you set?
Medium107You want to ensure your containerized application handles SIGTERM gracefully and shuts down within 30 seconds. Which field should you set in the Pod spec?
Medium108You have a Helm release named 'my-app' that you want to revert to revision 3. Which command accomplishes this?
Medium109An admin creates a Service without a selector. Which of the following is true about such a Service?
Hard110You want to create a Deployment that runs 5 replicas of a web application. Which kubectl command should you use?
Medium111Which THREE statements about NetworkPolicy are correct? (Select 3)
Hard112What is the default Service type when creating a Service via 'kubectl create service' or YAML without specifying type?
Easy113You have a multi-stage Docker build. The first stage compiles a binary, and the second stage copies the binary from the first stage. What is the correct COPY syntax to copy a file named 'app' from the first stage named 'builder'?
Hard114You have a Deployment running a web application that takes 60 seconds to start up. You need to configure probes so that Kubernetes waits for the application to fully start before checking its health and directing traffic to it. Which combination of probes should you use?
Medium115You have a Deployment named 'frontend' with 4 replicas. You want to perform a rolling update with the following constraints: the number of pods above the desired count should never exceed 1, and the number of unavailable pods should never exceed 0. Which deployment strategy configuration achieves this?
Medium116A developer wants to run a container as a non-root user and prevent it from gaining additional privileges. The container image runs as root by default. Which securityContext configuration should be applied to the container to achieve this?
Hard117During a rolling update of a Deployment with 10 replicas, you set maxSurge to 3 and maxUnavailable to 2. What is the maximum number of pods that can be unavailable during the update?
Medium118A team is deploying a microservice that requires initialization of a database schema before the main application starts. The init container must run a script that writes to a shared volume. Which configuration correctly ensures the init container completes before the main container runs?
Hard119A HorizontalPodAutoscaler (HPA) is configured to scale a Deployment based on CPU utilization. The target CPU utilization percentage is set to 80%. The current CPU utilization is 90%. What will the HPA do?
Medium120A CronJob is configured with concurrencyPolicy: Forbid and schedule: '*/5 * * * *'. The first job takes 7 minutes. What happens when the next scheduled time arrives?
Hard121Which THREE of the following are valid parameters for a probe?
Medium122A Service uses a selector to target Pods. After updating the Pod labels, you notice the endpoints list is empty. What is the most likely reason?
Easy123A cluster administrator wants to enforce that no pod in namespace 'prod' uses more than 4Gi of memory. Which Kubernetes resource should be created?
Hard124Which TWO of the following are valid types of probes in Kubernetes? (Select 2)
Medium125You run 'kubectl port-forward pod/my-pod 8080:80'. What does this command do?
Medium126Which THREE of the following are valid fields in a Pod's container spec for resource management? (Choose three.)
Medium127A pod has an init container that fails. The status shows 'Init:CrashLoopBackOff'. The pod's restartPolicy is 'Always'. What happens to the init container?
Hard128Which THREE of the following are benefits of using a ResourceQuota in a namespace? (Select THREE)
Medium129Which TWO statements about readiness probes are correct? (Choose two.)
Medium130You have a Service named 'web' in namespace 'default'. Which DNS name resolves to the Service's ClusterIP?
Medium131You need to temporarily access a pod's HTTP endpoint on port 8080 from your local machine. Which command should you use?
Medium132When using 'kubectl apply' vs 'kubectl create', which statement is correct?
Medium133Which kubectl command is used to view the rollout history of a Deployment?
Easy134Which field in the container spec controls the time Kubernetes waits after sending SIGTERM before sending SIGKILL during pod shutdown?
Medium135You have a Deployment named 'web-app' with 5 replicas. You want to perform a rolling update with a maximum of 2 extra pods during the update and allow at most 1 pod to be unavailable. Which YAML snippet correctly configures the rolling update strategy?
Medium136A CKAD candidate must make a container's exit code observable after a crash so that a monitoring agent reading pod status can distinguish an application error from an out-of-memory kill. The container has terminated and restarted several times. Which command shows the exit code and termination reason of the most recent terminated instance of the container?
Medium137A StatefulSet is deployed with a headless service (clusterIP: None). The pods are named 'web-0', 'web-1', 'web-2'. What DNS name resolves to the specific IP of 'web-1'?
Hard138You have a headless service 'db' in namespace 'data'. Pods in that namespace can resolve 'db.data.svc.cluster.local'. What is the effect of a headless service on DNS resolution?
Medium139A pod has a readiness probe using tcpSocket on port 3306. The application listens on port 3306 but returns errors on database queries. What is the effect of the readiness probe?
Hard140A developer deploys a set of Pods labeled app=frontend and wants to expose them internally within the cluster on a stable IP. Which resource should be used?
Medium141You have a Dockerfile with a multi-stage build. The first stage is named 'builder' and uses 'golang:1.20' to compile a binary. The second stage uses 'alpine:3.18' and should copy the binary from the first stage. Which COPY instruction is correct?
Medium142Which TWO of the following are valid reasons for using a startup probe?
Hard143A Service named `api` in namespace `default` has multiple endpoints. You run `kubectl get endpoints api` and see no IPs. What is the most likely cause?
Medium144A container image requires running as UID 0 but you need to comply with a 'restricted' Pod Security Admission policy. Which SecurityContext setting allows this while still passing the policy?
Hard145A developer wants to inject database credentials into a pod as environment variables. The credentials are stored in a Kubernetes Secret named 'db-creds' with keys 'username' and 'password'. Which pod spec snippet correctly injects both values as environment variables?
Easy146A developer creates a Secret named 'db-secret' with key 'password'. They want to expose the password as an environment variable DB_PASSWORD in a Pod. Which of the following is the correct way to achieve this?
Easy147A pod is in CrashLoopBackOff state. You need to view the last few lines of its logs to understand why it is crashing. Which command is most appropriate?
Easy148A ClusterIP service named 'db-service' in namespace 'data' is not reachable from a pod in the same namespace. The pod's /etc/resolv.conf shows 'search data.svc.cluster.local svc.cluster.local cluster.local'. Using the pod, which command tests DNS resolution for the service?
Medium149Which of the following is a valid NetworkPolicy that allows ingress traffic only from pods with label 'role: frontend' in any namespace?
Hard150You have a Deployment named 'web-app' with 5 replicas. You run 'kubectl set image deployment/web-app app=nginx:1.21'. What is the effect of this command?
Medium151A developer wants to debug a running container in a Pod named 'web-app' in namespace 'dev'. Which command attaches an ephemeral container with the 'nicolaka/netshoot' image for network debugging?
Medium152You need to expose a Deployment named 'web' on port 80 internally within the cluster. Which command creates the appropriate Service?
Medium153What is the purpose of the 'kubectl rollout status' command?
Easy154Which of the following are valid kubectl commands for managing rollouts? (Select all that apply)
Hard155You are a platform engineer managing a production Kubernetes cluster. A team deploys a stateful application called 'inventory-service' with 3 replicas using a StatefulSet. Each pod writes logs to a persistent volume via a PersistentVolumeClaim. Recently, the team reports that the application becomes unresponsive after running for a few hours. You notice that the pods are still running (READY 1/1) but the application does not respond to HTTP requests. You exec into one pod and find that the disk is 100% full. The PVC is backed by a cloud disk (e.g., AWS EBS). You check the pod's resource limits and see that memory and CPU are not exhausted. The container logs are not rotated. Which course of action should you take to resolve the immediate issue and prevent recurrence?
Hard156A pod named 'web-app' is running but has no environment variables. The developer wants to inject a variable 'DB_URL=postgres://db:5432' from a ConfigMap named 'db-config'. Which pod spec snippet correctly achieves this?
Easy157Which THREE statements correctly describe Kustomize? (Select THREE.)
Hard158Which THREE of the following are valid use cases for a Headless Service (clusterIP: None)?
Hard159A pod is running but the application inside is not serving traffic. The team runs 'kubectl exec -it <pod> -- curl localhost:8080' and gets 'Connection refused'. What is the most likely cause?
Hard160A multi-stage build has two stages named 'builder' and 'final'. Which instruction copies artifacts from the builder stage to the final stage?
Hard161You run 'kubectl get pods -o wide' and see that a pod's NODE column shows 'node-1'. You want to see more details about that node's resource usage. Which command should you use?
Medium162A developer creates a Role and RoleBinding in the namespace 'development' to grant list pods permission to a service account. Which manifest snippet correctly defines the Role?
Medium163A pod is stuck in 'Pending' state. You run 'kubectl describe pod mypod' and see the event: '0/4 nodes are available: 4 Insufficient memory'. Which action will resolve the issue?
Medium164A Pod is running in a namespace with a default LimitRange that sets a default CPU request of 100m and a default CPU limit of 200m. The Pod's container spec does not specify any CPU requests or limits. What will be the effective CPU request and limit for the container?
Medium165Arrange the steps to create a Kubernetes Deployment with a rolling update strategy.
Medium166Which THREE of the following are valid fields for configuring a probe in Kubernetes? (Select 3)
Hard167A pod with a startup probe configured is taking longer than usual to start. The startup probe has 'failureThreshold: 10' and 'periodSeconds: 5'. What is the maximum time the pod has to start before it is restarted?
Medium168A pod's securityContext has 'allowPrivilegeEscalation: false' and 'capabilities: { drop: ["ALL"] }'. Which statement is true?
Medium169A developer needs to expose database credentials to a Pod as environment variables. The credentials are stored in a Kubernetes Secret named 'db-secret' with keys 'username' and 'password'. Which two methods correctly inject these values? (Choose two.)
Medium170Which TWO commands can be used to create a Secret from a file? (Select 2)
Easy171Which command attaches an ephemeral container to a running pod for debugging?
Medium172An administrator wants to enforce that all Pods in a namespace run with a read-only root filesystem. Which admission controller should be configured?
Medium173Which command creates a Secret named 'db-secret' with two keys, 'username' and 'password', from literal values?
Easy174Which THREE of the following are valid reasons to use a startup probe? (Select THREE.)
Hard175A developer creates a ServiceAccount 'my-sa' in namespace 'default'. They want to prevent pods from automatically mounting the ServiceAccount token. Which field should be set to false in the pod spec?
Medium176An Ingress resource is created with the following YAML: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-ingress spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-svc port: number: 80 Which of the following requests will be routed to the api-svc Service? (Select all that apply.)
Medium177Which API version is correct for a Deployment in Kubernetes v1.29?
Easy178A Job must run 10 times in total, with up to 3 pods running simultaneously. Which fields should be set?
Medium179A pod uses a Secret 'db-secret' with keys 'username' and 'password'. Which environment variable definition correctly exposes the 'password' as an env var named 'DB_PASSWORD'?
Medium180Which of the following correctly describes the purpose of a PodSecurityPolicy (PSP) in Kubernetes? (Note: PSP is deprecated in v1.21+ and removed in v1.25; Pod Security Admission is the replacement.)
Easy181A pod is configured with 'securityContext.seccompProfile.type: RuntimeDefault' but the container still attempts to use a syscall that is blocked by the default seccomp profile. What happens?
Hard182You want to update a Deployment's image from nginx:1.20 to nginx:1.21. Which command will perform a rolling update?
Medium183You run 'kubectl get events' and see an event 'FailedScheduling' for a pod. What is the most common cause?
Medium184Which kubectl command creates a ConfigMap named 'app-config' from a file named 'config.properties'?
Easy185Which THREE commands can be used to get detailed information about a pod named 'my-pod'? (Choose three.)
Hard186A developer wants to create a ConfigMap named 'app-config' with two key-value pairs: 'color=blue' and 'size=large'. Which kubectl command should they use?
Medium187Order the steps to perform a rolling rollback of a Deployment to a previous revision.
Medium188Which kubectl command correctly creates a ConfigMap from a file named 'app.properties'?
Easy189You have created a ServiceAccount named 'my-sa' in namespace 'default'. You want a Pod to use this ServiceAccount. Which Pod spec field is correct?
Medium190A Deployment has been updated with a new image. After running 'kubectl rollout status deployment/myapp', you see that the rollout has stalled. You want to undo the rollout to the previous revision. What command do you run?
Medium191You have a multi-stage Dockerfile with two stages: 'builder' and 'runtime'. You want to copy artifacts from the builder stage to the runtime stage. Which Dockerfile instruction achieves this?
Hard192Which service type is used to expose a service using an external DNS name, such as a database hosted outside Kubernetes?
Easy193Which field in a Pod spec specifies which ServiceAccount the pod should use?
Easy194You are performing a blue-green deployment. You have two Deployments: 'app-blue' and 'app-green', each with 5 replicas. Both are labeled with 'app: myapp'. The Service 'myapp-svc' selects pods with 'app: myapp' and 'version: blue'. After deploying the new version to 'app-green' and verifying it, what change is required to switch traffic to the green deployment?
Medium195A developer created a Role named 'pod-reader' in namespace 'ns1' that allows 'get', 'list', and 'watch' on pods. They created a RoleBinding binding this Role to a ServiceAccount 'sa1' in the same namespace. However, a pod using 'sa1' cannot list pods in namespace 'ns2'. What is the most likely cause?
Medium196A Pod in namespace 'team-a' runs with a serviceAccountName of 'reporter'. The Pod must read a Secret named 'metrics-token' that lives in namespace 'team-b'. Cluster-wide RBAC and the ServiceAccount token are already configured correctly. Which Pod specification change allows the container to obtain the Secret's data?
Hard197Your Deployment is stuck during rollout, and you want to investigate. Which command pauses the rollout and allows you to check the current state?
Hard198You have a YAML file 'deploy.yaml' that defines a Deployment. Which command creates the Deployment if it does not exist, or updates it if it already exists?
Easy199You have a Secret of type 'kubernetes.io/tls' named 'tls-secret'. What keys are required in the Secret data?
Medium200A developer wants to ensure that a pod runs with a non-root user and cannot gain root privileges. Which SecurityContext settings should be used?
Medium201You need to collect metrics from an application running in a pod. The application exposes metrics on port 8080 at /metrics in Prometheus format. Which resource should you configure to allow Prometheus to scrape these metrics?
Medium202Which kubectl command creates a ConfigMap named 'app-config' with key 'color' and value 'blue'?
Easy203You have a Deployment that uses an httpGet liveness probe on port 8080 with path /healthz. The probe fails after the container starts, but you can successfully curl http://localhost:8080/healthz from within the container. What is the most likely cause?
Hard204Which TWO statements about Ingress are correct? (Select 2)
Medium205An Ingress resource routes traffic to a Service 'web' on port 80. The Service has multiple endpoints but all return 503. What should be checked first?
Hard206You want to apply a Pod Security Admission (PSA) policy that enforces the 'restricted' profile in the 'dev' namespace, but only for Pods that are not exempt. Which TWO steps are required? (Select TWO)
Hard207You are designing a Pod that must run a diagnostic tool to collect network logs before the main application starts. The diagnostic tool should run to completion, then the main application starts. Which approach should you use?
Hard208What annotation is required on an Ingress resource to use a specific IngressClass (e.g., 'nginx')?
Easy209A pod named 'app' is stuck in 'Pending' state. You run 'kubectl describe pod app' and see the event: '0/3 nodes are available: 3 Insufficient cpu'. What is the most likely cause?
Medium210A ClusterRole named 'secret-reader' grants get, list, watch on secrets in all namespaces. A RoleBinding in namespace 'app' binds this ClusterRole to a ServiceAccount 'app-sa'. Which of the following is true about the effective permissions of 'app-sa'?
Hard211You want to scale a Deployment named 'frontend' to 5 replicas. Which command should you use?
Easy212A pod is stuck in Pending state. You run 'kubectl describe pod mypod' and see the event: '0/3 nodes are available: 1 Insufficient memory, 2 Insufficient cpu'. The pod has resource requests defined. Which action would allow the pod to be scheduled?
Hard213You want to see the IP address and the node on which each pod in the 'default' namespace is running. Which command provides this information?
Medium214Which TWO methods can be used to expose a Secret's data as environment variables inside a container? (Select 2)
Medium215A company wants to ensure zero-downtime deployments for a stateless web application running in Kubernetes. They have a single Deployment with 3 replicas and a Service of type LoadBalancer. Which strategy should they use to achieve this?
Medium216A pod is running but not serving traffic. You suspect the readiness probe is failing. Which THREE commands or actions would help you diagnose the readiness probe issue?
Hard217Which command forwards port 8080 on the local machine to port 80 on a pod named 'web-pod'?
Easy218A Deployment is configured with strategy type 'Recreate'. Which statement about this strategy is true?
Medium219A team ships a container that writes structured JSON diagnostics to stdout and nothing to a file. A support engineer needs to filter those lines for entries with level 'error' across all containers of a deployment named 'checkout', without installing additional tooling on the nodes. Which approach accomplishes this using only kubectl?
Medium220Which kubectl command is used to view the rollout status of a Deployment named 'web-app'?
Easy221You need to create a ConfigMap named 'app-config' with key 'APP_COLOR' and value 'blue'. Which command creates this ConfigMap?
Easy222A pod's container has securityContext with runAsNonRoot: true but no runAsUser set. The container image has a user 'appuser' with UID 1001. Will the pod run successfully?
Hard223A pod is failing to start with error 'container has runAsNonRoot and image will run as root'. The container image runs as root. Which change allows the pod to run?
Hard224Which of the following are valid methods to perform a blue-green deployment? (Choose TWO)
Medium225You have a Deployment with multiple replicas. You want to expose it via a Service that has a stable IP address and is accessible from outside the cluster on a static port on each node. Which Service type should you use?
Hard226You have a headless Service for a StatefulSet. The DNS query for the service returns no A records. What is the most likely cause?
Medium227Which TWO are valid Service types? (Choose two.)
Medium228You need to configure a container to shut down gracefully when it receives a SIGTERM signal, with a timeout of 30 seconds before force kill. Which field in the Pod spec should you set?
Medium229Which TWO of the following are required to create a Role and RoleBinding that grants read access to Pods in the 'development' namespace? (Choose two.)
Easy230A Deployment has 3 replicas. You run 'kubectl scale deployment mydeploy --replicas=5'. What happens?
Easy231Which TWO of the following are valid fields in a CronJob spec? (Select 2)
Medium232Which Service type is used to expose a Service externally using a cloud provider's load balancer?
Easy233A StatefulSet named 'mysql' is deployed with 3 replicas. The administrator wants to create a headless Service so that each pod gets a unique DNS entry. Which Service specification should be used?
Hard234You are a platform engineer managing a Kubernetes cluster version 1.28. A development team has deployed a microservice application called 'order-processor' in the 'prod' namespace. The application consists of a frontend Pod 'frontend' and a backend Pod 'backend', each with a single container. The frontend needs to communicate with the backend using a headless Service named 'backend-svc' that selects Pods with label 'app:backend'. The backend Pods are expected to scale horizontally, and the frontend uses a DNS lookup to discover all backend Pod IPs for client-side load balancing. However, after deploying, the frontend is unable to resolve 'backend-svc' to any IP addresses. The backend Pod is running and has the correct label 'app:backend'. The Service 'backend-svc' is defined as a ClusterIP with clusterIP: None. The frontend container has the 'default' DNS policy. What is the most likely cause of the failure?
Hard235You have a Helm chart that deploys a web application. You want to conditionally include a ConfigMap in the release based on a value 'config.enabled'. Which template syntax correctly implements this?
Hard236A pod is running with a service account that has been granted a Role to get pods. The pod's code uses the Kubernetes API from within the container. However, the API call fails with a 403 Forbidden error. Which file should the pod read to obtain the authentication token?
Hard237A pod with the following security context is in CrashLoopBackOff. The container image runs as user 1000. securityContext: runAsUser: 2000 runAsGroup: 3000 fsGroup: 4000 What is the most likely cause?
Medium238Which TWO of the following are valid service types in Kubernetes?
Easy239To create a service that will be accessible from outside the cluster using a cloud provider's load balancer, what type should be used?
Easy240Which command shows resource usage (CPU/memory) of pods in the default namespace?
Easy241Which THREE of the following are valid fields in a PodSecurityContext that affect container security? (Select 3)
Hard242A ClusterIP service named 'svc' has no endpoints. Which command can you use to debug why the service is not routing traffic?
Hard243A pod needs to run as a non-root user. Which securityContext field should be set to enforce this?
Easy244A Kubernetes Job with parallelism=3 and completions=6 is created. How many pods will run concurrently at most?
Hard245A deployment 'api-deploy' has resource limits set but is frequently being OOMKilled. The team suspects the memory limit is too low. Which approach should be taken to confirm this without causing downtime?
Hard246You want to set environment variable 'DB_URL' in a pod from the key 'url' in ConfigMap 'db-config'. Which YAML snippet is correct?
Medium247Which of the following is a valid Pod Security Admission standard?
Easy248Which TWO statements about Kustomize are true?
Medium249Which kubectl command can be used to see the rollout status of a Deployment named 'web-app'?
Easy250Which TWO statements about kubectl apply vs kubectl create are correct? (Select two)
Medium251Sequence the steps to troubleshoot a Pod stuck in CrashLoopBackOff state.
Medium252Which kubectl command creates a ConfigMap named 'app-config' from a file 'config.properties'?
Easy253You are a Kubernetes administrator responsible for a production cluster. A development team has deployed a Pod named 'app-pod' that runs a container with a PostgreSQL database. The team reports that the Pod is failing to start with an error: 'Error: container has runAsNonRoot and image will run as root (runtime error)'. The Pod YAML is as follows: ```yaml apiVersion: v1 kind: Pod metadata: name: app-pod spec: containers: - name: db image: postgres:latest securityContext: runAsNonRoot: true ``` The team wants to ensure the container runs securely without running as root. What is the BEST course of action?
Easy254Which command creates a ConfigMap named 'app-config' with two keys: 'key1=value1' and 'key2=value2'?
Easy255Which of the following is the correct way to scale a Deployment named 'api' to 5 replicas using kubectl?
Easy256Which TWO of the following are true about headless services? (Select 2)
Easy257A Deployment named 'web-app' has 4 replicas. You need to perform a rolling update with a maxSurge of 50% and maxUnavailable of 25%. Which YAML snippet configures this correctly?
Medium258A ClusterRole named 'pod-reader' allows get, list, and watch on pods. A RoleBinding 'read-pods' in namespace 'default' binds this ClusterRole to user 'jane'. Which statement is true?
Medium259Which command shows resource usage (CPU and memory) for pods in a namespace?
Easy260You apply the following Ingress manifest: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: app-ingress spec: ingressClassName: nginx rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-service port: number: 80 The Ingress controller logs show a 404 error when accessing 'http://example.com/api'. The service 'api-service' exists and is reachable via ClusterIP. What is the most likely cause?
Hard261You need to view the logs of a container that previously crashed and has been restarted. Which flag do you use with 'kubectl logs'?
Medium262You are implementing a blue-green deployment using Kubernetes Deployments and Services. The 'blue' Deployment runs version 1.0, and the 'green' Deployment runs version 2.0. What is the key mechanism to switch traffic from blue to green?
Medium263A developer deployed a pod named 'web-pod' with a single container. Users report intermittent 502 errors. The developer wants to see CPU and memory consumption of that specific container to determine whether it is being throttled. Which command should be used?
Easy264You have a Deployment running a web server that takes 30 seconds to initialize. You want to ensure that the load balancer does not send traffic to the pod until it is ready. Which probe should you configure?
Easy265You need to run a batch job that processes 10 items in parallel across 10 Pods, but the job should be considered complete only when all 10 Pods have succeeded. Which Job configuration is correct?
Medium266You have a Deployment 'app' with the following strategy configuration: 'type: RollingUpdate', 'rollingUpdate: {maxSurge: 0, maxUnavailable: 1}'. You update the container image. What is the behavior during the update?
Medium267A developer wants to create a Job that runs exactly 3 pods in parallel. Which field should be set in the Job spec?
Medium268Which TWO are correct about LimitRange?
Medium269A production pod named 'api-pod' runs a single container whose liveness probe has begun failing after a configuration change, causing repeated restarts. An engineer must determine whether the failures are caused by the probe configuration itself or by the application inside the container. Which TWO actions best provide that evidence? (Choose two.)
Hard270You want to deny all incoming traffic to a set of pods except from pods with label 'role: frontend'. Which NetworkPolicy spec should you use?
Easy271You have a Job that should retry up to 3 times if it fails, and should be considered failed after 4 failures total (including retries). Which YAML fields should you set?
Hard272Which TWO of the following are valid uses of Kubernetes Annotations? (Select two.)
Easy273A Job has the following spec: apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never backoffLimit: 4 If the pod fails, how many times will Kubernetes retry the job before considering it failed?
Hard274You want to run a command inside a running container to check environment variables. Which command should you use?
Medium275A NetworkPolicy allows egress traffic to pods with label 'db: mysql' in the same namespace. Which egress rule is correct?
Medium276Which of the following commands creates a deployment named 'webapp' that runs the image 'nginx:1.25' with 3 replicas?
Easy277A CronJob is configured with concurrencyPolicy: Replace and a job execution takes 10 minutes. The schedule is */5 * * * *. Which statement is true about job executions?
Hard278Which command lists all Helm releases in the current namespace?
Easy279You want to perform a rolling update of a Deployment. The Deployment has a maxSurge=1 and maxUnavailable=0. How many extra pods can be created above the desired count during the update?
Hard280You want to configure a pod so that it receives a SIGTERM signal and has 60 seconds to shut down gracefully before being forcefully killed. Which field should you set?
Hard281A developer wants to restrict a Pod's resource usage. Which two API resources can be used to enforce limits at the namespace level? (Choose two.)
Easy282You have a multi-container pod with a main container and a sidecar container that collects logs. The sidecar container should start before the main container and must complete initialization tasks before the main container starts. Which type of container should you use for this purpose?
Medium283Which of the following is a valid way to expose a Secret as an environment variable in a Pod?
Easy284Which of the following is NOT a valid restart policy for a Pod?
Easy285You want to add an annotation to a pod without modifying the pod template. Which approach should you use?
Medium286Your team manages a microservices application on a Kubernetes cluster. A critical service 'order-service' is deployed with 3 replicas. Lately, customers have reported occasional timeouts when placing orders. You suspect that the service is overloaded during peak hours. You have configured a HorizontalPodAutoscaler (HPA) based on CPU utilization, but the autoscaler does not appear to be scaling up quickly enough. Upon inspection, you notice that the HPA is configured with a target CPU utilization of 80%, and the current CPU usage of the pods is around 70%. However, the pods' memory usage is high and growing. The application is also logging slow database queries. Which action is most likely to improve the responsiveness of the service during peak load?
Medium287You have a Service named 'web-svc' of type ClusterIP. You want to test connectivity to it from a temporary pod. Which command would you use to launch a temporary interactive pod with the image 'busybox' and then run 'wget' against the Service?
Medium288Which three security contexts can be set at the pod level (as opposed to container level)? (Select THREE.)
Hard289Which THREE configurations are part of Pod Security Admission's 'restricted' profile? (Select THREE.)
Hard290You have deployed an application using Helm. You want to see the history of revisions for the release 'frontend' in the 'web' namespace. Which command should you use?
Medium291A Pod is configured with automountServiceAccountToken: false. The application inside the pod needs to access the Kubernetes API. What should be done?
Hard292You have a pod that is in a 'Pending' state. You run 'kubectl describe pod' and see the event: '0/3 nodes are available: 3 Insufficient cpu'. What is the most likely cause?
Medium293Which TWO commands can be used to view the logs of a pod that has crashed?
Medium294Which TWO statements about headless services are correct?
Medium295You are performing a blue-green deployment. You have two Deployments: 'app-blue' (current) and 'app-green' (new). Both have labels 'app: myapp' and 'version: blue' or 'version: green' respectively. The Service 'myapp-svc' selects pods with 'app: myapp, version: blue'. How do you switch traffic to the green deployment?
Medium296You need to allow ingress traffic to pods in namespace 'api' only from pods in namespace 'frontend' that have label 'role: proxy'. Which NetworkPolicy ingress rule correctly implements this?
Medium297In a Deployment, what is the purpose of the 'maxUnavailable' field in the rolling update strategy?
Easy298You need to debug a pod that has no running container because it crashed. The pod is in CrashLoopBackOff. Which command allows you to start a temporary container in the same pod for debugging?
Hard299Which Dockerfile instruction is used to specify the base image for a build?
Easy300What is the purpose of the 'kubectl describe pod' command?
Easy301Which of the following is true about the CMD instruction in a Dockerfile?
Medium302You have a Deployment named 'web' with label 'app: web'. You want to create a Service that exposes the Deployment on port 80 internally within the cluster. Which kubectl command achieves this?
Easy303Which THREE are valid reasons to use a StatefulSet instead of a Deployment?
Hard304A Pod in a namespace with a ResourceQuota that sets 'limits.cpu: 4' and 'limits.memory: 8Gi' is being created with the following container resources: requests: cpu: 2, memory: 4Gi; limits: cpu: 4, memory: 8Gi. The namespace also has a LimitRange with default limits of cpu: 500m, memory: 512Mi. Which statement is true about this resource configuration?
Hard305Which THREE are valid fields in a NetworkPolicy spec? (Choose three.)
Hard306You have a CronJob that runs every 5 minutes. The job sometimes takes longer than 5 minutes to complete. You want to ensure that while a job is running, the next scheduled job is skipped (not started). Which concurrencyPolicy should you use?
Hard307You run 'kubectl apply -f pod.yaml' but the pod remains in 'Pending' state. 'kubectl describe pod' shows '0/1 nodes are available: 1 Insufficient cpu'. What is the most likely cause?
Hard308A NetworkPolicy denies all ingress traffic to a namespace. Which rule would allow traffic only from pods in the same namespace?
Medium309To prevent a container from running as root, which field should be set in the securityContext?
Easy310A developer needs to run a one-off task that processes a queue and then exits. The task must run exactly once per invocation, and if the Pod fails, Kubernetes should restart it until it succeeds. The task should not be restarted after it completes successfully. Which Kubernetes resource should the developer create?
Medium311Which Pod spec snippets correctly achieve this?
Medium312You have a Deployment that uses the Recreate strategy. You update the container image. What happens to the existing pods?
Hard313A pod is scheduled but stays in Pending state. 'kubectl describe pod' shows: '0/1 nodes are available: 1 Insufficient memory'. What is the most likely cause?
Medium314Which TWO of the following are valid reasons to use a readiness probe? (Select 2)
Easy315A Helm chart has the following template snippet: '{{ .Values.replicaCount }}'. You want to set replicaCount to 5 during installation. Which command should you use?
Medium316Which TWO of the following are valid ways to mount a Secret into a pod as environment variables? (Select exactly 2)
Hard317What is the purpose of the 'spec.externalName' field in a Service of type ExternalName?
Easy318You have a Deployment with the following strategy: rollingUpdate: maxSurge: 25%, maxUnavailable: 25%. The Deployment has 4 replicas. During an update, what is the minimum number of pods guaranteed to be available?
Hard319Which THREE statements are true about init containers? (Select 3)
Hard320What is the default type of a Kubernetes Service when no type is specified in the YAML manifest?
Easy321Which command shows the CPU and memory usage of all pods in the current namespace?
Easy322A developer creates a headless Service with 'clusterIP: None' for a StatefulSet. What is the primary purpose of using a headless Service?
Medium323A developer wants to containerize a Node.js application. The Dockerfile should first copy only package.json and package-lock.json, run npm install, then copy the rest of the source code. Which Dockerfile best achieves this?
Medium324You have a Deployment with a liveness probe using an exec command. The probe currently runs 'cat /tmp/healthy' and fails after 3 failures. You notice the pod is being restarted even though the application is healthy. What is the most likely cause?
Hard325A developer wants to restrict network traffic so that only pods with label 'app: frontend' can communicate with pods labeled 'app: backend' on port 8080. Which Kubernetes resource should be used?
Medium326You have a Deployment with 3 replicas. You run 'kubectl rollout pause deployment/app'. Which command would you use to resume the rollout?
Medium327A developer wants to expose a Deployment named 'web-app' (with label 'app: web') as a ClusterIP service on port 80. Which command achieves this?
Easy328Which TWO statements are true about readiness probes? (Select two.)
Medium329Which THREE of the following are valid Kustomize features? (Select THREE)
Medium330Which TWO resources are used to enforce resource quotas at the namespace level? (Select TWO.)
Medium331You manage a Deployment named 'web' in namespace 'prod' whose pods mount a ConfigMap named 'web-config' as a volume at /etc/web. You update the ConfigMap data, but the running pods still serve the old configuration because the application only reads the mounted file at startup. You must roll out the new configuration to all pods with zero downtime and preserve the ability to roll back. What is the MOST appropriate action?
Medium332You run 'kubectl get pods' and see a pod in 'CrashLoopBackOff' state. Which TWO conditions could cause this state?
Hard333You have a Service named 'api' with selectors that match pods. However, curl to the Service cluster IP times out. 'kubectl get endpoints api' shows no endpoints. What is the most likely cause?
Medium334A pod is stuck in 'Pending' state. You run 'kubectl describe pod' and see '0/1 nodes are available: 1 Insufficient cpu, 1 Insufficient memory.' What does this mean?
Medium335Which TWO of the following are valid strategies for updating a Deployment?
Easy336Which THREE of the following are valid fields in a PodSecurityContext?
Hard337A container in a pod is expected to shut down gracefully within 30 seconds when it receives SIGTERM. How should you configure the pod to ensure the container is given enough time to shut down before being forcefully killed?
Medium338You are using a canary deployment strategy with Deployments and Services. You have a stable version (v1) and a canary version (v2). Both Deployments have the label 'app: myapp'. The Service selector is 'app: myapp'. How can you route a small percentage of traffic to the canary?
Hard339A container runs as root (UID 0) but the security policy requires the container to run as non-root user 1000. Which pod security context setting should be added?
Easy340Refer to the exhibit. A Pod is defined with security contexts at both the container and Pod level. Which of the following statements accurately describes the effective security configuration?
Hard341A user runs: kubectl apply -f job.yaml. The Job spec has backoffLimit: 0. The pod fails immediately. What happens?
Medium342A pod spec has terminationGracePeriodSeconds: 30. The main process ignores SIGTERM. After 30 seconds, what happens?
Hard343You are using a canary deployment pattern with two Deployments: 'web-stable' (version 1) and 'web-canary' (version 2). Both have the label 'app: web'. The Service 'web-svc' selects pods with 'app: web' and 'version: stable'. How do you route traffic to the canary?
Hard344You are deploying a stateful application as a StatefulSet named 'db' with three replicas and a headless Service named 'db-headless'. The application requires each pod to have a stable network identity and its own persistent storage that survives pod rescheduling. Which combination of StatefulSet fields ensures this behavior?
Hard345A ClusterIP Service named 'db' in namespace 'data' is not reachable from a pod in namespace 'app'. Which DNS name should the pod use to resolve the service?
Medium346You want to debug a running pod by starting a temporary container that has network access to the pod's containers. Which kubectl command should you use?
Medium347Which TWO of the following are valid ways to inject configuration data into a Kubernetes Pod?
Medium348Which command builds a Docker image from the current directory and tags it as 'myapp:v1'?
Easy349You want to run a command inside an existing container 'app-container' in pod 'my-pod'. The pod has only one container. Which command enters an interactive shell?
Medium350A pod needs to mount a Secret named 'db-secret' as a volume at /etc/secret. Which volume mount definition is correct?
Easy351A developer creates a Deployment with 3 replicas and a Service with `clusterIP: None`. What is the primary use case for this headless Service?
Medium352Which kubectl command is used to view the rollout status of a Deployment?
Easy353You have a LimitRange in namespace 'ns' that sets default limits.cpu to 500m and default requests.cpu to 200m. You create a pod without specifying any CPU resources. What CPU values will be applied to the container?
Medium354You want to undo a rollout to the previous revision. Which command should you use?
Medium355Which of the following best describes the purpose of an init container?
Easy356You need to ensure that a Pod always runs on a node with an SSD. Which node selector mechanism should you use?
Medium357You need to debug a Pod that is in CrashLoopBackOff. Which command should you run first?
Medium358Which command creates a generic secret named 'db-secret' with key 'password' and value 'p@ss'?
Easy359A developer creates a headless Service named 'db' to discover all database pod IPs. The Service selects pods with label 'app: db'. The pods are assigned IPs 10.0.0.1, 10.0.0.2, and 10.0.0.3. When a client performs a DNS lookup for 'db', what will it receive?
Medium360You need to view events for a specific pod named 'web-1' in the 'default' namespace. Which command shows events related to this pod?
Medium361Match each Kubernetes concept to its definition.
Medium362A developer needs to run a one-time batch job to process data. After completion, the pod should be retained for logs inspection. Which Job configuration parameter should be set?
Easy363A container in your pod takes a long time to start (up to 5 minutes). You want to avoid the container being restarted by the liveness probe during this period. What should you configure?
Easy364What is the purpose of a .dockerignore file in a Docker build context?
Easy365Which TWO of the following are required for Ingress to route HTTP traffic to a backend Service?
Easy366You create a Role named 'pod-reader' in the 'default' namespace with rules to get, list, and watch pods. A ServiceAccount 'app-sa' in the same namespace needs to be bound to this role. Which YAML snippet correctly creates the RoleBinding?
Medium367You need to debug a running pod that does not have a shell installed. Which kubectl command allows you to start an ephemeral container with a shell?
Medium368An administrator wants to enforce that all pods in namespace 'secured' must run with a seccomp profile set to 'RuntimeDefault' at the container level. Which Pod Security Admission policy standard achieves this?
Hard369You need to view the logs of the previous (terminated) instance of a container in a pod. Which command should you use?
Easy370You have a Service named 'myservice' in namespace 'default'. A pod in the same cluster but different namespace 'other' wants to resolve the service's IP. What DNS name should it use?
Medium371You need to debug a pod that has no running containers because it is in a CrashLoopBackOff state. You want to start an ephemeral container with debugging tools in the same namespace. Which command accomplishes this?
Hard372Which THREE are valid ways to expose a Service externally in Kubernetes?
Hard373A CronJob has concurrencyPolicy set to 'Forbid'. At the scheduled time, if the previous job is still running, what happens?
Medium374A pod is using a Secret to authenticate to a private registry. The Secret type must be 'kubernetes.io/dockerconfigjson'. Which of the following is the correct way to create such a Secret using kubectl?
Medium375You need to schedule a task that runs every day at 2:00 AM. The task should be allowed to run even if a previous instance is still running. Which concurrencyPolicy should you set in the CronJob spec?
Medium376Which TWO actions can you perform using 'kubectl describe'? (Select two.)
Medium377You have a Deployment that is failing after a rollout. You want to revert to the previous revision. Which command accomplishes this?
Hard378What is the effect of running 'kubectl rollout pause deployment web'?
Medium379A Pod has two containers: one with a liveness probe that fails after 30 seconds. The restartPolicy is 'Never'. What state will the Pod be in after the liveness probe fails?
Hard380Which TWO statements about the .dockerignore file are true?
Medium381Which TWO of the following are correct ways to pause a rollout of a Deployment named 'myapp'? (Select TWO)
Medium382You want to perform a canary deployment where 10% of traffic goes to the new version. You have a Deployment 'app-v1' with 10 replicas. You create a second Deployment 'app-v2' with 1 replica and a new Service. What Kubernetes resource is typically used to split traffic between the two Services?
Hard383Which THREE components are required for a basic Ingress to route HTTP traffic to a Service? (Choose three.)
Hard384Which FOUR of the following are valid fields in a HorizontalPodAutoscaler (HPA) v2 specification?
Hard385A Pod needs to communicate with another Pod in the same cluster but in a different namespace. What is the correct DNS name to use?
Medium386A Pod in a namespace with a ResourceQuota fails to create with the error: 'exceeded quota: compute-quota, requested: pods=1, used: pods=5, limited: pods=5'. What is the issue?
Medium387You need to configure a liveness probe that checks if the container port 8080 is open. Which probe type should you use?
Hard388You are writing a Dockerfile and want to ensure that the CMD instruction is overridable when running the container, but the ENTRYPOINT should not be easily overridden. Which combination should you use?
Medium389Which THREE are valid types of probes in Kubernetes?
Hard390Which TWO statements about init containers are true? (Select 2)
Medium391A pod has a readiness probe configured with httpGet on port 8080. The probe is failing, but the pod is running. What is the immediate effect on the pod?
Medium392What is the DNS name for a Service named 'backend' in the 'default' namespace?
Easy393A pod named 'app' has a container that logs to stdout. You want to add a sidecar container that streams these logs to a centralized logging service. Which pattern does this represent?
Hard394You want to perform a canary deployment. You have a Deployment 'app-v1' with 10 replicas. You create a new Deployment 'app-v2' with 1 replica. Both have the label 'app: myapp'. The Service 'myapp-svc' uses selector 'app: myapp'. How do you gradually increase traffic to v2?
Medium395A pod has a container with envFrom referencing a ConfigMap. The ConfigMap has keys 'APP_DEBUG=true' and 'APP_NAME=myapp'. The pod also has an env entry with name 'APP_DEBUG' set to 'false'. What is the value of APP_DEBUG in the container?
Medium396You apply a ResourceQuota to a namespace that limits memory requests to 2Gi. You then try to create a pod that requests 3Gi memory. What happens?
Medium397A Pod specification includes: securityContext: { seccompProfile: { type: RuntimeDefault } }. What does this configuration do?
Hard398A team is deploying a microservice that must be reachable within the cluster via a stable DNS name. They also need to distribute traffic among pods. Which Kubernetes resource provides both service discovery and load balancing?
Medium399A pod is in Pending state. 'kubectl describe pod' shows '0/1 nodes are available: 1 Insufficient cpu'. Which action would resolve this?
Medium400A user runs: kubectl run my-pod --image=nginx --restart=Never --dry-run=client -o yaml. Which apiVersion is used in the generated YAML?
Medium401Which kubectl command can you use to stream the logs from a pod in real-time?
Easy402A namespace 'team-a' has a ResourceQuota that sets 'requests.cpu: 4' and 'limits.cpu: 8'. A developer tries to create a pod with 'resources.requests.cpu: 2' and 'resources.limits.cpu: 10'. What happens?
Medium403A pod has a startup probe with failureThreshold: 30 and periodSeconds: 10. The application takes up to 5 minutes to start. What should be changed to ensure the startup probe does not kill the container prematurely?
Hard404Which THREE of the following are true about Kubernetes Services? (Select 3)
Hard405A pod is running but not receiving traffic from a Service. The readiness probe is failing. What is the likely effect on the pod?
Medium406Which TWO of the following are correct about the ExternalName Service type?
Medium407You need to run a batch job that processes a queue and must ensure exactly 5 pods run successfully in parallel. Which Job configuration field should be set?
Medium408A StatefulSet named 'mysql' is deployed with 3 replicas. The administrator wants each pod to have a stable network identity. Which service configuration is required?
Medium409You have a ConfigMap named 'app-config' with key 'database.url'. Which environment variable definition correctly injects this value into a pod using a configMapKeyRef?
Easy410Which THREE commands can be used to list the endpoints of a Service named 'my-svc'?
Medium411Which Helm command is used to install a chart from a repository?
Easy412Which TWO of the following are valid parameters for configuring probes in Kubernetes? (Select TWO.)
Medium413A pod in a namespace with a ResourceQuota that sets 'requests.cpu: 2' is failing to schedule. The pod manifest specifies 'resources: { requests: { cpu: "500m" } }'. What is the likely cause?
Hard414A developer is writing a Dockerfile and wants to ensure that the container runs a Python script named 'app.py' as its main process. Which instruction should be used?
Medium415You are responsible for a multi-tier application running in a Kubernetes cluster. The frontend Pods communicate with backend Pods via a Service named 'backend' in the same namespace. Recently, the frontend team reported that the backend Service is intermittently unreachable. You inspect the backend Pods and notice that they are all running and ready, but the Endpoints object for the 'backend' Service shows only a subset of the Pod IPs. You also notice that the backend Pods have a readiness probe configured that checks an HTTP endpoint '/healthz'. The readiness probe has a periodSeconds of 5 and failureThreshold of 3. The application logs show occasional spikes in response time on the /healthz endpoint, sometimes exceeding 15 seconds. You need to resolve the intermittent unavailability without removing the readiness probe. Which action should you take?
Hard416Which THREE statements about Ingress are correct? (Choose three.)
Medium417You have a Secret of type kubernetes.io/tls. The pod mounting it as a volume expects the files 'tls.crt' and 'tls.key'. What keys must the Secret data contain?
Hard418A Pod needs to access an external database at db.example.com:3306. Which Service type allows Pods to resolve a cluster-local name to this external address?
Medium419Which of the following is the correct apiVersion for a CronJob in Kubernetes v1.29?
Easy420Which Service type is used to expose a Service on a static port on each node's IP address, allowing external traffic to reach the Service?
Easy421An Ingress resource is configured with TLS. Which field in the Ingress YAML specifies the secret containing the TLS certificate and key?
Medium422A CronJob must run a task every day at midnight, but if the previous job is still running, the new job should be skipped. Which concurrencyPolicy should be set?
Medium423Which TWO approaches can be used to expose a Secret's value as an environment variable in a pod?
Medium424An administrator applies the following NetworkPolicy: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress - Egress After applying this policy, which traffic flows are affected?
Hard425A developer wants to mount a ConfigMap as a volume in a Pod so that updates to the ConfigMap are reflected in the Pod without restarting. Which two statements are correct? (Choose two.)
Medium426An Ingress resource has the following spec: spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-service port: number: 80 What will the Ingress controller do for a request to http://example.com/api/v1/users?
Medium427Which THREE statements about NetworkPolicy are correct?
Hard428Sequence the steps to expose a Kubernetes Service using a NodePort for external access.
Medium429You need to perform a blue-green deployment using Deployments and Services. What is the most common approach to switch traffic from the old version (blue) to the new version (green)?
Medium430What is the primary purpose of an Init Container in a Pod?
Easy431Which TWO of the following are valid ways to expose a service externally on a Kubernetes cluster? (Select 2)
Medium432A Service named 'api' has no endpoints. 'kubectl describe svc api' shows the selector 'app: api', but no pods have that label. What is the most likely reason for missing endpoints?
Hard433You are tasked with containerizing a Go application. The application compiles into a binary. Which Dockerfile best implements a multi-stage build to produce a minimal image?
Medium434What is the purpose of the 'values.yaml' file in a Helm chart?
Medium435You want to expose a container's port 8080 in the Dockerfile. Which instruction should you use?
Medium436What is the DNS name for a Service named `svc` in namespace `ns`?
Easy437A pod fails to start with a 'CreateContainerConfigError'. Running 'kubectl describe pod my-pod' reveals: 'Error: container has runAsNonRoot and image will run as root'. The pod definition includes 'securityContext.runAsNonRoot: true'. What is the most likely cause?
Medium438You have a Pod that runs a web server and you want to add a sidecar container that exposes a Prometheus metrics endpoint by scraping the web server's logs. Which sidecar pattern does this exemplify?
Hard439Which THREE of the following are valid ways to update a Deployment's container image in Kubernetes?
Hard440You have a Deployment that uses a ConfigMap. You update the ConfigMap, but the pods are not picking up the changes. What is the MOST efficient way to force the pods to use the new ConfigMap values without downtime?
Hard441You have a Deployment called 'web-deploy' with 3 replicas. One of the pods is not receiving traffic, but it shows 'Running' and passes its liveness probe. The readiness probe is configured as a TCP socket check on port 8080. You verify that the application is listening on port 8080. What is a likely reason the pod is not receiving traffic?
Hard442A company runs a web application in a Kubernetes cluster. The application consists of a frontend service and a backend service. The frontend needs to communicate with the backend using a DNS name that does not change even if the backend pods are recreated. Which Kubernetes resource should the frontend use to reach the backend?
Medium443You are a platform engineer for a large e-commerce site. The application is deployed on a Kubernetes cluster with 10 worker nodes. Recently, a new deployment 'checkout' was rolled out, and soon after, the cluster experienced network latency and intermittent connectivity issues between services. The 'checkout' pods are configured with a liveness probe that makes an HTTP request to an internal health endpoint. Upon investigation, you find that the kubelet on several nodes is consuming high CPU, and the number of iptables rules has increased significantly. You suspect that the 'checkout' deployment's configuration is causing excessive churn in the network rules. Which aspect of the deployment configuration is most likely the root cause?
Hard444A company wants to deploy a stateless web application on Kubernetes. The application needs to be accessible externally via a stable IP address and should support SSL termination at the ingress level. Which resource should be used to route external traffic to the application?
Medium445Which of the following is a valid schedule for a CronJob that runs every day at midnight?
Easy446You need to configure a liveness probe for a container that listens on TCP port 8080. The probe should wait 5 seconds before starting, check every 10 seconds, and timeout after 2 seconds. Which YAML snippet correctly configures this?
Hard447Sequence the steps to scale a Deployment to 5 replicas and verify.
Medium448A developer needs to run a one-off batch job that processes a queue and must complete exactly once before the pod is terminated. The container image is 'registry.example.com/worker:1.4'. Which resource should be created to meet this requirement?
Easy449Which THREE of the following are valid ways to debug a pod that is not responding? (Select three.)
Hard450Which Dockerfile instruction sets a command that can be overridden when running the container?
Easy451A developer reports that a pod named 'api-pod' is restarted repeatedly. You run 'kubectl get events --field-selector involvedObject.name=api-pod' and see multiple events with reason 'BackOff' and message 'Back-off restarting failed container'. Which probe failure is MOST likely causing this?
Medium452Which TWO are valid fields in a Deployment's rollingUpdate configuration? (Select 2)
Easy453Which THREE of the following are correct statements about Helm?
Medium454A pod is stuck in the Pending state. You run 'kubectl describe pod pod-name' and see the event: '0/4 nodes are available: 1 node had taint {node-role.kubernetes.io/control-plane: }, that the pod didn't tolerate, 3 nodes had taint {node.kubernetes.io/disk-pressure: }, that the pod didn't tolerate.' What is the MOST likely cause?
Hard455A container image requires a seccomp profile that is not the default. The cluster supports the RuntimeDefault seccomp profile. Which Pod securityContext field should be configured to use the RuntimeDefault seccomp profile?
Hard456Which TWO of the following are correct about the difference between 'kubectl apply' and 'kubectl create'?
Easy457What is the purpose of a readiness probe in Kubernetes?
Easy458Which command shows the rollout history of a Deployment named 'web'?
Easy459Which kubectl command creates a Secret named 'tls-secret' from a TLS certificate file 'cert.pem' and private key file 'key.pem'?
Easy460You deploy a pod with resource requests: cpu: 500m, memory: 256Mi and limits: cpu: 1, memory: 512Mi. The container tries to allocate 600Mi of memory. What happens?
Medium461Which TWO statements about Init Containers are correct? (Select exactly 2.)
Medium462A pod is running with a SecurityContext that sets 'runAsUser: 1000' and 'runAsGroup: 3000'. The container process is running as user 1000. However, the container needs to access a file on a mounted volume that is owned by user 1000 and group 2000. Which SecurityContext setting should be added to ensure the container can read the file?
Medium463Which command creates a generic Secret with username=admin and password=secret123?
Easy464Which kubectl command creates a ConfigMap named 'app-config' from a file 'app.properties'?
Easy465You are tasked with deploying a stateless web application on a Kubernetes cluster. The application is containerized and listens on port 8080. You have created a Deployment named 'webapp' with 3 replicas, and a ClusterIP Service named 'webapp-svc' exposing port 80 targeting the application's port 8080. During testing, you notice that some requests to the service return errors while others succeed. You have verified that all Pods are running and ready. The application logs show no errors. What is the most likely cause of the intermittent failures?
Medium466Which of the following is the correct way to create a simple Pod named 'nginx' running the nginx:1.25 image using kubectl?
Easy467Which TWO fields are required in a CronJob manifest? (Select 2)
Medium468What is the purpose of the '.dockerignore' file?
Easy469During a rolling update, you want to ensure that a maximum of 2 extra pods are created above the desired replicas. Which field should you set in the Deployment spec?
Medium470Which THREE of the following are valid types of Secrets in Kubernetes?
Medium471A Pod specification includes: securityContext: { runAsNonRoot: true }. The container image runs as root by default. What will happen when the Pod is created?
Medium472Which THREE of the following are valid types of probes in Kubernetes? (Select 3)
Medium473Which TWO items are required for Ingress to work correctly in a Kubernetes cluster?
Medium474Which THREE of the following are valid fields in the '.spec' of a Job manifest?
Hard475Arrange the steps to create a multi-container Pod with a shared volume.
Medium476Which THREE are valid ways to create a ConfigMap?
Hard477Which command creates a TLS secret from an existing certificate and key file?
Easy478You are writing a Deployment manifest for a container that takes up to 60 seconds to become ready. You want to ensure the liveness probe does not interfere during this startup period. What should you configure?
Medium479Which kubectl command shows the rollout history of a Deployment named 'app'?
Easy480Which THREE of the following are valid fields in a PodSecurityContext (pod-level securityContext)? (Select 3)
Hard481Which THREE of the following are valid reasons to use a HorizontalPodAutoscaler (HPA) with a Deployment?
Medium482What is the correct schedule expression for a CronJob that runs every 5 minutes?
Medium483When performing a rolling update of a Deployment with 'maxSurge: 1' and 'maxUnavailable: 0', how many additional pods can be created above the desired replicas during the update?
Easy484You want to use Kustomize to apply a patch to a Deployment in the 'overlays/production' directory. Which command should you run from the kustomization directory?
Medium485You have a Helm chart for an application. You want to upgrade the release but only if the upgrade does not introduce breaking changes. Which command should you use?
Medium486You need to configure a liveness probe for a container that starts a web server on port 8080. The probe should check the '/healthz' endpoint. Which YAML snippet correctly defines this probe?
Medium487A pod with an init container and a main container has 'restartPolicy: Always'. The init container exits with code 0. What happens next?
Hard488A developer wants to access a specific pod's port 8080 from their local machine using a temporary connection. Which command should they use?
Easy489Which of the following is the correct apiVersion for a Kubernetes Job in v1.29?
Easy490Which THREE of the following are valid fields in a SecurityContext at the container level? (Select three.)
Hard491Which TWO of the following are valid ways to expose a container port in a pod spec?
Medium492A NetworkPolicy with the following spec is applied: spec: podSelector: {} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: role: frontend What does this policy do?
Medium493Which TWO statements about Ingress are correct?
Medium494You create a Secret with 'kubectl create secret generic db-secret --from-literal=password=myPass'. Later, you mount it as a volume in a pod. When you exec into the container and cat the file, what will you see?
Hard495Given the following partial pod spec: ```yaml securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 ``` Which combination correctly describes the resulting permissions on a mounted volume?
Hard496A team wants to deploy a multi-container Pod with a sidecar pattern. Which THREE statements are true about sidecar containers? (Select exactly 3.)
Hard497You need to see the YAML definition of a running pod named 'app' including the current status. Which command should you use?
Medium498Which Dockerfile instruction is used to specify the base image for a container image?
Easy499A user creates a Deployment with 3 replicas and a Service of type ClusterIP. The Service selects pods with label 'app: web'. The user wants external clients to access the application via a stable IP address. Which additional resource is required?
Easy500You have a ConfigMap created from an env file. Which command creates the ConfigMap from the file 'app.env' containing key=value pairs?
Easy501You need to run a command inside a running pod's container. The container has a shell available. Which command allows you to execute 'ls -la /data' inside the container?
Medium502You have a HorizontalPodAutoscaler (HPA) that targets CPU utilization at 50%. The current average CPU utilization is 80%. The HPA has a stabilization window of 300 seconds and a scale-down policy with a periodSeconds of 60. CPU utilization drops to 40%. How long will it take for the HPA to begin scaling down?
Hard503During a rolling update of a Deployment, you notice that new pods are failing readiness probes. The rollout is stalled. Which command would you use to abort the rollout and revert to the previous revision?
Hard504You have an HPA that scales a Deployment based on CPU utilization. You want to prevent the Deployment from scaling down for at least 5 minutes. Which HPA behavior field should you configure?
Medium505Which THREE of the following are capabilities that can be added to a container's securityContext?
Hard506You have a pod that runs a single container with the following resource limits: memory: 256Mi, cpu: 500m. The container is consistently using 300Mi of memory and 300m of CPU. The pod is running but you want to avoid OOMKilled. Which change should you make?
Hard507A NetworkPolicy named 'deny-all' is applied in a namespace. Which YAML snippet correctly implements a default-deny-all ingress policy?
Medium508What is the purpose of the 'maxUnavailable' field in a Deployment's rolling update configuration?
Medium509An Ingress resource specifies TLS termination using a secret. The secret must contain which keys?
Hard510You have a Deployment 'web-app' with 4 replicas. You want to perform a rolling update such that during the update, at most 2 pods can be unavailable and at most 5 pods can be above the desired replica count. Which TWO of the following strategy configurations achieve this?
Hard511You want to restrict a Pod to only run with a seccomp profile of 'RuntimeDefault'. Which SecurityContext field should you set?
Hard512A pod named 'db-pod' is running but not responding as expected. You want to check its logs from the previous instantiation (after a crash). Which command should you use?
Medium513You need to create a Pod that mounts a Secret named 'mysecret' as an environment variable 'SECRET_DATA'. The secret has a key 'password'. Which YAML snippet correctly achieves this?
Hard514Which TWO of the following are valid types for a Kubernetes Secret? (Choose two.)
Easy515Which kubectl command sets the number of replicas for a deployment named 'nginx' to 5?
Easy516Which TWO actions can help prevent a container from being compromised if an attacker gains access? (Select 2)
Medium517A cluster has a node that is NotReady. The kubelet on that node is not responding. Which command should be used to investigate the kubelet logs on the node?
Hard518A pod has been scheduled on a node but is stuck in 'ContainerCreating' state. The team suspects a missing storage class. Which command would best confirm this?
Medium519Which THREE of the following are true about using 'kubectl rollout undo'? (Select three)
Hard520A user creates a Job with '.spec.completions=5' and '.spec.parallelism=2'. How many pods will run at the same time?
Medium521What is the default service type in Kubernetes?
Easy522Which THREE of the following are characteristics of Pod Security Admission (PSA) standards? (Select three.)
Hard523Which Dockerfile instruction is used to define a mount point for a volume?
Easy524You need to check the CPU and memory usage of a pod named 'monitored-pod' in the 'default' namespace. Which command should you run?
Medium525You have a multi-stage Dockerfile. You want to copy artifacts from the builder stage to the final stage. Which instruction should you use in the final stage?
Medium526You apply the following NetworkPolicy: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress - Egress After applying, pods in the namespace cannot reach the kube-dns service. What is the most likely reason?
Hard527Which THREE components are typically involved when using Ingress to expose a service?
Hard528A deployment is configured with a liveness probe that checks an HTTP endpoint. The probe fails intermittently, causing pod restarts. What is the best first step to diagnose the issue?
Easy529A Role named 'pod-reader' in namespace 'ns1' grants get, list, and watch on pods. Which RoleBinding correctly binds this role to a ServiceAccount 'sa1' in the same namespace?
Medium530An Ingress resource is configured with TLS termination. The secret referenced in the Ingress is present, but the Ingress controller returns 404. What is the most likely cause?
Hard531A Deployment named 'web' has replicas: 3 and update strategy type: Recreate. You run 'kubectl set image deployment/web web=nginx:1.22'. What immediate effect will this have on the existing pods?
Hard532You have an Ingress resource with TLS configured. The certificate is stored in a Secret named 'my-tls'. Which field in the Ingress YAML specifies the Secret name?
Hard533A cluster administrator wants to prevent all pods in a namespace from running with privileged escalation. Which Pod Security Admission standard enforces this?
Medium534What is the default restart policy for a pod created with 'kubectl run nginx --image=nginx'?
Medium535You have a Service named 'my-svc' in the 'prod' namespace. What is the fully qualified DNS name for this Service?
Medium536A pod is unable to resolve the DNS name of a Service in the same namespace. The pod's /etc/resolv.conf shows 'nameserver 10.96.0.10'. What is the most likely cause?
Medium537A pod is running but not responding to requests. The developer suspects the liveness probe is misconfigured. Which command can they use to check the probe configuration of a running pod?
Medium538Which THREE of the following are valid Ingress pathTypes in Kubernetes networking.k8s.io/v1?
Medium539A pod with a liveness probe using 'httpGet' is restarting repeatedly. The probe checks '/healthz' on port 8080. The application is healthy and responds with HTTP 200. What is the most likely cause?
Medium540You create a ResourceQuota in a namespace that sets requests.cpu: '1' and limits.cpu: '2'. A pod spec has no resource limits or requests. What happens when you try to create this pod?
Medium541You are using Helm to manage a chart. Which commands are valid to list installed releases? (Choose TWO)
Medium542A pod in the 'production' namespace is in a CrashLoopBackOff state. The pod has been running successfully for several days. You run 'kubectl describe pod app-pod -n production' and see the message: 'OOMKilled'. What is the MOST appropriate action to resolve this issue?
Medium543A company wants to deploy a stateful database cluster where each pod has its own persistent storage. They need stable network identities and ordered pod creation. Which resource should they use?
Medium544A pod in the 'staging' namespace is in a CrashLoopBackOff state. You run 'kubectl logs pod -n staging' and see: 'Error: container has been OOMKilled'. The pod YAML has resources: requests: memory: 256Mi, limits: memory: 256Mi. Which change should you make first?
Medium545A developer is defining a Pod that uses an init container to prepare a shared volume before the main application container starts. The init container must download configuration files into an emptyDir volume, and the main container must read them. Which TWO statements about this Pod design are correct? (Choose two.)
Hard546Which Service type is used to expose a Service on a static port on each node in the cluster?
Easy547You want to expose a Deployment 'app' externally on port 30080 on each node. What service type should you use?
Medium548A developer needs to deploy a container that runs a batch job to process data once and then exit. The job should be restarted only if it fails. Which Kubernetes resource should be used?
Easy549A Deployment has replicas: 3 and uses a ConfigMap. The ConfigMap is updated. The developer wants to update the pods to use the new ConfigMap without recreating the Deployment. What is the correct approach?
Hard550Which command creates a TLS secret named 'tls-secret' using certificate file 'tls.crt' and key file 'tls.key'?
Medium551Which 'kubectl' command creates a pod named 'test-pod' using the nginx image and outputs the YAML manifest without actually creating it?
Easy552You create a ConfigMap named 'app-config' with the command 'kubectl create configmap app-config --from-literal=key1=value1'. Which of the following correctly mounts this ConfigMap as environment variables in a pod?
Easy553You are tasked with running a batch job that processes 100 items in parallel, using a Kubernetes Job. The Job should ensure that all items are processed even if some pods fail, and the total number of pod failures should be limited to 3. Which Job configuration is correct?
Hard554Which TWO of the following are valid uses of init containers? (Select 2)
Medium555What is the purpose of the `IngressClass` resource in Kubernetes?
Medium556A headless service is created with 'clusterIP: None'. What is the primary use case for such a service?
Medium557You have a Deployment named 'web-app' with 5 replicas. You run the command: kubectl set image deployment/web-app web-app=nginx:1.25. Which command can you use to monitor the progress of the rollout?
Easy558A Deployment is configured with 'resources.requests.memory: 256Mi' and 'resources.limits.memory: 512Mi'. The node runs out of memory. Which pods will be the first to be evicted?
Medium559A CronJob is configured with 'concurrencyPolicy: Forbid'. What happens if the scheduled time arrives while the previous job is still running?
Medium560Which Service type exposes a Service externally via each Node's IP on a static port?
Easy561Which TWO commands can be used to update the image of a Deployment? (Select two)
Medium562You have a Deployment that is currently paused. You want to resume the rollout and then check the status of the rollout. Which set of commands should you run?
Hard563Which of the following is a valid YAML snippet for a container that sets the seccomp profile to 'RuntimeDefault' in a PodSecurityContext?
Hard564A pod named 'web' is in a CrashLoopBackOff state. You suspect the application is failing due to a configuration error. You want to see the logs from the previous instance of the container. Which command should you use?
Medium565You create a Service with the following manifest. What is the effect? service.yaml: apiVersion: v1 kind: Service metadata: name: ext-svc spec: type: ExternalName externalName: db.example.com
Medium566You need to run a database migration as a container before the main application container starts. Which Kubernetes concept should you use?
Medium567A pod has 'automountServiceAccountToken: false' in its spec. What is the effect?
Medium568You create a headless service with 'clusterIP: None' for a StatefulSet. How does a client discover the individual pod IPs?
Hard569Which THREE of the following are true about NetworkPolicy? (Select 3)
Hard570Which TWO of the following are valid ways to expose a Deployment named 'web' as a Service?
Medium571A developer wants to tag a local image 'myapp:latest' with the tag 'v1.0.0' for pushing to a registry. Which command does this?
Medium572What is the difference between 'kubectl apply' and 'kubectl create'?
Easy573A CronJob is configured with concurrencyPolicy: Forbid. The scheduled job takes longer than the interval between schedules to complete. What happens when the next scheduled time arrives while the previous job is still running?
Hard574In a Dockerfile, what is the difference between CMD and ENTRYPOINT?
Easy575A developer needs to expose a database password to a Pod as an environment variable, securely. What should they do?
Easy576Arrange the steps to create a ConfigMap from a file and mount it as a volume in a Pod.
Medium577You have a Service named 'app-service' in namespace 'default'. You want a pod in namespace 'monitoring' to resolve the service DNS name. What is the correct fully qualified domain name (FQDN)?
Hard578You want to see a list of all events in the 'default' namespace, sorted by timestamp. Which command should you use?
Easy579You are debugging a pod that is running but not responding to network requests on port 8080. You suspect the application inside the container is faulty. You need to run an interactive shell inside the container to inspect the process. Which command should you use?
Medium580Which THREE statements about ResourceQuota are correct? (Select 3)
Hard581Which TWO Service types allow external access to pods from outside the Kubernetes cluster? (Select 2)
Easy582A user wants to create a Kubernetes Secret for storing Docker registry credentials (username and password). Which type of Secret should they use?
Medium583Which commands list all Helm releases in the current namespace? (Select all that apply)
Easy584An Ingress resource uses the annotation 'kubernetes.io/ingress.class: nginx'. However, traffic is not being routed. The cluster has multiple ingress controllers. What is the most likely cause?
Hard585During a canary deployment, you want to send 10% of traffic to the new version. You have two Deployments: 'app-stable' (version: stable) and 'app-canary' (version: canary). You use a Service with label selector 'app: myapp' and a second selector for version. How can you achieve the 10% traffic split?
Hard586You need to debug a pod that is running but not serving traffic. You want to add a temporary container with networking tools to the pod. Which command should you use?
Hard587You need to create a Pod that runs with a specific non-root user (UID 1000), prevents privilege escalation, and mounts the container's filesystem as read-only. Which securityContext field is NOT required to achieve these requirements?
Hard588A Helm chart is installed with the command 'helm install myapp ./mychart'. You need to upgrade the release with new values from a file 'prod-values.yaml'. Which command is correct?
Medium589Which TWO of the following are valid non-interactive methods to update a Deployment's image?
Easy590Which probe type is used to determine if a container is ready to serve traffic?
Easy591Which command is used to undo the most recent rollout of a Deployment named 'myapp'?
Easy592Which file prevents certain files from being copied into a Docker image during a build?
Easy593You are using Kustomize. Your kustomization.yaml file specifies a base and an overlay. You run: kubectl apply -k overlays/production. What happens?
Medium594A developer is deploying a web application that requires 2 GiB of memory and 0.5 CPU cores. The cluster nodes have 4 GiB of memory and 2 CPU cores each. The developer wants to ensure the pod gets guaranteed QoS class. Which resource specification should be used?
Easy595Which command lists all the secrets in the current namespace?
Easy596You need to debug a pod that has no shell installed. You want to add a temporary container with debugging tools to the pod. Which command should you use?
Hard597You have just applied a new Deployment configuration using 'kubectl apply -f deployment.yaml'. You want to see the latest revision number of the rollout. Which command should you run?
Medium598You have a Deployment 'web' with 'maxSurge: 25%' and 'maxUnavailable: 25%'. Current replicas is 4. You update the image. How many pods will be created at most during the rollout?
Medium599Which TWO of the following are valid methods to perform a blue-green deployment in Kubernetes?
Medium600A security requirement states that a container must run with a read-only root filesystem. Which field must be set in the container's securityContext?
Hard601You have an Ingress with TLS configured. The Ingress controller returns a certificate error when accessing via HTTPS. The secret 'my-tls' exists in the same namespace. Which of the following is the most likely cause?
Hard602Order the steps to expose a Kubernetes Deployment as a ClusterIP Service.
Medium603Which TWO are valid ways to create a Service from a deployment named 'frontend'? (Choose two.)
Hard604Which of the following Dockerfile instructions sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions?
Easy605Which TWO commands can be used to view the rollout history of a Deployment?
Medium606Refer to the exhibit. A user has created the Service shown. The application pods listen on port 8080. Which port should an external client use to access the application from outside the cluster?
Easy607You have a Deployment with 3 replicas. The pods have a readiness probe that checks an HTTP endpoint /ready. One pod's readiness probe is failing. What will happen?
Hard608A developer creates a pod with the following YAML snippet: securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 The pod mounts an emptyDir volume. What is the owner and group of the mounted directory inside the container?
Medium609You have a Dockerfile with 'CMD ["nginx", "-g", "daemon off;"]'. A developer wants to run the container with a different command: 'nginx -t'. How should they run the container?
Medium610Which THREE of the following are valid fields in a Helm chart's values.yaml file that can be used in templates?
Hard611A namespace 'team-a' has a ResourceQuota with 'pods: 10' and a LimitRange with default memory request '256Mi'. A user creates a pod with no resource requests. What happens?
Hard612A pod in namespace 'app' needs to resolve the DNS name 'db-service.data.svc.cluster.local'. What is the likely namespace of the 'db-service' Service?
Hard613Which TWO statements are true about Kubernetes Secrets?
Medium614You need to perform a canary deployment where 10% of traffic goes to the new version. You have a Deployment 'app-v1' with 9 replicas and 'app-v2' with 1 replica. What must be true for the Service to distribute traffic roughly 90/10?
Medium615A pod uses a liveness probe with exec command 'cat /tmp/healthy'. The file /tmp/healthy exists initially but is deleted by the application after 60 seconds. Which behavior will occur?
Medium616A Pod has the following environment variable definition: - name: DB_HOST valueFrom: configMapKeyRef: name: db-config key: host The ConfigMap 'db-config' exists in the same namespace but does not have a key 'host'. What will happen when the Pod starts?
Medium617You have a CronJob that runs a backup every hour. Due to a network issue, some backups take longer than an hour, causing overlapping executions. You want to ensure that if a new job is scheduled while the previous one is still running, the new job is skipped. Which concurrencyPolicy should you set?
Hard618You need to get a list of all events in the cluster sorted by timestamp. Which command should you use?
Easy619An administrator runs 'kubectl apply -f deployment.yaml' and later wants to revert to the previous configuration. Which approach is correct?
Hard620A Pod named `my-pod` in namespace `ns1` tries to resolve `svc-a.ns2.svc.cluster.local`. The DNS query fails. The Service `svc-a` exists in namespace `ns2`. What is the most likely cause?
Hard621Which TWO statements about Kubernetes Services are correct?
Medium622What is the correct command to forward a local port to a pod for debugging?
Easy623You want to use Kustomize to apply a patch that adds a sidecar container to all pods in a Deployment. Which Kustomize feature should you use?
Hard624Which TWO instructions are commonly used to add files to a Docker image during build? (Select 2)
Easy625Which TWO of the following are true about Kustomize overlays? (Select 2)
Medium626You are using the Recreate strategy for a Deployment. What happens during an update?
Medium627You need to create a ConfigMap named 'app-config' from a file 'config.properties'. Which kubectl command should you use?
Easy628What is the primary purpose of a headless Service (clusterIP: None) in Kubernetes?
Medium629You have a multi-container pod with two containers: container-A and container-B. container-B needs to access the network of container-A. Which configuration is required?
Hard630A Pod is running but not responding to requests. The liveness probe is a TCP check on port 8080. What is the most likely issue?
Hard631You want to update a Deployment's image to a new version, ensuring that at most 2 pods are unavailable during the rollout. Which field in the Deployment spec should you set?
Easy632Which THREE of the following are correct about init containers? (Select THREE.)
Hard633An init container in a pod runs a database migration script. The init container fails and exits with a non-zero exit code. What will happen to the pod?
Easy634A pod is stuck in 'Pending' state. You run 'kubectl describe pod pending-pod' and see the following condition: 'Status: False, Type: PodScheduled, Reason: Unschedulable, Message: 0/4 nodes are available: 1 node(s) had taint {node.kubernetes.io/disk-pressure: }, 1 node(s) had taint {node.kubernetes.io/memory-pressure: }, 2 node(s) didn't match Pod's node affinity/selector.' What is the most specific reason the pod cannot be scheduled?
Medium635You have a Pod with two containers: a main application and a sidecar that handles logging. The sidecar needs access to the same log files as the main application. Which volume type allows both containers to share files?
Medium636Which of the following is a valid method to perform a blue-green deployment in Kubernetes?
Easy637Which of the following is true about Istio as a service mesh?
Medium638A developer needs to expose a deployment named 'web-app' running in the 'default' namespace on port 8080 internally within the cluster. Which kubectl command creates a ClusterIP service that selects pods with label 'app: web'?
Medium639Which command is used to scale a Deployment named 'web' to 5 replicas?
Easy640Which TWO of the following are true about .dockerignore files?
Medium641Which TWO are valid ways to expose a Secret's data as environment variables in a pod?
Medium642How can you set the environment variable 'DATABASE_URL' in a pod to the value stored in a Kubernetes Secret named 'db-secret' under the key 'url'?
Easy643An administrator wants to allow ingress traffic to pods with label 'app: database' only from pods with label 'app: api' in the same namespace. Which NetworkPolicy rule is correct?
Medium644An admin applies the following NetworkPolicy: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress - Egress What effect does this policy have?
Medium645Which of the following is the correct way to set a CPU request of 250 millicores and a memory limit of 512 Mi in a container?
Easy646You apply a Pod Security Admission label 'pod-security.kubernetes.io/enforce: restricted' to a namespace. A pod with the following securityContext is created: securityContext: runAsUser: 1000 runAsNonRoot: true capabilities: drop: ["ALL"] seccompProfile: type: RuntimeDefault allowPrivilegeEscalation: false readOnlyRootFilesystem: true Will the pod be admitted?
Hard647A deployment runs a container that needs to read a file from a host path '/var/log/app' on the node. The file must be available to all pods on that node. Which volume type should be used?
Medium648Which THREE of the following are valid reasons to use an annotation in Kubernetes?
Medium649You want to ensure your application shuts down gracefully when a pod is terminated. The application needs 30 seconds to clean up. Which field should you set in the pod spec?
Medium650In a Deployment YAML, which field defines the number of pods to run?
Easy651Based on the exhibit, what should you do to determine why the container is failing?
Medium652You have a Deployment that uses the 'Recreate' strategy. What happens when you update the pod template (e.g., change the image)?
Medium653You are debugging a network issue: a pod 'frontend' cannot reach a service 'backend' in the same namespace. The service endpoints are empty. What is the most likely cause?
Hard654You have a multi-stage Dockerfile. The first stage builds a binary using a large build image. The second stage copies the binary from the first stage into a minimal runtime image. Which Dockerfile instruction is used to copy artifacts from a previous stage?
Medium655Which TWO statements about NetworkPolicy are correct? (Choose two.)
Medium656An Ingress resource has the following annotation: 'kubernetes.io/ingress.class: nginx'. What is the purpose of this annotation?
Hard657An Ingress is configured for host-based routing with two hosts: 'app1.example.com' and 'app2.example.com'. A request to 'app1.example.com' should go to service 'svc1'. Which field in the Ingress spec specifies the host?
Medium658A developer runs 'kubectl run nginx --image=nginx --port=80' and then creates a Service with the following YAML: apiVersion: v1 kind: Service metadata: name: nginx-svc spec: selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80 However, the Service has no endpoints. What is the most likely cause?
Medium659Which TWO parameters can be configured for a probe to control its behavior? (Choose two.)
Medium660You have a Helm release named 'myapp' that was installed. You need to see all the releases in the current namespace. Which command do you run?
Easy661A Deployment named 'web' runs in namespace 'prod'. The team wants every container in that Deployment to receive the environment variable 'LOG_LEVEL' from the ConfigMap 'app-config' key 'log.level', and the ConfigMap may be updated later. The application reads environment variables only at startup. Which single change to the Deployment's Pod template actually delivers the value?
Medium662A pod has securityContext with capabilities.add: ['NET_ADMIN'] and capabilities.drop: ['ALL']. What effective capabilities does the container have?
Hard663Which of the following YAML fields can be used to mount a Secret as a volume in a Pod?
Easy664You want to deploy an application with zero downtime by using a blue-green deployment pattern. Which Kubernetes resources are essential for implementing this strategy?
Easy665You have a Service that exposes a Deployment. Some pods are not receiving traffic. 'kubectl get endpoints my-service' shows only 2 out of 3 pod IPs. What is the most likely cause?
Hard666You want to view the events related to a specific pod named 'my-pod' in the 'default' namespace. Which command filters events to show only those pertaining to this pod?
Medium667Which THREE of the following are correct about Kustomize?
Hard668Which Service type is used to expose a service externally on a static port on each worker node?
Easy669You need to debug a Service that is not routing traffic to its endpoints. Which command shows the current endpoints of a Service?
Medium670You are troubleshooting a service connectivity issue. You have a pod named 'client' and a service named 'server'. You want to check if the service's endpoints are populated. Which command should you run?
Medium671You run 'kubectl apply -f deployment.yaml' and later 'kubectl replace -f deployment.yaml' on the same file. What is the difference?
Medium672You need to access a database pod 'db-pod' on port 5432 from your local machine. Which command forwards local port 15432 to the pod's port 5432?
Medium673You need to create a Secret to store a TLS certificate and private key for use by an Ingress resource. Which two statements are correct? (Choose two.)
Medium674Which TWO of the following commands can be used to view events related to a specific pod? (Select TWO.)
Medium675A developer reports that a container in a pod is not responding correctly. You need to get an interactive shell in the container to investigate. Which command should you run?
Hard676An administrator creates a Pod with an ephemeral container using 'kubectl debug my-pod -it --image=busybox --target=my-container'. The ephemeral container shares the same process namespace as the target container. Which flag enables this?
Hard677Which THREE are valid patterns for multi-container Pods?
Hard678You have a headless Service for a StatefulSet. What is the DNS resolution behavior for the StatefulSet pods?
Medium679Which of the following is the correct way to set a memory limit of 512Mi for a container in a pod spec?
Medium680You run 'kubectl get pods -o wide' and see that a pod 'worker-pod' is in 'Completed' state with 'Restart Count: 5'. The pod's restart policy is 'OnFailure'. What is the most likely reason the pod has restarted 5 times?
Hard681What is the primary purpose of a Kubernetes ServiceAccount?
Easy682You want to see detailed information about a node's resource usage. Which command should you run?
Easy683You run 'kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml'. What is the output?
Medium684A pod uses a ServiceAccount with automountServiceAccountToken set to false. The pod still needs to access the Kubernetes API. How can you mount the service account token in this pod?
Medium685Which two commands can create a ConfigMap from an environment file? (Select TWO.)
Easy686Which command shows resource usage (CPU and memory) for pods?
Easy687A Pod is configured with a securityContext that sets runAsUser: 1000 and runAsGroup: 3000 at the pod level. A container within that Pod has its own securityContext that sets runAsUser: 2000 but does not set runAsGroup. The container process attempts to create a file in a directory owned by group 3000 with group write permissions. Which two statements are true regarding the effective user and group of the container process? (Choose two.)
Hard688You are tasked with building a container image for a Node.js application. The Dockerfile must first install system dependencies, then copy application code, and finally run the app. Which of the following Dockerfiles is correct?
Medium689Which command creates a Docker registry secret from an existing Docker config file?
Easy690Which YAML snippet correctly defines a CronJob that runs a task every 5 minutes?
Easy691What is the correct apiVersion for a Kubernetes Job in v1.29?
Easy692You have created a HorizontalPodAutoscaler (HPA) for a Deployment. The HPA is configured with targetCPUUtilizationPercentage: 50. The current CPU utilization is 80%. What will the HPA do?
Medium693A Deployment has a rolling update strategy with maxSurge: 1 and maxUnavailable: 0. The Deployment has 4 replicas. During a rollout, what is the maximum number of pods that can exist at any point?
Hard694You need to view metrics from a Pod running a web server. Which approach follows Kubernetes best practices?
Easy695Which TWO of the following are valid ways to expose a Service externally in a Kubernetes cluster?
Medium696You want to perform a blue-green deployment using Deployments and Services. You have two Deployments: 'app-blue' (current) and 'app-green' (new). The Service 'app-service' currently selects pods with label 'version: blue'. What kubectl command should you run to switch traffic to the green deployment?
Medium697A Secret named 'db-secret' of type Opaque contains a key 'password'. How do you reference this key as an environment variable named 'DB_PASSWORD' in a pod spec?
Easy698Which command correctly creates a Role named 'pod-reader' that allows get, list, and watch on pods?
Medium699You have a Dockerfile that uses a multi-stage build. Which of the following statements about multi-stage builds is correct?
Medium700You want to restrict ingress traffic to pods with label 'app: web' in namespace 'frontend' to only come from pods in namespace 'backend'. Which NetworkPolicy YAML is correct?
Hard701A pod in namespace 'default' cannot resolve the service name 'db' in namespace 'data'. Which DNS name should the pod use to reach the service?
Medium702You apply the following Ingress manifest: ``` apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-ingress spec: ingressClassName: nginx rules: - host: app.example.com http: paths: - pathType: Prefix path: / backend: service: name: app-svc port: number: 80 ``` What is missing to enable TLS termination for this Ingress?
Medium703You are tasked with improving the observability of a microservices application running in Kubernetes. The application is deployed with multiple replicas and experiences occasional high latency. Which TWO actions should you take to gain better insight into the application's performance?
Hard704Which of the following is true about headless services?
Easy705A developer is building an image for a Node.js application. The Dockerfile currently copies package.json and package-lock.json, runs npm ci, then copies the rest of the source code. They want to ensure that rebuilding the image after only editing application source files does not re-run npm ci. Which statement about Docker layer caching explains why this Dockerfile ordering achieves that goal?
Medium706A developer creates a Dockerfile with the following content: FROM alpine:3.18 COPY app.sh /app.sh RUN chmod +x /app.sh CMD ["/app.sh"] They want to override the command to run '/app.sh --debug' when deploying the container in Kubernetes. Which of the following pod spec fields should they use?
Medium707You run 'kubectl get pods' and see that a pod is in 'Pending' state. What is the most likely cause?
Medium708You are troubleshooting a Pod that cannot start because it fails with 'Error: container has runAsNonRoot and image will run as root'. The Pod's SecurityContext has 'runAsNonRoot: true' and no explicit 'runAsUser'. Which three actions could resolve this? (Choose three.)
Hard709A pod named 'webapp' is stuck in 'Pending' state. 'kubectl describe pod webapp' shows '0/1 nodes are available: 1 Insufficient memory'. What is the most likely cause?
Medium710You have a pod with two containers: one runs a web server, and the other is a sidecar that logs the web server's output to a central logging system. Which pattern does this represent?
Medium711A Pod is stuck in CrashLoopBackOff. You run 'kubectl logs mypod' and get no output. What is the most likely cause?
Medium712Which kubectl command shows detailed information about a pod, including events, labels, and container state?
Easy713You have a Deployment that must run a legacy application that takes up to 5 minutes to start. You need to ensure the liveness probe does not kill the container prematurely. Which probe configuration should you use?
Hard714A pod uses a ServiceAccount 'my-sa' but the pod's container needs to list pods in the namespace. Which RBAC resources are necessary?
Medium715Which of the following commands creates a LoadBalancer Service named `web-svc` for a Deployment named `web` on port 80?
Easy716A Service of type LoadBalancer is created but the external IP remains <pending>. What is the most likely reason?
Hard717You need to perform a canary deployment using a Service and two Deployments (stable and canary). Which TWO resources or configurations are typically used to route a percentage of traffic to the canary? (Select TWO)
Hard718You have a Helm chart for an application. After running 'helm install my-release ./mychart', you realize you forgot to set a required value. Which command can you use to update the release with the correct value while keeping the same chart version?
Hard719You have a Deployment named 'web-app' with 3 replicas. You want to expose the pods on port 80 internally within the cluster using a ClusterIP service. Which kubectl command should you use?
Medium720A Deployment named 'app' has the following strategy: type: RollingUpdate with maxSurge=1 and maxUnavailable=0. You have 5 replicas. During a rolling update, how many pods will be running at any given time?
Medium721A pod is scheduled but remains in 'Pending' state. Running 'kubectl describe pod mypod' shows: '0/1 nodes are available: 1 Insufficient memory'. What is the most likely cause?
Easy722You have a service account 'my-sa' in the default namespace. You want a pod to use this service account and also prevent the pod from mounting the service account token. Which pod spec configuration is correct?
Medium723Which command creates a Service named 'my-svc' that exposes a deployment named 'my-deploy' on port 80?
Easy724What is the purpose of an init container in a pod?
Easy725Which field in a CronJob spec specifies the maximum number of successful jobs that should be retained?
Easy726Which TWO statements about Kubernetes Services are correct? (Choose two.)
Medium727You are deploying a Pod that contains two containers: a web server and a file sync agent. The file sync agent needs to run as long as the web server is running and should share the same network namespace. Which design pattern does this represent?
Hard728You are using Helm to manage an application. After running 'helm install myapp ./mychart', you notice that the application is running but you need to change a configuration value. Which command should you use to update the release?
Hard729Which TWO of the following are valid ways to consume environment variables from a ConfigMap in a pod?
Medium730You need to run a batch job that processes 100 items. The job should be considered complete when all items are processed successfully. You want to run up to 10 pods concurrently. Which job configuration is correct?
Medium731Which of the following commands creates a ClusterIP service named 'my-service' that exposes port 80 on the pod with label 'app=web'?
Easy732You need to scale a Deployment named 'api' to 10 replicas instantly. Which command should you use?
Easy733Which kubectl command creates a Secret named 'db-secret' with key 'password' and value 'mypwd'?
Easy734A Pod with an init container and a main container is created. The init container runs a script that takes 10 seconds. The main container's startupProbe has initialDelaySeconds: 5. When does the startupProbe begin?
Hard735Consider the following partial Dockerfile: FROM alpine:3.18 AS builder RUN apk add --no-cache curl COPY src /app/src RUN make /app/bin FROM alpine:3.18 COPY --from=builder /app/bin /app/bin CMD ["/app/bin"] What is the primary benefit of this multi-stage build?
Hard736Which field in a Deployment's rolling update strategy controls the maximum number of pods that can be created above the desired replicas during a rolling update?
Medium737You have a pod that takes 2 minutes to start its application. You want to avoid the liveness probe from killing the pod during startup, but still have it active afterward. Which probe should you add to the pod spec?
Hard738What is the purpose of a HorizontalPodAutoscaler (HPA)?
Easy739A developer configures a liveness probe for a container that takes a long time to start (about 120 seconds). The probe uses httpGet on port 8080 with a path '/healthz'. The probe is configured with initialDelaySeconds=10, periodSeconds=10, failureThreshold=3. The pod enters CrashLoopBackOff. What is the MOST likely cause?
Hard740You need to create a Job that runs a single task to completion. Which kubectl command correctly creates a Job named 'data-processor' that runs the image 'myapp/processor:1.0'?
Easy741You want to enforce that all pods in a namespace run with the 'restricted' Pod Security Standard (Pod Security Admission). Which label should you set on the namespace?
Hard742Which THREE statements about Dockerfile CMD and ENTRYPOINT are correct?
Hard743You have a Deployment named 'api' with 3 replicas. You need to ensure that new pods are not added to the Service's endpoints until the application is ready to serve traffic. Which probe configuration should you add to the pod spec?
Hard744When performing a rolling update of a Deployment, which field in the Deployment spec controls the maximum number of Pods that can be created above the desired replicas during the update?
Medium745You run 'kubectl rollout undo deployment/app'. What happens?
Medium746You need to set environment variables in a pod from a ConfigMap 'app-config' that has keys 'APP_ENV' and 'APP_DEBUG'. Which approach exposes all keys as environment variables?
Medium747Which of the following is the correct way to set an environment variable 'APP_COLOR' from a ConfigMap key 'color'?
Easy748You have a Job that runs a batch process. The Job YAML is as follows: apiVersion: batch/v1 kind: Job metadata: name: batch-job spec: parallelism: 4 completions: 12 backoffLimit: 2 template: spec: containers: - name: worker image: myapp:latest restartPolicy: Never If one pod fails after 3 successful completions, and the Job has already completed 7 successes, how many pods will be running at that point? Assume no other failures.
Hard749A pod has two containers: a web server and a sidecar that scrapes logs. The sidecar container needs to read log files written by the web server. How should the logs be shared between the containers?
Medium750To mount a ConfigMap as a volume, which field type must be used in the pod spec's volumes and volumeMounts?
Easy751A pod manifest includes the following securityContext: securityContext: { runAsUser: 1000, runAsGroup: 3000, fsGroup: 2000 }. What UID will be used for processes in the container?
Medium752Which of the following Ingress controllers is commonly used in Kubernetes?
Easy753You are implementing a canary deployment for a microservice named 'api'. The stable version is deployed as 'api-stable' with label 'version: stable'. You create a canary Deployment 'api-canary' with label 'version: canary'. Both Deployments have the same label 'app: api'. You want a Service 'api-svc' to route 90% of traffic to stable and 10% to canary. Which Service configuration achieves this?
Hard754Which kubectl command creates a Secret from literal username and password values?
Easy755A developer wants to view the resource usage of all containers in a specific pod. Which command should they use?
Easy756You need to mount a Secret 'db-secret' as a volume in a pod, making its keys appear as individual files. Which volume definition is correct?
Medium757Which THREE of the following are valid patterns for multi-container pods?
Medium758Which Dockerfile instruction sets a default command that can be overridden by arguments passed to 'docker run'?
Easy759Which kubectl command streams logs from a pod named 'web-pod' in real-time?
Easy760You need to check the resource usage of nodes and pods in your cluster. Which TWO commands should you use? (Choose two)
Medium761A NetworkPolicy with the following spec is applied to a namespace. What is the effect? spec: podSelector: {} policyTypes: - Ingress - Egress ingress: - from: - ipBlock: cidr: 10.0.0.0/8 except: - 10.0.1.0/24 egress: - to: - ipBlock: cidr: 0.0.0.0/0
Hard762You need to forward a local port to port 8080 on a pod named 'my-pod' in the 'default' namespace. Which kubectl command should you use?
Easy763You want to debug a pod that has no shell or debugging tools installed. Which feature allows you to temporarily add a sidecar container with debugging tools to a running pod?
Medium764A pod is stuck in Pending state. You run 'kubectl describe pod my-pod' and see the event: '0/4 nodes are available: 1 Insufficient cpu, 3 Insufficient memory'. What is the most likely cause?
Medium765The Pod 'myapp' is in CrashLoopBackOff. Based on the exhibit, what is the most likely cause?
Hard766The exhibit shows a Deployment manifest. When applied, the pods are created but show 'CrashLoopBackOff'. What is the most likely cause?
Easy767You have a Kustomize overlay that sets 'replicas: 5' in a patch, but the base Deployment has 'replicas: 3'. What is the final number of replicas after applying 'kubectl apply -k overlay/'?
Medium768You want to expose a Deployment named 'nginx' on port 80 using a LoadBalancer service. Which YAML snippet is correct?
Easy769Which of the following Service types exposes a pod on a static port on each node's IP address?
Easy770A pod named 'db-backup' is in CrashLoopBackOff. The team needs to understand why it keeps crashing. Which approach should be taken first to diagnose the issue?
Medium771A user runs 'kubectl get endpoints my-service' and sees no endpoints listed. The service has a selector 'app: my-app'. Pods with that label exist and are running. What is the most likely cause?
Medium772You have a Deployment with 3 replicas. You create a Service with 'clusterIP: None'. What is the effect on pod DNS?
Medium773You are asked to implement a blue-green deployment using Kubernetes Deployments and Services. You have a blue Deployment with label 'version: blue' and a green Deployment with label 'version: green'. Both have selector 'app: myapp'. You need a Service that initially points to blue. How should you configure the Service to switch to green without downtime?
Hard774A developer wants to enforce that containers in a namespace cannot run as privileged. Which Pod Security Standard profile should they apply to the namespace?
Medium775Which TWO commands can be used to create a resource from a YAML file?
Medium776You want to see all events in the default namespace sorted by timestamp. Which command should you use?
Easy777Which THREE of the following are valid fields in a NetworkPolicy spec?
Hard778A container in a pod is crashing repeatedly. You want to see the logs from the previous (crashed) instance of the container. Which command should you use?
Medium779Which command forwards local port 8080 to port 80 of a pod named 'web-pod'?
Medium780You need to view resource usage (CPU and memory) for all pods in the 'default' namespace. Which command should you use?
Easy781Based on the exhibit, why is the container being killed and restarted?
Hard782You are a platform engineer at a company that runs a microservices architecture on Kubernetes. The application consists of a frontend service (Node.js), a backend API (Go), and a PostgreSQL database. All components are deployed in the same namespace 'production'. Recently, the backend API has been experiencing intermittent 503 errors from the frontend. The backend API Pods have CPU limits set to 500m and memory limits to 256Mi. The backend API exposes metrics at /metrics and has a liveness probe (HTTP GET /healthz) and a readiness probe (HTTP GET /ready). You notice that during traffic spikes, the backend API Pods are restarted frequently. You examine the metrics and see that memory usage spikes to 250Mi during high load. What is the most likely cause of the restarts and 503 errors?
Hard783A Deployment has replicas: 5. During a rolling update, the developer sets maxSurge: 2 and maxUnavailable: 1. What is the maximum number of pods that can be running during the update?
Hard784A developer has a Dockerfile that builds a Go application. The final image size is 800MB. Which improvement would MOST reduce the image size?
Medium785You run the following command: 'kubectl run nginx --image=nginx --restart=Never'. What Kubernetes resource is created?
Medium786A pod must run with a seccomp profile that only allows specific syscalls. Which SecurityContext field is used to specify the seccomp profile type?
Hard787An Ingress resource uses host-based routing. Which field in the Ingress YAML specifies the host header to match?
Hard788Which FOUR of the following are valid probe handlers in Kubernetes?
Medium789A developer wants to ensure that a critical application always runs on every node in the cluster. Which resource should they use?
Easy790A Job must run exactly 3 Pods in parallel. Which Job manifest field achieves this?
Medium791Which TWO of the following are valid ways to expose a Secret as an environment variable in a pod? (Select two.)
Medium792Which kubectl command forwards local port 8080 to port 80 of a pod named 'web-pod'?
Easy793You want to enforce that all pods in a namespace have a minimum memory request of 100Mi and a maximum memory limit of 1Gi. Which resource should you create?
Medium794You need to allow ingress traffic to pods with label 'app: web' from pods with label 'role: frontend' in the same namespace, and also from any pod in namespace 'monitoring'. Which NetworkPolicy egress/ingress rule correctly implements this?
Hard795You have a Deployment with a liveness probe that fails intermittently, causing the pod to restart. You want to reduce the sensitivity of the probe so that it only restarts after 3 consecutive failures. Which probe parameter should you adjust?
Hard796Which THREE of the following are correct about the .dockerignore file? (Select 3)
Hard797Which instruction in a Dockerfile sets the default command to run when the container starts, but allows overriding?
Easy798An Ingress resource has the following spec. What is the effect? spec: tls: - hosts: - myapp.example.com secretName: myapp-tls rules: - host: myapp.example.com http: paths: - path: / pathType: Prefix backend: service: name: myapp port: number: 80
Hard799You need to create a NetworkPolicy that denies all ingress traffic to pods with label 'app: db' in namespace 'prod'. Which YAML snippet correctly implements this?
Medium800A NetworkPolicy is applied to a namespace with the following rules: ``` apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress ``` What is the effect on pods in that namespace?
Hard801A developer wants to ensure a container runs as a non-root user with user ID 1000 and group ID 2000. Which SecurityContext fields should be set?
Medium802Which TWO statements about Kubernetes DNS are correct?
Hard803You need to create a Secret of type 'kubernetes.io/tls' for ingress. Which command is correct?
Hard804Which command streams logs from a pod in real-time?
Easy805A Pod spec includes 'securityContext' with 'runAsUser: 1000' and 'runAsGroup: 3000'. The container process inside the pod is expected to write to a mounted volume. Which securityContext field should be set to ensure the volume's group ownership is 3000?
Medium806A namespace 'test' has a LimitRange that sets default memory request to 256Mi and default memory limit to 512Mi. A pod in that namespace does not specify any resources. What memory request and limit will the pod get?
Medium807Which THREE components are essential for setting up Horizontal Pod Autoscaling (HPA) based on CPU utilization? (Select three)
Hard808You have a Deployment named 'frontend' with 3 replicas. You run 'kubectl rollout history deployment/frontend' and see revision 1 and revision 2. You want to rollback to revision 1. What command should you use?
Hard809An administrator creates a Role and RoleBinding in the 'dev' namespace to allow a ServiceAccount 'sa-dev' to list Pods. Which YAML snippet correctly defines the Role?
Hard810A Pod is running in a namespace with a ResourceQuota that sets 'limits.memory: 2Gi'. The pod's container spec has 'resources.limits.memory: 1Gi' and 'resources.requests.memory: 512Mi'. The pod is in 'Running' state but consumes 1.5Gi of memory. What happens?
Medium811You have a Deployment with strategy type: Recreate. You update the container image. What behavior will occur during the update?
Medium812A Secret of type kubernetes.io/tls requires two data keys. What are they?
Easy813An Ingress resource is defined as: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-ingress spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-service port: number: 80 tls: - hosts: - example.com secretName: tls-secret What must exist in the cluster for TLS termination to work?
Hard814Which TWO of the following are valid ways to consume a Secret named 'db-secret' in a Pod? (Choose two.)
Medium815You have a pod that is stuck in 'Pending' state. Which command would you run first to diagnose the issue?
Medium816An ingress resource is created with the following spec. Which request will be routed to the 'green' service? ```yaml spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: blue port: number: 80 - path: /api/v1 pathType: Exact backend: service: name: green port: number: 80 ```
Hard817Order the steps to update a Kubernetes Secret and ensure a Pod uses the new secret.
Medium818Which THREE are valid ways to expose a canary deployment for testing? (Select three)
Medium819You need to view the logs of a container named 'sidecar' inside a pod named 'app'. Which command should you use?
Easy820You need to create a Secret of type kubernetes.io/tls for use with an Ingress. Which kubectl command should you use?
Medium821Which TWO statements about Services are true? (Choose two.)
Medium822A Service of type NodePort is created with 'spec.ports[0].nodePort: 30080'. The cluster nodes have IPs 10.0.0.1, 10.0.0.2. Which command can be used to test connectivity to the Service from outside the cluster?
Medium823Which TWO statements about labels and selectors are correct? (Select TWO.)
Medium824You are performing a canary deployment using two Deployments: 'app-stable' (replicas: 9) and 'app-canary' (replicas: 1), both with label 'app: myapp'. A Service selects pods with 'app: myapp' and 'version: stable'. How can you route traffic to the canary?
Hard825You have a pod that needs to mount a Secret as a volume. The Secret has keys 'username' and 'password'. How should the volumes and volumeMounts be configured to mount the secret at /etc/secret with each key as a file?
Hard826Which TWO options are valid ways to tag an image when building with Docker?
MediumOther domains
All CKAD exam domains
Frequently asked questions
- What does the scenario questions domain cover on the CKAD exam?
- scenario questions questions test whether you can apply the concept in context, not just recognise a definition.
- How many questions are in this domain?
- This page lists all 826 scenario questions questions in the CKAD question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only scenario questions questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.