WebMagicInformatica
CKAD practice questions

CKAD practice questions: Application Observability and Maintenance

5 free questions on Application Observability and Maintenance, 15% of the Kubernetes: CKAD exam. Try each one, then open the answer and explanation. None of them are in the free readiness check, so you can still take it fresh.

Question 1

You want CPU and memory usage per container (not per Pod) for web-1. Metrics Server is installed. Which command?

  1. A.

    kubectl top container web-1

  2. B.

    kubectl top pod web-1 --containers

  3. C.

    kubectl describe pod web-1 --stats

  4. D.

    kubectl logs web-1 --metrics

Show answer and explanation

Answer: B

kubectl top pod --containers breaks usage down by container.

  • top container, describe --stats and logs --metrics do not exist.
Question 2

A Java application needs up to 150 seconds to start. Its liveness probe (periodSeconds: 10, failureThreshold: 3) keeps killing the container before it is ready. What is the best solution?

  1. A.

    Remove all probes from the container.

  2. B.

    Add a startupProbe on the same endpoint with failureThreshold: 30 and periodSeconds: 10; liveness and readiness probes begin after it succeeds.

  3. C.

    Change the liveness probe to exec with sleep 150.

  4. D.

    Increase terminationGracePeriodSeconds to 150.

Show answer and explanation

Answer: B

While a startup probe has not succeeded, the kubelet does not run liveness or readiness probes. 30 failures at 10 seconds allow up to 300 seconds.

  • Removing probes loses health checking.
  • A sleeping exec probe does not test the app.
  • The grace period applies at shutdown.
Question 3

You need the log lines of all Pods labelled app=web, from every container, with each line prefixed by its Pod and container name. Which command does this?

  1. A.

    kubectl logs -l app=web --all-containers=true --prefix

  2. B.

    kubectl logs app=web --all

  3. C.

    kubectl get logs -l app=web

  4. D.

    kubectl logs deployment web --prefix-all

Show answer and explanation

Answer: A

kubectl logs accepts a label selector with -l, --all-containers=true includes every container and --prefix adds [pod/container] before each line.

  • app=web alone is not a valid Pod name argument.
  • get logs is not a resource.
  • --prefix-all does not exist.
Question 4Choose 2

Which TWO commands show live CPU or memory consumption (assuming Metrics Server is installed)? (Choose two.)

  1. A.

    kubectl get hpa

  2. B.

    kubectl get pods -o wide

  3. C.

    kubectl top pods -n prod

  4. D.

    kubectl top nodes

  5. E.

    kubectl describe pod web-1

Show answer and explanation

Answer: C and D

kubectl top queries the Metrics API for current usage of Pods and nodes.

  • describe pod shows configured requests and limits, not usage.
  • -o wide lists IPs and nodes.
  • get hpa shows scaling targets, which depend on metrics but is not a usage report for Pods.
Question 5

You want only the events related to the Pod web-1. Which command do you use?

  1. A.

    kubectl events --for pod/web-1

  2. B.

    kubectl get events --pod=web-1

  3. C.

    kubectl describe events web-1

  4. D.

    kubectl events pod web-1

Show answer and explanation

Answer: A

kubectl events --for TYPE/NAME filters events for an object. (kubectl get events --field-selector involvedObject.name=web-1 does the same.)

  • get events has no --pod flag.
  • describe events web-1 looks for an Event object with that name.
  • The last form has the wrong syntax.

How ready are you for CKAD?

Take the free readiness check: 15 questions from every exam domain in 20 minutes, with your score per domain.

  • 20 minutes
  • 15 questions
  • Free with an account

More CKAD practice by topic

Back to the CKAD practice test →

Independent practice material written from the official exam guide. Not affiliated with or endorsed by the exam provider.