Courseiva

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.

826 questions210 easy385 medium231 hard

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.

1

Which command creates a ConfigMap named 'app-config' from a file named 'config.properties'?

Easy
2

A 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?

Medium
3

Which TWO of the following are valid fields in a Job spec? (Select TWO.)

Medium
4

A security requirement states: 'The container must drop all capabilities and add only NET_BIND_SERVICE'. Which YAML snippet correctly implements this in the securityContext?

Hard
5

Refer to the exhibit. A pod named 'app-backend-6b4c9d8f7-2x4z5' is in CrashLoopBackOff state. What is the MOST likely cause of this issue?

Easy
6

A 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?

Medium
7

You 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?

Medium
8

A container needs to run with the NET_ADMIN capability. Which securityContext field should be used?

Medium
9

A 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?

Medium
10

Which command scales a Deployment named 'web' to 5 replicas?

Easy
11

You 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?

Hard
12

A 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?

Medium
13

Match each Kubernetes probe to its check behavior.

Medium
14

A 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?

Medium
15

A 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?

Medium
16

A 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?

Medium
17

A 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?

Easy
18

A 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?

Hard
19

A 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?

Easy
20

A 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?

Easy
21

Which command creates an Opaque Secret named 'my-secret' with key 'password' and value 'p@ssw0rd'?

Easy
22

Given 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?

Hard
23

A 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?

Easy
24

Which annotation is used to enforce Pod Security Admission at the 'restricted' level on a namespace?

Medium
25

You 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?

Medium
26

Which two statements about ConfigMaps and Secrets are correct? (Select TWO.)

Medium
27

A Pod is in 'CrashLoopBackOff' state. 'kubectl logs mypod' shows: 'Error: listen tcp :8080: bind: address already in use'. What is the most likely cause?

Medium
28

When using 'kubectl expose', which flag creates a NodePort service?

Medium
29

Which THREE of the following are true about the 'kubectl describe pod' output? (Select 3)

Hard
30

Which TWO of the following are valid Ingress path types? (Select 2)

Easy
31

You have a Deployment with the following strategy: type: Recreate. What happens when you update the pod template?

Easy
32

An administrator needs to create a ConfigMap named 'app-config' from a file called 'config.properties'. Which kubectl command accomplishes this?

Medium
33

Which command exposes a deployment named 'web' as a ClusterIP service on port 80?

Easy
34

A 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?

Medium
35

What is the purpose of a readiness probe?

Easy
36

A developer wants to expose a set of Pods on a specific port on each node's IP. Which Service type should be used?

Easy
37

You 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/'?

Hard
38

A pod has a container with 'readOnlyRootFilesystem: true' in its securityContext. The container writes to /tmp. What is the expected outcome?

Medium
39

Which Kubernetes API version is used for creating a CronJob?

Easy
40

Which of the following are valid concurrencyPolicy values for a CronJob? (Select all that apply.)

Medium
41

Which Helm command installs a chart from a repository?

Easy
42

You want to block all ingress traffic to pods labeled 'app=api' except from pods labeled 'app=frontend'. Which NetworkPolicy rule is correct?

Medium
43

You 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?

Hard
44

You 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?

Medium
45

Which TWO are valid ways to debug a pod using ephemeral containers?

Easy
46

Which THREE of the following are correct statements about the terminationGracePeriodSeconds field? (Select 3)

Medium
47

A PodSecurityPolicy (PSP) has been replaced by Pod Security Admission. Which of the following commands applies a baseline pod security standard to the namespace 'dev'?

Medium
48

What is the effect of setting 'readOnlyRootFilesystem: true' in a container's securityContext?

Easy
49

You 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?

Hard
50

You 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?

Medium
51

You 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?

Easy
52

A 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?

Medium
53

A user runs 'kubectl run nginx --image=nginx --restart=Never' and the pod goes into 'Pending' state. What is a likely reason?

Medium
54

Which TWO practices optimize Docker image size? (Select 2)

Medium
55

You 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?

Hard
56

Which kubectl command can you use to pause a rolling update of a Deployment?

Medium
57

A 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?

Hard
58

Which TWO of the following are valid approaches to debug a pod that is in a CrashLoopBackOff state? (Select 2)

Hard
59

You create a Service with `kubectl expose deployment web --port=80 --target-port=8080`. What type of Service is created by default?

Easy
60

A 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?

Easy
61

A pod needs to run as a non-root user with UID 1000. Which SecurityContext field should be set?

Easy
62

A 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?

Hard
63

Which kubectl command creates a ConfigMap named 'app-config' from a file called 'config.properties'?

Easy
64

A 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?

Easy
65

A 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?

Medium
66

You 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?

Medium
67

Which THREE of the following are valid parameters for configuring probes? (Select 3)

Medium
68

Which THREE of the following are best practices for configuring readiness probes?

Hard
69

Which of the following is a correct Kustomize kustomization.yaml configuration for setting an image tag to 'v2'?

Hard
70

You 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?

Hard
71

You need to create a TLS secret for an ingress with certificate and key. Which command correctly creates the secret?

Hard
72

Which TWO of the following are correct methods to implement a canary deployment using Kubernetes resources?

Hard
73

Which TWO of the following conditions must be met for a RollingUpdate to proceed?

Hard
74

A 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?

Medium
75

Which probe type is used to indicate that a container is ready to serve traffic and should be added to Service endpoints?

Easy
76

Which THREE of the following are valid fields in a PodSecurityPolicy (PSP) that control Linux capabilities? (Select exactly 3)

Medium
77

A NetworkPolicy named 'default-deny-ingress' is applied to a namespace but contains no rules. What is the effect on pods in that namespace?

Medium
78

Which 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?

Easy
79

A 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?

Medium
80

A 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?

Hard
81

Which command is used to rollback a Deployment to the previous revision?

Easy
82

What is the purpose of a ResourceQuota in Kubernetes?

Easy
83

During 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?

Easy
84

You need to grant a ServiceAccount 'my-sa' read-only access to pods in the 'test' namespace. Which RBAC YAML should you create?

Medium
85

A 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?

Medium
86

A 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?

Easy
87

A 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?

Easy
88

A 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?

Easy
89

Which command outputs the pod's full YAML specification including status?

Medium
90

A 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?

Medium
91

You 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?

Medium
92

A StatefulSet named 'web' is created with 3 replicas. What is the DNS name for the second pod (index 1)?

Medium
93

You want to enforce a Pod Security Standard of 'restricted' in a namespace. Which command applies the correct label?

Hard
94

A CronJob is configured with 'concurrencyPolicy: Forbid'. If a job from the previous schedule is still running when the next scheduled time arrives, what happens?

Hard
95

You want to restrict total memory usage in a namespace to 10 Gi. Which resource should you create?

Medium
96

An 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?

Hard
97

Which THREE of the following are valid fields in a CronJob specification?

Hard
98

Which TWO statements about init containers are true?

Medium
99

You 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?

Hard
100

A 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?

Medium
101

You 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?

Medium
102

A 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?

Easy
103

A Deployment is configured with strategy type 'Recreate'. What happens during an update to the pod template?

Medium
104

You need to perform a rolling update of a Deployment named 'web-app' with a new image version. Which command should you use?

Easy
105

An admin wants to expose a Service only for internal cluster communication, without external access. Which Service type should they use?

Medium
106

You 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?

Medium
107

You want to ensure your containerized application handles SIGTERM gracefully and shuts down within 30 seconds. Which field should you set in the Pod spec?

Medium
108

You have a Helm release named 'my-app' that you want to revert to revision 3. Which command accomplishes this?

Medium
109

An admin creates a Service without a selector. Which of the following is true about such a Service?

Hard
110

You want to create a Deployment that runs 5 replicas of a web application. Which kubectl command should you use?

Medium
111

Which THREE statements about NetworkPolicy are correct? (Select 3)

Hard
112

What is the default Service type when creating a Service via 'kubectl create service' or YAML without specifying type?

Easy
113

You 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'?

Hard
114

You 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?

Medium
115

You 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?

Medium
116

A 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?

Hard
117

During 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?

Medium
118

A 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?

Hard
119

A 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?

Medium
120

A CronJob is configured with concurrencyPolicy: Forbid and schedule: '*/5 * * * *'. The first job takes 7 minutes. What happens when the next scheduled time arrives?

Hard
121

Which THREE of the following are valid parameters for a probe?

Medium
122

A 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?

Easy
123

A cluster administrator wants to enforce that no pod in namespace 'prod' uses more than 4Gi of memory. Which Kubernetes resource should be created?

Hard
124

Which TWO of the following are valid types of probes in Kubernetes? (Select 2)

Medium
125

You run 'kubectl port-forward pod/my-pod 8080:80'. What does this command do?

Medium
126

Which THREE of the following are valid fields in a Pod's container spec for resource management? (Choose three.)

Medium
127

A pod has an init container that fails. The status shows 'Init:CrashLoopBackOff'. The pod's restartPolicy is 'Always'. What happens to the init container?

Hard
128

Which THREE of the following are benefits of using a ResourceQuota in a namespace? (Select THREE)

Medium
129

Which TWO statements about readiness probes are correct? (Choose two.)

Medium
130

You have a Service named 'web' in namespace 'default'. Which DNS name resolves to the Service's ClusterIP?

Medium
131

You need to temporarily access a pod's HTTP endpoint on port 8080 from your local machine. Which command should you use?

Medium
132

When using 'kubectl apply' vs 'kubectl create', which statement is correct?

Medium
133

Which kubectl command is used to view the rollout history of a Deployment?

Easy
134

Which field in the container spec controls the time Kubernetes waits after sending SIGTERM before sending SIGKILL during pod shutdown?

Medium
135

You 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?

Medium
136

A 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?

Medium
137

A 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'?

Hard
138

You 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?

Medium
139

A 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?

Hard
140

A 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?

Medium
141

You 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?

Medium
142

Which TWO of the following are valid reasons for using a startup probe?

Hard
143

A 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?

Medium
144

A 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?

Hard
145

A 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?

Easy
146

A 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?

Easy
147

A 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?

Easy
148

A 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?

Medium
149

Which of the following is a valid NetworkPolicy that allows ingress traffic only from pods with label 'role: frontend' in any namespace?

Hard
150

You 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?

Medium
151

A 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?

Medium
152

You need to expose a Deployment named 'web' on port 80 internally within the cluster. Which command creates the appropriate Service?

Medium
153

What is the purpose of the 'kubectl rollout status' command?

Easy
154

Which of the following are valid kubectl commands for managing rollouts? (Select all that apply)

Hard
155

You 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?

Hard
156

A 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?

Easy
157

Which THREE statements correctly describe Kustomize? (Select THREE.)

Hard
158

Which THREE of the following are valid use cases for a Headless Service (clusterIP: None)?

Hard
159

A 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?

Hard
160

A multi-stage build has two stages named 'builder' and 'final'. Which instruction copies artifacts from the builder stage to the final stage?

Hard
161

You 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?

Medium
162

A 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?

Medium
163

A 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?

Medium
164

A 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?

Medium
165

Arrange the steps to create a Kubernetes Deployment with a rolling update strategy.

Medium
166

Which THREE of the following are valid fields for configuring a probe in Kubernetes? (Select 3)

Hard
167

A 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?

Medium
168

A pod's securityContext has 'allowPrivilegeEscalation: false' and 'capabilities: { drop: ["ALL"] }'. Which statement is true?

Medium
169

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

Medium
170

Which TWO commands can be used to create a Secret from a file? (Select 2)

Easy
171

Which command attaches an ephemeral container to a running pod for debugging?

Medium
172

An administrator wants to enforce that all Pods in a namespace run with a read-only root filesystem. Which admission controller should be configured?

Medium
173

Which command creates a Secret named 'db-secret' with two keys, 'username' and 'password', from literal values?

Easy
174

Which THREE of the following are valid reasons to use a startup probe? (Select THREE.)

Hard
175

A 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?

Medium
176

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

Medium
177

Which API version is correct for a Deployment in Kubernetes v1.29?

Easy
178

A Job must run 10 times in total, with up to 3 pods running simultaneously. Which fields should be set?

Medium
179

A 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'?

Medium
180

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

Easy
181

A 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?

Hard
182

You want to update a Deployment's image from nginx:1.20 to nginx:1.21. Which command will perform a rolling update?

Medium
183

You run 'kubectl get events' and see an event 'FailedScheduling' for a pod. What is the most common cause?

Medium
184

Which kubectl command creates a ConfigMap named 'app-config' from a file named 'config.properties'?

Easy
185

Which THREE commands can be used to get detailed information about a pod named 'my-pod'? (Choose three.)

Hard
186

A 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?

Medium
187

Order the steps to perform a rolling rollback of a Deployment to a previous revision.

Medium
188

Which kubectl command correctly creates a ConfigMap from a file named 'app.properties'?

Easy
189

You have created a ServiceAccount named 'my-sa' in namespace 'default'. You want a Pod to use this ServiceAccount. Which Pod spec field is correct?

Medium
190

A 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?

Medium
191

You 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?

Hard
192

Which service type is used to expose a service using an external DNS name, such as a database hosted outside Kubernetes?

Easy
193

Which field in a Pod spec specifies which ServiceAccount the pod should use?

Easy
194

You 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?

Medium
195

A 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?

Medium
196

A 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?

Hard
197

Your Deployment is stuck during rollout, and you want to investigate. Which command pauses the rollout and allows you to check the current state?

Hard
198

You 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?

Easy
199

You have a Secret of type 'kubernetes.io/tls' named 'tls-secret'. What keys are required in the Secret data?

Medium
200

A developer wants to ensure that a pod runs with a non-root user and cannot gain root privileges. Which SecurityContext settings should be used?

Medium
201

You 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?

Medium
202

Which kubectl command creates a ConfigMap named 'app-config' with key 'color' and value 'blue'?

Easy
203

You 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?

Hard
204

Which TWO statements about Ingress are correct? (Select 2)

Medium
205

An 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?

Hard
206

You 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)

Hard
207

You 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?

Hard
208

What annotation is required on an Ingress resource to use a specific IngressClass (e.g., 'nginx')?

Easy
209

A 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?

Medium
210

A 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'?

Hard
211

You want to scale a Deployment named 'frontend' to 5 replicas. Which command should you use?

Easy
212

A 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?

Hard
213

You want to see the IP address and the node on which each pod in the 'default' namespace is running. Which command provides this information?

Medium
214

Which TWO methods can be used to expose a Secret's data as environment variables inside a container? (Select 2)

Medium
215

A 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?

Medium
216

A 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?

Hard
217

Which command forwards port 8080 on the local machine to port 80 on a pod named 'web-pod'?

Easy
218

A Deployment is configured with strategy type 'Recreate'. Which statement about this strategy is true?

Medium
219

A 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?

Medium
220

Which kubectl command is used to view the rollout status of a Deployment named 'web-app'?

Easy
221

You need to create a ConfigMap named 'app-config' with key 'APP_COLOR' and value 'blue'. Which command creates this ConfigMap?

Easy
222

A 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?

Hard
223

A 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?

Hard
224

Which of the following are valid methods to perform a blue-green deployment? (Choose TWO)

Medium
225

You 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?

Hard
226

You have a headless Service for a StatefulSet. The DNS query for the service returns no A records. What is the most likely cause?

Medium
227

Which TWO are valid Service types? (Choose two.)

Medium
228

You 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?

Medium
229

Which TWO of the following are required to create a Role and RoleBinding that grants read access to Pods in the 'development' namespace? (Choose two.)

Easy
230

A Deployment has 3 replicas. You run 'kubectl scale deployment mydeploy --replicas=5'. What happens?

Easy
231

Which TWO of the following are valid fields in a CronJob spec? (Select 2)

Medium
232

Which Service type is used to expose a Service externally using a cloud provider's load balancer?

Easy
233

A 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?

Hard
234

You 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?

Hard
235

You 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?

Hard
236

A 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?

Hard
237

A 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?

Medium
238

Which TWO of the following are valid service types in Kubernetes?

Easy
239

To create a service that will be accessible from outside the cluster using a cloud provider's load balancer, what type should be used?

Easy
240

Which command shows resource usage (CPU/memory) of pods in the default namespace?

Easy
241

Which THREE of the following are valid fields in a PodSecurityContext that affect container security? (Select 3)

Hard
242

A ClusterIP service named 'svc' has no endpoints. Which command can you use to debug why the service is not routing traffic?

Hard
243

A pod needs to run as a non-root user. Which securityContext field should be set to enforce this?

Easy
244

A Kubernetes Job with parallelism=3 and completions=6 is created. How many pods will run concurrently at most?

Hard
245

A 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?

Hard
246

You want to set environment variable 'DB_URL' in a pod from the key 'url' in ConfigMap 'db-config'. Which YAML snippet is correct?

Medium
247

Which of the following is a valid Pod Security Admission standard?

Easy
248

Which TWO statements about Kustomize are true?

Medium
249

Which kubectl command can be used to see the rollout status of a Deployment named 'web-app'?

Easy
250

Which TWO statements about kubectl apply vs kubectl create are correct? (Select two)

Medium
251

Sequence the steps to troubleshoot a Pod stuck in CrashLoopBackOff state.

Medium
252

Which kubectl command creates a ConfigMap named 'app-config' from a file 'config.properties'?

Easy
253

You 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?

Easy
254

Which command creates a ConfigMap named 'app-config' with two keys: 'key1=value1' and 'key2=value2'?

Easy
255

Which of the following is the correct way to scale a Deployment named 'api' to 5 replicas using kubectl?

Easy
256

Which TWO of the following are true about headless services? (Select 2)

Easy
257

A 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?

Medium
258

A 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?

Medium
259

Which command shows resource usage (CPU and memory) for pods in a namespace?

Easy
260

You 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?

Hard
261

You need to view the logs of a container that previously crashed and has been restarted. Which flag do you use with 'kubectl logs'?

Medium
262

You 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?

Medium
263

A 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?

Easy
264

You 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?

Easy
265

You 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?

Medium
266

You 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?

Medium
267

A developer wants to create a Job that runs exactly 3 pods in parallel. Which field should be set in the Job spec?

Medium
268

Which TWO are correct about LimitRange?

Medium
269

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

Hard
270

You want to deny all incoming traffic to a set of pods except from pods with label 'role: frontend'. Which NetworkPolicy spec should you use?

Easy
271

You 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?

Hard
272

Which TWO of the following are valid uses of Kubernetes Annotations? (Select two.)

Easy
273

A 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?

Hard
274

You want to run a command inside a running container to check environment variables. Which command should you use?

Medium
275

A NetworkPolicy allows egress traffic to pods with label 'db: mysql' in the same namespace. Which egress rule is correct?

Medium
276

Which of the following commands creates a deployment named 'webapp' that runs the image 'nginx:1.25' with 3 replicas?

Easy
277

A CronJob is configured with concurrencyPolicy: Replace and a job execution takes 10 minutes. The schedule is */5 * * * *. Which statement is true about job executions?

Hard
278

Which command lists all Helm releases in the current namespace?

Easy
279

You 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?

Hard
280

You 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?

Hard
281

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

Easy
282

You 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?

Medium
283

Which of the following is a valid way to expose a Secret as an environment variable in a Pod?

Easy
284

Which of the following is NOT a valid restart policy for a Pod?

Easy
285

You want to add an annotation to a pod without modifying the pod template. Which approach should you use?

Medium
286

Your 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?

Medium
287

You 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?

Medium
288

Which three security contexts can be set at the pod level (as opposed to container level)? (Select THREE.)

Hard
289

Which THREE configurations are part of Pod Security Admission's 'restricted' profile? (Select THREE.)

Hard
290

You 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?

Medium
291

A Pod is configured with automountServiceAccountToken: false. The application inside the pod needs to access the Kubernetes API. What should be done?

Hard
292

You 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?

Medium
293

Which TWO commands can be used to view the logs of a pod that has crashed?

Medium
294

Which TWO statements about headless services are correct?

Medium
295

You 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?

Medium
296

You 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?

Medium
297

In a Deployment, what is the purpose of the 'maxUnavailable' field in the rolling update strategy?

Easy
298

You 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?

Hard
299

Which Dockerfile instruction is used to specify the base image for a build?

Easy
300

What is the purpose of the 'kubectl describe pod' command?

Easy
301

Which of the following is true about the CMD instruction in a Dockerfile?

Medium
302

You 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?

Easy
303

Which THREE are valid reasons to use a StatefulSet instead of a Deployment?

Hard
304

A 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?

Hard
305

Which THREE are valid fields in a NetworkPolicy spec? (Choose three.)

Hard
306

You 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?

Hard
307

You 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?

Hard
308

A NetworkPolicy denies all ingress traffic to a namespace. Which rule would allow traffic only from pods in the same namespace?

Medium
309

To prevent a container from running as root, which field should be set in the securityContext?

Easy
310

A 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?

Medium
311

Which Pod spec snippets correctly achieve this?

Medium
312

You have a Deployment that uses the Recreate strategy. You update the container image. What happens to the existing pods?

Hard
313

A 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?

Medium
314

Which TWO of the following are valid reasons to use a readiness probe? (Select 2)

Easy
315

A Helm chart has the following template snippet: '{{ .Values.replicaCount }}'. You want to set replicaCount to 5 during installation. Which command should you use?

Medium
316

Which TWO of the following are valid ways to mount a Secret into a pod as environment variables? (Select exactly 2)

Hard
317

What is the purpose of the 'spec.externalName' field in a Service of type ExternalName?

Easy
318

You 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?

Hard
319

Which THREE statements are true about init containers? (Select 3)

Hard
320

What is the default type of a Kubernetes Service when no type is specified in the YAML manifest?

Easy
321

Which command shows the CPU and memory usage of all pods in the current namespace?

Easy
322

A developer creates a headless Service with 'clusterIP: None' for a StatefulSet. What is the primary purpose of using a headless Service?

Medium
323

A 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?

Medium
324

You 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?

Hard
325

A 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?

Medium
326

You have a Deployment with 3 replicas. You run 'kubectl rollout pause deployment/app'. Which command would you use to resume the rollout?

Medium
327

A developer wants to expose a Deployment named 'web-app' (with label 'app: web') as a ClusterIP service on port 80. Which command achieves this?

Easy
328

Which TWO statements are true about readiness probes? (Select two.)

Medium
329

Which THREE of the following are valid Kustomize features? (Select THREE)

Medium
330

Which TWO resources are used to enforce resource quotas at the namespace level? (Select TWO.)

Medium
331

You 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?

Medium
332

You run 'kubectl get pods' and see a pod in 'CrashLoopBackOff' state. Which TWO conditions could cause this state?

Hard
333

You 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?

Medium
334

A 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?

Medium
335

Which TWO of the following are valid strategies for updating a Deployment?

Easy
336

Which THREE of the following are valid fields in a PodSecurityContext?

Hard
337

A 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?

Medium
338

You 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?

Hard
339

A 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?

Easy
340

Refer 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?

Hard
341

A user runs: kubectl apply -f job.yaml. The Job spec has backoffLimit: 0. The pod fails immediately. What happens?

Medium
342

A pod spec has terminationGracePeriodSeconds: 30. The main process ignores SIGTERM. After 30 seconds, what happens?

Hard
343

You 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?

Hard
344

You 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?

Hard
345

A 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?

Medium
346

You 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?

Medium
347

Which TWO of the following are valid ways to inject configuration data into a Kubernetes Pod?

Medium
348

Which command builds a Docker image from the current directory and tags it as 'myapp:v1'?

Easy
349

You 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?

Medium
350

A pod needs to mount a Secret named 'db-secret' as a volume at /etc/secret. Which volume mount definition is correct?

Easy
351

A developer creates a Deployment with 3 replicas and a Service with `clusterIP: None`. What is the primary use case for this headless Service?

Medium
352

Which kubectl command is used to view the rollout status of a Deployment?

Easy
353

You 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?

Medium
354

You want to undo a rollout to the previous revision. Which command should you use?

Medium
355

Which of the following best describes the purpose of an init container?

Easy
356

You need to ensure that a Pod always runs on a node with an SSD. Which node selector mechanism should you use?

Medium
357

You need to debug a Pod that is in CrashLoopBackOff. Which command should you run first?

Medium
358

Which command creates a generic secret named 'db-secret' with key 'password' and value 'p@ss'?

Easy
359

A 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?

Medium
360

You need to view events for a specific pod named 'web-1' in the 'default' namespace. Which command shows events related to this pod?

Medium
361

Match each Kubernetes concept to its definition.

Medium
362

A 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?

Easy
363

A 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?

Easy
364

What is the purpose of a .dockerignore file in a Docker build context?

Easy
365

Which TWO of the following are required for Ingress to route HTTP traffic to a backend Service?

Easy
366

You 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?

Medium
367

You 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?

Medium
368

An 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?

Hard
369

You need to view the logs of the previous (terminated) instance of a container in a pod. Which command should you use?

Easy
370

You 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?

Medium
371

You 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?

Hard
372

Which THREE are valid ways to expose a Service externally in Kubernetes?

Hard
373

A CronJob has concurrencyPolicy set to 'Forbid'. At the scheduled time, if the previous job is still running, what happens?

Medium
374

A 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?

Medium
375

You 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?

Medium
376

Which TWO actions can you perform using 'kubectl describe'? (Select two.)

Medium
377

You have a Deployment that is failing after a rollout. You want to revert to the previous revision. Which command accomplishes this?

Hard
378

What is the effect of running 'kubectl rollout pause deployment web'?

Medium
379

A 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?

Hard
380

Which TWO statements about the .dockerignore file are true?

Medium
381

Which TWO of the following are correct ways to pause a rollout of a Deployment named 'myapp'? (Select TWO)

Medium
382

You 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?

Hard
383

Which THREE components are required for a basic Ingress to route HTTP traffic to a Service? (Choose three.)

Hard
384

Which FOUR of the following are valid fields in a HorizontalPodAutoscaler (HPA) v2 specification?

Hard
385

A Pod needs to communicate with another Pod in the same cluster but in a different namespace. What is the correct DNS name to use?

Medium
386

A 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?

Medium
387

You need to configure a liveness probe that checks if the container port 8080 is open. Which probe type should you use?

Hard
388

You 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?

Medium
389

Which THREE are valid types of probes in Kubernetes?

Hard
390

Which TWO statements about init containers are true? (Select 2)

Medium
391

A 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?

Medium
392

What is the DNS name for a Service named 'backend' in the 'default' namespace?

Easy
393

A 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?

Hard
394

You 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?

Medium
395

A 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?

Medium
396

You 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?

Medium
397

A Pod specification includes: securityContext: { seccompProfile: { type: RuntimeDefault } }. What does this configuration do?

Hard
398

A 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?

Medium
399

A pod is in Pending state. 'kubectl describe pod' shows '0/1 nodes are available: 1 Insufficient cpu'. Which action would resolve this?

Medium
400

A user runs: kubectl run my-pod --image=nginx --restart=Never --dry-run=client -o yaml. Which apiVersion is used in the generated YAML?

Medium
401

Which kubectl command can you use to stream the logs from a pod in real-time?

Easy
402

A 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?

Medium
403

A 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?

Hard
404

Which THREE of the following are true about Kubernetes Services? (Select 3)

Hard
405

A pod is running but not receiving traffic from a Service. The readiness probe is failing. What is the likely effect on the pod?

Medium
406

Which TWO of the following are correct about the ExternalName Service type?

Medium
407

You 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?

Medium
408

A StatefulSet named 'mysql' is deployed with 3 replicas. The administrator wants each pod to have a stable network identity. Which service configuration is required?

Medium
409

You have a ConfigMap named 'app-config' with key 'database.url'. Which environment variable definition correctly injects this value into a pod using a configMapKeyRef?

Easy
410

Which THREE commands can be used to list the endpoints of a Service named 'my-svc'?

Medium
411

Which Helm command is used to install a chart from a repository?

Easy
412

Which TWO of the following are valid parameters for configuring probes in Kubernetes? (Select TWO.)

Medium
413

A 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?

Hard
414

A 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?

Medium
415

You 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?

Hard
416

Which THREE statements about Ingress are correct? (Choose three.)

Medium
417

You 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?

Hard
418

A 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?

Medium
419

Which of the following is the correct apiVersion for a CronJob in Kubernetes v1.29?

Easy
420

Which 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?

Easy
421

An Ingress resource is configured with TLS. Which field in the Ingress YAML specifies the secret containing the TLS certificate and key?

Medium
422

A 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?

Medium
423

Which TWO approaches can be used to expose a Secret's value as an environment variable in a pod?

Medium
424

An 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?

Hard
425

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

Medium
426

An 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?

Medium
427

Which THREE statements about NetworkPolicy are correct?

Hard
428

Sequence the steps to expose a Kubernetes Service using a NodePort for external access.

Medium
429

You 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)?

Medium
430

What is the primary purpose of an Init Container in a Pod?

Easy
431

Which TWO of the following are valid ways to expose a service externally on a Kubernetes cluster? (Select 2)

Medium
432

A 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?

Hard
433

You 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?

Medium
434

What is the purpose of the 'values.yaml' file in a Helm chart?

Medium
435

You want to expose a container's port 8080 in the Dockerfile. Which instruction should you use?

Medium
436

What is the DNS name for a Service named `svc` in namespace `ns`?

Easy
437

A 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?

Medium
438

You 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?

Hard
439

Which THREE of the following are valid ways to update a Deployment's container image in Kubernetes?

Hard
440

You 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?

Hard
441

You 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?

Hard
442

A 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?

Medium
443

You 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?

Hard
444

A 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?

Medium
445

Which of the following is a valid schedule for a CronJob that runs every day at midnight?

Easy
446

You 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?

Hard
447

Sequence the steps to scale a Deployment to 5 replicas and verify.

Medium
448

A 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?

Easy
449

Which THREE of the following are valid ways to debug a pod that is not responding? (Select three.)

Hard
450

Which Dockerfile instruction sets a command that can be overridden when running the container?

Easy
451

A 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?

Medium
452

Which TWO are valid fields in a Deployment's rollingUpdate configuration? (Select 2)

Easy
453

Which THREE of the following are correct statements about Helm?

Medium
454

A 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?

Hard
455

A 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?

Hard
456

Which TWO of the following are correct about the difference between 'kubectl apply' and 'kubectl create'?

Easy
457

What is the purpose of a readiness probe in Kubernetes?

Easy
458

Which command shows the rollout history of a Deployment named 'web'?

Easy
459

Which kubectl command creates a Secret named 'tls-secret' from a TLS certificate file 'cert.pem' and private key file 'key.pem'?

Easy
460

You 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?

Medium
461

Which TWO statements about Init Containers are correct? (Select exactly 2.)

Medium
462

A 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?

Medium
463

Which command creates a generic Secret with username=admin and password=secret123?

Easy
464

Which kubectl command creates a ConfigMap named 'app-config' from a file 'app.properties'?

Easy
465

You 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?

Medium
466

Which of the following is the correct way to create a simple Pod named 'nginx' running the nginx:1.25 image using kubectl?

Easy
467

Which TWO fields are required in a CronJob manifest? (Select 2)

Medium
468

What is the purpose of the '.dockerignore' file?

Easy
469

During 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?

Medium
470

Which THREE of the following are valid types of Secrets in Kubernetes?

Medium
471

A Pod specification includes: securityContext: { runAsNonRoot: true }. The container image runs as root by default. What will happen when the Pod is created?

Medium
472

Which THREE of the following are valid types of probes in Kubernetes? (Select 3)

Medium
473

Which TWO items are required for Ingress to work correctly in a Kubernetes cluster?

Medium
474

Which THREE of the following are valid fields in the '.spec' of a Job manifest?

Hard
475

Arrange the steps to create a multi-container Pod with a shared volume.

Medium
476

Which THREE are valid ways to create a ConfigMap?

Hard
477

Which command creates a TLS secret from an existing certificate and key file?

Easy
478

You 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?

Medium
479

Which kubectl command shows the rollout history of a Deployment named 'app'?

Easy
480

Which THREE of the following are valid fields in a PodSecurityContext (pod-level securityContext)? (Select 3)

Hard
481

Which THREE of the following are valid reasons to use a HorizontalPodAutoscaler (HPA) with a Deployment?

Medium
482

What is the correct schedule expression for a CronJob that runs every 5 minutes?

Medium
483

When 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?

Easy
484

You 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?

Medium
485

You 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?

Medium
486

You 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?

Medium
487

A pod with an init container and a main container has 'restartPolicy: Always'. The init container exits with code 0. What happens next?

Hard
488

A developer wants to access a specific pod's port 8080 from their local machine using a temporary connection. Which command should they use?

Easy
489

Which of the following is the correct apiVersion for a Kubernetes Job in v1.29?

Easy
490

Which THREE of the following are valid fields in a SecurityContext at the container level? (Select three.)

Hard
491

Which TWO of the following are valid ways to expose a container port in a pod spec?

Medium
492

A NetworkPolicy with the following spec is applied: spec: podSelector: {} policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: role: frontend What does this policy do?

Medium
493

Which TWO statements about Ingress are correct?

Medium
494

You 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?

Hard
495

Given the following partial pod spec: ```yaml securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 ``` Which combination correctly describes the resulting permissions on a mounted volume?

Hard
496

A team wants to deploy a multi-container Pod with a sidecar pattern. Which THREE statements are true about sidecar containers? (Select exactly 3.)

Hard
497

You need to see the YAML definition of a running pod named 'app' including the current status. Which command should you use?

Medium
498

Which Dockerfile instruction is used to specify the base image for a container image?

Easy
499

A 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?

Easy
500

You have a ConfigMap created from an env file. Which command creates the ConfigMap from the file 'app.env' containing key=value pairs?

Easy
501

You 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?

Medium
502

You 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?

Hard
503

During 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?

Hard
504

You 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?

Medium
505

Which THREE of the following are capabilities that can be added to a container's securityContext?

Hard
506

You 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?

Hard
507

A NetworkPolicy named 'deny-all' is applied in a namespace. Which YAML snippet correctly implements a default-deny-all ingress policy?

Medium
508

What is the purpose of the 'maxUnavailable' field in a Deployment's rolling update configuration?

Medium
509

An Ingress resource specifies TLS termination using a secret. The secret must contain which keys?

Hard
510

You 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?

Hard
511

You want to restrict a Pod to only run with a seccomp profile of 'RuntimeDefault'. Which SecurityContext field should you set?

Hard
512

A 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?

Medium
513

You 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?

Hard
514

Which TWO of the following are valid types for a Kubernetes Secret? (Choose two.)

Easy
515

Which kubectl command sets the number of replicas for a deployment named 'nginx' to 5?

Easy
516

Which TWO actions can help prevent a container from being compromised if an attacker gains access? (Select 2)

Medium
517

A 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?

Hard
518

A 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?

Medium
519

Which THREE of the following are true about using 'kubectl rollout undo'? (Select three)

Hard
520

A user creates a Job with '.spec.completions=5' and '.spec.parallelism=2'. How many pods will run at the same time?

Medium
521

What is the default service type in Kubernetes?

Easy
522

Which THREE of the following are characteristics of Pod Security Admission (PSA) standards? (Select three.)

Hard
523

Which Dockerfile instruction is used to define a mount point for a volume?

Easy
524

You need to check the CPU and memory usage of a pod named 'monitored-pod' in the 'default' namespace. Which command should you run?

Medium
525

You 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?

Medium
526

You 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?

Hard
527

Which THREE components are typically involved when using Ingress to expose a service?

Hard
528

A 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?

Easy
529

A 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?

Medium
530

An 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?

Hard
531

A 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?

Hard
532

You 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?

Hard
533

A cluster administrator wants to prevent all pods in a namespace from running with privileged escalation. Which Pod Security Admission standard enforces this?

Medium
534

What is the default restart policy for a pod created with 'kubectl run nginx --image=nginx'?

Medium
535

You have a Service named 'my-svc' in the 'prod' namespace. What is the fully qualified DNS name for this Service?

Medium
536

A 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?

Medium
537

A 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?

Medium
538

Which THREE of the following are valid Ingress pathTypes in Kubernetes networking.k8s.io/v1?

Medium
539

A 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?

Medium
540

You 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?

Medium
541

You are using Helm to manage a chart. Which commands are valid to list installed releases? (Choose TWO)

Medium
542

A 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?

Medium
543

A 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?

Medium
544

A 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?

Medium
545

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

Hard
546

Which Service type is used to expose a Service on a static port on each node in the cluster?

Easy
547

You want to expose a Deployment 'app' externally on port 30080 on each node. What service type should you use?

Medium
548

A 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?

Easy
549

A 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?

Hard
550

Which command creates a TLS secret named 'tls-secret' using certificate file 'tls.crt' and key file 'tls.key'?

Medium
551

Which 'kubectl' command creates a pod named 'test-pod' using the nginx image and outputs the YAML manifest without actually creating it?

Easy
552

You 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?

Easy
553

You 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?

Hard
554

Which TWO of the following are valid uses of init containers? (Select 2)

Medium
555

What is the purpose of the `IngressClass` resource in Kubernetes?

Medium
556

A headless service is created with 'clusterIP: None'. What is the primary use case for such a service?

Medium
557

You 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?

Easy
558

A 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?

Medium
559

A CronJob is configured with 'concurrencyPolicy: Forbid'. What happens if the scheduled time arrives while the previous job is still running?

Medium
560

Which Service type exposes a Service externally via each Node's IP on a static port?

Easy
561

Which TWO commands can be used to update the image of a Deployment? (Select two)

Medium
562

You 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?

Hard
563

Which of the following is a valid YAML snippet for a container that sets the seccomp profile to 'RuntimeDefault' in a PodSecurityContext?

Hard
564

A 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?

Medium
565

You 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

Medium
566

You need to run a database migration as a container before the main application container starts. Which Kubernetes concept should you use?

Medium
567

A pod has 'automountServiceAccountToken: false' in its spec. What is the effect?

Medium
568

You create a headless service with 'clusterIP: None' for a StatefulSet. How does a client discover the individual pod IPs?

Hard
569

Which THREE of the following are true about NetworkPolicy? (Select 3)

Hard
570

Which TWO of the following are valid ways to expose a Deployment named 'web' as a Service?

Medium
571

A developer wants to tag a local image 'myapp:latest' with the tag 'v1.0.0' for pushing to a registry. Which command does this?

Medium
572

What is the difference between 'kubectl apply' and 'kubectl create'?

Easy
573

A 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?

Hard
574

In a Dockerfile, what is the difference between CMD and ENTRYPOINT?

Easy
575

A developer needs to expose a database password to a Pod as an environment variable, securely. What should they do?

Easy
576

Arrange the steps to create a ConfigMap from a file and mount it as a volume in a Pod.

Medium
577

You 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)?

Hard
578

You want to see a list of all events in the 'default' namespace, sorted by timestamp. Which command should you use?

Easy
579

You 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?

Medium
580

Which THREE statements about ResourceQuota are correct? (Select 3)

Hard
581

Which TWO Service types allow external access to pods from outside the Kubernetes cluster? (Select 2)

Easy
582

A user wants to create a Kubernetes Secret for storing Docker registry credentials (username and password). Which type of Secret should they use?

Medium
583

Which commands list all Helm releases in the current namespace? (Select all that apply)

Easy
584

An 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?

Hard
585

During 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?

Hard
586

You 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?

Hard
587

You 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?

Hard
588

A 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?

Medium
589

Which TWO of the following are valid non-interactive methods to update a Deployment's image?

Easy
590

Which probe type is used to determine if a container is ready to serve traffic?

Easy
591

Which command is used to undo the most recent rollout of a Deployment named 'myapp'?

Easy
592

Which file prevents certain files from being copied into a Docker image during a build?

Easy
593

You are using Kustomize. Your kustomization.yaml file specifies a base and an overlay. You run: kubectl apply -k overlays/production. What happens?

Medium
594

A 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?

Easy
595

Which command lists all the secrets in the current namespace?

Easy
596

You 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?

Hard
597

You 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?

Medium
598

You 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?

Medium
599

Which TWO of the following are valid methods to perform a blue-green deployment in Kubernetes?

Medium
600

A security requirement states that a container must run with a read-only root filesystem. Which field must be set in the container's securityContext?

Hard
601

You 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?

Hard
602

Order the steps to expose a Kubernetes Deployment as a ClusterIP Service.

Medium
603

Which TWO are valid ways to create a Service from a deployment named 'frontend'? (Choose two.)

Hard
604

Which of the following Dockerfile instructions sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions?

Easy
605

Which TWO commands can be used to view the rollout history of a Deployment?

Medium
606

Refer 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?

Easy
607

You 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?

Hard
608

A 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?

Medium
609

You 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?

Medium
610

Which THREE of the following are valid fields in a Helm chart's values.yaml file that can be used in templates?

Hard
611

A 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?

Hard
612

A 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?

Hard
613

Which TWO statements are true about Kubernetes Secrets?

Medium
614

You 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?

Medium
615

A 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?

Medium
616

A 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?

Medium
617

You 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?

Hard
618

You need to get a list of all events in the cluster sorted by timestamp. Which command should you use?

Easy
619

An administrator runs 'kubectl apply -f deployment.yaml' and later wants to revert to the previous configuration. Which approach is correct?

Hard
620

A 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?

Hard
621

Which TWO statements about Kubernetes Services are correct?

Medium
622

What is the correct command to forward a local port to a pod for debugging?

Easy
623

You 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?

Hard
624

Which TWO instructions are commonly used to add files to a Docker image during build? (Select 2)

Easy
625

Which TWO of the following are true about Kustomize overlays? (Select 2)

Medium
626

You are using the Recreate strategy for a Deployment. What happens during an update?

Medium
627

You need to create a ConfigMap named 'app-config' from a file 'config.properties'. Which kubectl command should you use?

Easy
628

What is the primary purpose of a headless Service (clusterIP: None) in Kubernetes?

Medium
629

You 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?

Hard
630

A Pod is running but not responding to requests. The liveness probe is a TCP check on port 8080. What is the most likely issue?

Hard
631

You 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?

Easy
632

Which THREE of the following are correct about init containers? (Select THREE.)

Hard
633

An 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?

Easy
634

A 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?

Medium
635

You 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?

Medium
636

Which of the following is a valid method to perform a blue-green deployment in Kubernetes?

Easy
637

Which of the following is true about Istio as a service mesh?

Medium
638

A 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'?

Medium
639

Which command is used to scale a Deployment named 'web' to 5 replicas?

Easy
640

Which TWO of the following are true about .dockerignore files?

Medium
641

Which TWO are valid ways to expose a Secret's data as environment variables in a pod?

Medium
642

How 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'?

Easy
643

An 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?

Medium
644

An 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?

Medium
645

Which 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?

Easy
646

You 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?

Hard
647

A 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?

Medium
648

Which THREE of the following are valid reasons to use an annotation in Kubernetes?

Medium
649

You 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?

Medium
650

In a Deployment YAML, which field defines the number of pods to run?

Easy
651

Based on the exhibit, what should you do to determine why the container is failing?

Medium
652

You have a Deployment that uses the 'Recreate' strategy. What happens when you update the pod template (e.g., change the image)?

Medium
653

You 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?

Hard
654

You 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?

Medium
655

Which TWO statements about NetworkPolicy are correct? (Choose two.)

Medium
656

An Ingress resource has the following annotation: 'kubernetes.io/ingress.class: nginx'. What is the purpose of this annotation?

Hard
657

An 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?

Medium
658

A 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?

Medium
659

Which TWO parameters can be configured for a probe to control its behavior? (Choose two.)

Medium
660

You 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?

Easy
661

A 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?

Medium
662

A pod has securityContext with capabilities.add: ['NET_ADMIN'] and capabilities.drop: ['ALL']. What effective capabilities does the container have?

Hard
663

Which of the following YAML fields can be used to mount a Secret as a volume in a Pod?

Easy
664

You want to deploy an application with zero downtime by using a blue-green deployment pattern. Which Kubernetes resources are essential for implementing this strategy?

Easy
665

You 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?

Hard
666

You 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?

Medium
667

Which THREE of the following are correct about Kustomize?

Hard
668

Which Service type is used to expose a service externally on a static port on each worker node?

Easy
669

You need to debug a Service that is not routing traffic to its endpoints. Which command shows the current endpoints of a Service?

Medium
670

You 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?

Medium
671

You run 'kubectl apply -f deployment.yaml' and later 'kubectl replace -f deployment.yaml' on the same file. What is the difference?

Medium
672

You 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?

Medium
673

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

Medium
674

Which TWO of the following commands can be used to view events related to a specific pod? (Select TWO.)

Medium
675

A 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?

Hard
676

An 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?

Hard
677

Which THREE are valid patterns for multi-container Pods?

Hard
678

You have a headless Service for a StatefulSet. What is the DNS resolution behavior for the StatefulSet pods?

Medium
679

Which of the following is the correct way to set a memory limit of 512Mi for a container in a pod spec?

Medium
680

You 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?

Hard
681

What is the primary purpose of a Kubernetes ServiceAccount?

Easy
682

You want to see detailed information about a node's resource usage. Which command should you run?

Easy
683

You run 'kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml'. What is the output?

Medium
684

A 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?

Medium
685

Which two commands can create a ConfigMap from an environment file? (Select TWO.)

Easy
686

Which command shows resource usage (CPU and memory) for pods?

Easy
687

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

Hard
688

You 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?

Medium
689

Which command creates a Docker registry secret from an existing Docker config file?

Easy
690

Which YAML snippet correctly defines a CronJob that runs a task every 5 minutes?

Easy
691

What is the correct apiVersion for a Kubernetes Job in v1.29?

Easy
692

You 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?

Medium
693

A 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?

Hard
694

You need to view metrics from a Pod running a web server. Which approach follows Kubernetes best practices?

Easy
695

Which TWO of the following are valid ways to expose a Service externally in a Kubernetes cluster?

Medium
696

You 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?

Medium
697

A 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?

Easy
698

Which command correctly creates a Role named 'pod-reader' that allows get, list, and watch on pods?

Medium
699

You have a Dockerfile that uses a multi-stage build. Which of the following statements about multi-stage builds is correct?

Medium
700

You 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?

Hard
701

A pod in namespace 'default' cannot resolve the service name 'db' in namespace 'data'. Which DNS name should the pod use to reach the service?

Medium
702

You 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?

Medium
703

You 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?

Hard
704

Which of the following is true about headless services?

Easy
705

A 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?

Medium
706

A 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?

Medium
707

You run 'kubectl get pods' and see that a pod is in 'Pending' state. What is the most likely cause?

Medium
708

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

Hard
709

A 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?

Medium
710

You 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?

Medium
711

A Pod is stuck in CrashLoopBackOff. You run 'kubectl logs mypod' and get no output. What is the most likely cause?

Medium
712

Which kubectl command shows detailed information about a pod, including events, labels, and container state?

Easy
713

You 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?

Hard
714

A pod uses a ServiceAccount 'my-sa' but the pod's container needs to list pods in the namespace. Which RBAC resources are necessary?

Medium
715

Which of the following commands creates a LoadBalancer Service named `web-svc` for a Deployment named `web` on port 80?

Easy
716

A Service of type LoadBalancer is created but the external IP remains <pending>. What is the most likely reason?

Hard
717

You 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)

Hard
718

You 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?

Hard
719

You 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?

Medium
720

A 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?

Medium
721

A 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?

Easy
722

You 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?

Medium
723

Which command creates a Service named 'my-svc' that exposes a deployment named 'my-deploy' on port 80?

Easy
724

What is the purpose of an init container in a pod?

Easy
725

Which field in a CronJob spec specifies the maximum number of successful jobs that should be retained?

Easy
726

Which TWO statements about Kubernetes Services are correct? (Choose two.)

Medium
727

You 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?

Hard
728

You 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?

Hard
729

Which TWO of the following are valid ways to consume environment variables from a ConfigMap in a pod?

Medium
730

You 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?

Medium
731

Which of the following commands creates a ClusterIP service named 'my-service' that exposes port 80 on the pod with label 'app=web'?

Easy
732

You need to scale a Deployment named 'api' to 10 replicas instantly. Which command should you use?

Easy
733

Which kubectl command creates a Secret named 'db-secret' with key 'password' and value 'mypwd'?

Easy
734

A 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?

Hard
735

Consider 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?

Hard
736

Which 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?

Medium
737

You 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?

Hard
738

What is the purpose of a HorizontalPodAutoscaler (HPA)?

Easy
739

A 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?

Hard
740

You 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'?

Easy
741

You 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?

Hard
742

Which THREE statements about Dockerfile CMD and ENTRYPOINT are correct?

Hard
743

You 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?

Hard
744

When 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?

Medium
745

You run 'kubectl rollout undo deployment/app'. What happens?

Medium
746

You 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?

Medium
747

Which of the following is the correct way to set an environment variable 'APP_COLOR' from a ConfigMap key 'color'?

Easy
748

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

Hard
749

A 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?

Medium
750

To mount a ConfigMap as a volume, which field type must be used in the pod spec's volumes and volumeMounts?

Easy
751

A pod manifest includes the following securityContext: securityContext: { runAsUser: 1000, runAsGroup: 3000, fsGroup: 2000 }. What UID will be used for processes in the container?

Medium
752

Which of the following Ingress controllers is commonly used in Kubernetes?

Easy
753

You 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?

Hard
754

Which kubectl command creates a Secret from literal username and password values?

Easy
755

A developer wants to view the resource usage of all containers in a specific pod. Which command should they use?

Easy
756

You 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?

Medium
757

Which THREE of the following are valid patterns for multi-container pods?

Medium
758

Which Dockerfile instruction sets a default command that can be overridden by arguments passed to 'docker run'?

Easy
759

Which kubectl command streams logs from a pod named 'web-pod' in real-time?

Easy
760

You need to check the resource usage of nodes and pods in your cluster. Which TWO commands should you use? (Choose two)

Medium
761

A 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

Hard
762

You 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?

Easy
763

You 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?

Medium
764

A 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?

Medium
765

The Pod 'myapp' is in CrashLoopBackOff. Based on the exhibit, what is the most likely cause?

Hard
766

The exhibit shows a Deployment manifest. When applied, the pods are created but show 'CrashLoopBackOff'. What is the most likely cause?

Easy
767

You 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/'?

Medium
768

You want to expose a Deployment named 'nginx' on port 80 using a LoadBalancer service. Which YAML snippet is correct?

Easy
769

Which of the following Service types exposes a pod on a static port on each node's IP address?

Easy
770

A 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?

Medium
771

A 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?

Medium
772

You have a Deployment with 3 replicas. You create a Service with 'clusterIP: None'. What is the effect on pod DNS?

Medium
773

You 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?

Hard
774

A developer wants to enforce that containers in a namespace cannot run as privileged. Which Pod Security Standard profile should they apply to the namespace?

Medium
775

Which TWO commands can be used to create a resource from a YAML file?

Medium
776

You want to see all events in the default namespace sorted by timestamp. Which command should you use?

Easy
777

Which THREE of the following are valid fields in a NetworkPolicy spec?

Hard
778

A 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?

Medium
779

Which command forwards local port 8080 to port 80 of a pod named 'web-pod'?

Medium
780

You need to view resource usage (CPU and memory) for all pods in the 'default' namespace. Which command should you use?

Easy
781

Based on the exhibit, why is the container being killed and restarted?

Hard
782

You 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?

Hard
783

A 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?

Hard
784

A developer has a Dockerfile that builds a Go application. The final image size is 800MB. Which improvement would MOST reduce the image size?

Medium
785

You run the following command: 'kubectl run nginx --image=nginx --restart=Never'. What Kubernetes resource is created?

Medium
786

A pod must run with a seccomp profile that only allows specific syscalls. Which SecurityContext field is used to specify the seccomp profile type?

Hard
787

An Ingress resource uses host-based routing. Which field in the Ingress YAML specifies the host header to match?

Hard
788

Which FOUR of the following are valid probe handlers in Kubernetes?

Medium
789

A developer wants to ensure that a critical application always runs on every node in the cluster. Which resource should they use?

Easy
790

A Job must run exactly 3 Pods in parallel. Which Job manifest field achieves this?

Medium
791

Which TWO of the following are valid ways to expose a Secret as an environment variable in a pod? (Select two.)

Medium
792

Which kubectl command forwards local port 8080 to port 80 of a pod named 'web-pod'?

Easy
793

You 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?

Medium
794

You 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?

Hard
795

You 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?

Hard
796

Which THREE of the following are correct about the .dockerignore file? (Select 3)

Hard
797

Which instruction in a Dockerfile sets the default command to run when the container starts, but allows overriding?

Easy
798

An 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

Hard
799

You 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?

Medium
800

A 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?

Hard
801

A 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?

Medium
802

Which TWO statements about Kubernetes DNS are correct?

Hard
803

You need to create a Secret of type 'kubernetes.io/tls' for ingress. Which command is correct?

Hard
804

Which command streams logs from a pod in real-time?

Easy
805

A 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?

Medium
806

A 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?

Medium
807

Which THREE components are essential for setting up Horizontal Pod Autoscaling (HPA) based on CPU utilization? (Select three)

Hard
808

You 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?

Hard
809

An 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?

Hard
810

A 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?

Medium
811

You have a Deployment with strategy type: Recreate. You update the container image. What behavior will occur during the update?

Medium
812

A Secret of type kubernetes.io/tls requires two data keys. What are they?

Easy
813

An 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?

Hard
814

Which TWO of the following are valid ways to consume a Secret named 'db-secret' in a Pod? (Choose two.)

Medium
815

You have a pod that is stuck in 'Pending' state. Which command would you run first to diagnose the issue?

Medium
816

An 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 ```

Hard
817

Order the steps to update a Kubernetes Secret and ensure a Pod uses the new secret.

Medium
818

Which THREE are valid ways to expose a canary deployment for testing? (Select three)

Medium
819

You need to view the logs of a container named 'sidecar' inside a pod named 'app'. Which command should you use?

Easy
820

You need to create a Secret of type kubernetes.io/tls for use with an Ingress. Which kubectl command should you use?

Medium
821

Which TWO statements about Services are true? (Choose two.)

Medium
822

A 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?

Medium
823

Which TWO statements about labels and selectors are correct? (Select TWO.)

Medium
824

You 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?

Hard
825

You 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?

Hard
826

Which TWO options are valid ways to tag an image when building with Docker?

Medium

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.