Do this on ckad00027 and edit the given manifest file (that’s what the task expects).
0) Connect to correct host
ssh ckad00027
1) Open the manifest and identify the container + port
cd /home/candidate/spicy-pikachu
ls -l
sed -n '1,200p' app-deployment.yaml
Confirm the container port is 8081 in the YAML (usually under ports:).
2) Edit the YAML to add a readinessProbe
Edit the file:
vi app-deployment.yaml
Inside the Deployment, locate:
spec:
template:
spec:
containers:
- name: ...
image: ...
Add this under the container (same indentation level as image, ports, etc.):
readinessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 6
periodSeconds: 3
Notes:
Use port: 8081 (because the app runs on 8081).
Ensure indentation is correct (2 spaces per level commonly).
Save and exit.
3) Apply the updated manifest
kubectl apply -f /home/candidate/spicy-pikachu/app-deployment.yaml
4) Ensure the Deployment rolls out successfully
kubectl -n prod rollout status deploy app-deployment
5) Verify the readiness probe is set
Check the probe from the live object:
kubectl -n prod get deploy app-deployment -o jsonpath='{.spec.template.spec.containers[0].readinessProbe}{"\n"}'
And confirm pods are becoming Ready:
kubectl -n prod get pods -l app=app-deployment
If the label selector differs, just:
kubectl -n prod get pods
kubectl -n prod describe pod | sed -n '/Readiness:/,/Conditions:/p'
That completes the task: readiness probe on /healthz, initialDelaySeconds: 6, periodSeconds: 3.
Submit