HomeCKADTopicsPractice tasks › Add Readiness Probe
CKAD · Application Observability and Maintenance

Add Readiness Probe

In namespace default, Deployment api-deploy exists with a container listening on port 8080.

Check live lab access → All CKAD tasks

Live lab access

This task description is public. Live practice requires full access unless this is the selected free weekly task. See this week's free task.

Create an account to continue →

Read this week's free task →

On a phone? Read the task and create your account here, then sign in on a desktop or laptop for the terminal lab. Nothing starts until you choose Start.

The task

Task

In namespace default, Deployment api-deploy exists with a container listening on port 8080.

Requirements

Add a readiness probe to the Deployment with:

Ensure the Deployment rolls out successfully.

Original Prepium workshop · Tested on Kubernetes v1.35.8 on 8 September 2026; NetworkPolicy checks used Calico v3.32.2. Run this independent example in a disposable cluster. It does not require the simulator's private task files.

A running container can still be unready

The web server below serves / on port 80. Its readiness probe requests a path that does not exist. The container starts, but the Pod stays unready and the Service should have no ready backend.

1. Create the failing workload

Create prepium-tutorial if it does not already exist. Save this as probe-broken.yaml and apply it.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: probe-web
  namespace: prepium-tutorial
spec:
  replicas: 1
  selector:
    matchLabels:
      app: probe-web
  template:
    metadata:
      labels:
        app: probe-web
    spec:
      containers:
        - name: web
          image: nginx:1.27-alpine
          ports:
            - containerPort: 80
          readinessProbe:
            httpGet:
              path: /not-a-health-endpoint
              port: 80
            periodSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
  name: probe-web
  namespace: prepium-tutorial
spec:
  selector:
    app: probe-web
  ports:
    - port: 80
      targetPort: 80
kubectl create namespace prepium-tutorial
kubectl apply -f probe-broken.yaml
kubectl -n prepium-tutorial get pods -l app=probe-web
kubectl -n prepium-tutorial describe pods -l app=probe-web
kubectl -n prepium-tutorial get endpointslices -l kubernetes.io/service-name=probe-web -o yaml

Look for 0/1 ready containers, an HTTP 404 probe failure in events, and ready: false on the EndpointSlice endpoint. A Pod can be in phase Running while failing readiness; the phase alone is insufficient evidence.

2. Repair the application check

For this stock nginx workshop, / is a real served path. Change readinessProbe.httpGet.path to / in the file, keep port 80, and apply again. For your own application, choose an endpoint that actually represents readiness to serve traffic.

kubectl apply -f probe-broken.yaml
kubectl -n prepium-tutorial rollout status deployment/probe-web --timeout=120s
kubectl -n prepium-tutorial wait --for=condition=Ready pod -l app=probe-web --timeout=120s
kubectl -n prepium-tutorial get endpointslices -l kubernetes.io/service-name=probe-web -o yaml

Now the new Pod should be ready and its EndpointSlice endpoint should show ready: true. The Deployment change creates a new Pod; check the current ReplicaSet rather than reading old events from a terminating Pod.

3. Test the other common mistake

Change the probe's port to 8080, while leaving the server on 80. Expect a connection failure instead of an HTTP 404. Increasing the timeout cannot correct a wrong port. Restore port 80 and repeat the readiness and EndpointSlice checks.

Deleting the readiness probe would hide this particular failure without proving that the probe requirement was satisfied. In a scored task, both the configured check and the resulting ready state may matter. Read the actual requirements before making the workload appear green.

Example checkEvidence
Probe is configuredHTTP path / and port 80 under readinessProbe
Application is readyPod Ready condition is true
Service can select a ready backendMatching EndpointSlice has a ready endpoint

Readiness controls readiness for traffic; a failed liveness check can restart a container. Do not interchange them simply to make a test pass. See Kubernetes probe configuration.

Cleanup: kubectl delete namespace prepium-tutorial removes this workshop. Next, try Service selectors and rollout verification.

Exam
CKAD
Domain
Application Observability and Maintenance
Grading
Programmatic · partial credit

What this tests

Configure liveness, readiness, and startup probes, read logs, and debug running workloads. On the CKAD exam, Application Observability and Maintenance tasks are graded purely on what you build in the cluster - not multiple choice - so the only way to get faster is to do them on a real cluster against a clock.

Practice it for real

The public description lets you study the task before signing up. Full access includes this live lab; the selected Task of the Week is free with an account. You solve the task in a real terminal, hit validate, and a programmatic checker scores exactly what you got right and wrong (with partial credit). You can open the solution while practising, then retry and use the failed checks to improve your score.