Part 3 Cumulative Quiz: Application Observability and Maintenance
Time Limit: 20 minutes (simulating exam pressure)
Passing Score: 80% (8/10 questions)
This quiz tests your mastery of:
- Application probes (liveness, readiness, startup)
- Container logging
- Debugging techniques
- Monitoring with kubectl top
- API deprecations
Instructions
Section titled “Instructions”- Try each question without looking at answers
- Time yourself—speed matters for CKAD
- Use only
kubectlandkubernetes.io/docs - Check answers after completing all questions
Questions
Section titled “Questions”Question 1: Liveness Probe
Section titled “Question 1: Liveness Probe”[2 minutes]
Create a Pod named health-check with nginx that:
- Has an HTTP liveness probe on path
/port80 - Checks every 10 seconds
- Waits 5 seconds before first check
Answer
cat << 'EOF' | k apply -f -apiVersion: v1kind: Podmetadata: name: health-checkspec: containers: - name: nginx image: nginx livenessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 10EOFQuestion 2: Readiness Probe
Section titled “Question 2: Readiness Probe”[2 minutes]
A pod webapp has a readiness probe configured, but it’s never becoming Ready. How do you investigate?
Answer
# Check pod statusk get pod webapp
# Describe to see probe config and eventsk describe pod webapp | grep -A10 Readinessk describe pod webapp | tail -20
# Check endpoints (pod should not be in endpoints if not ready)k get endpoints
# Check if probe path/port is correctk exec webapp -- curl -s localhost:8080/readyQuestion 3: Combined Probes
Section titled “Question 3: Combined Probes”[3 minutes]
Create a Deployment named api-server with 2 replicas that:
- Uses image
nginx - Has startup probe: HTTP GET
/port 80, failure threshold 30, period 10s - Has liveness probe: HTTP GET
/port 80, period 10s - Has readiness probe: HTTP GET
/port 80, period 5s
Answer
cat << 'EOF' | k apply -f -apiVersion: apps/v1kind: Deploymentmetadata: name: api-serverspec: replicas: 2 selector: matchLabels: app: api-server template: metadata: labels: app: api-server spec: containers: - name: nginx image: nginx ports: - containerPort: 80 startupProbe: httpGet: path: / port: 80 failureThreshold: 30 periodSeconds: 10 livenessProbe: httpGet: path: / port: 80 periodSeconds: 10 readinessProbe: httpGet: path: / port: 80 periodSeconds: 5EOFQuestion 4: Container Logs
Section titled “Question 4: Container Logs”[1 minute]
Get the last 50 lines of logs from the previous instance of container app in pod crashing-pod.
Answer
k logs crashing-pod -c app --previous --tail=50Question 5: Multi-Container Logs
Section titled “Question 5: Multi-Container Logs”[2 minutes]
A pod multi-app has containers named frontend and backend. Stream logs from both containers.
Answer
# All containers at oncek logs multi-app --all-containers -f
# Or separatelyk logs multi-app -c frontend -f &k logs multi-app -c backend -fQuestion 6: Debug CrashLoopBackOff
Section titled “Question 6: Debug CrashLoopBackOff”[2 minutes]
A pod is in CrashLoopBackOff. What’s your debugging workflow?
Answer
# 1. Check current statusk get pod crashing-pod
# 2. Get logs from crashed instancek logs crashing-pod --previous
# 3. Check exit code and eventsk describe pod crashing-pod | grep -A5 "Last State"k describe pod crashing-pod | tail -15
# 4. Check if liveness probe is too aggressivek describe pod crashing-pod | grep -A5 Liveness
# 5. If needed, check container configk get pod crashing-pod -o yaml | grep -A20 containersQuestion 7: Service Debug
Section titled “Question 7: Service Debug”[2 minutes]
A Service web-svc has no endpoints. How do you find and fix the problem?
Answer
# Check endpointsk get endpoints web-svc
# Get service selectork describe svc web-svc | grep Selector
# Get pod labelsk get pods --show-labels
# If labels don't match, fix the service or pods# Example: Fix service selectork patch svc web-svc -p '{"spec":{"selector":{"app":"correct-label"}}}'
# Verifyk get endpoints web-svcQuestion 8: Resource Monitoring
Section titled “Question 8: Resource Monitoring”[2 minutes]
Find the top 5 pods by memory usage across all namespaces.
Answer
k top pods -A --sort-by=memory | head -6(head -6 because first line is header)
Question 9: API Version Lookup
Section titled “Question 9: API Version Lookup”[1 minute]
What are the current API versions for these resources?
- Ingress
- CronJob
- NetworkPolicy
Answer
# Quick lookupk explain ingress | grep VERSIONk explain cronjob | grep VERSION# batch/v1
k explain networkpolicy | grep VERSION# networking.k8s.io/v1Question 10: Exec Probe
Section titled “Question 10: Exec Probe”[2 minutes]
Create a Pod named file-check with busybox that:
- Runs
sleep 3600 - Has a liveness probe that checks if file
/tmp/healthyexists - Probe runs every 5 seconds, initial delay 10 seconds
Answer
cat << 'EOF' | k apply -f -apiVersion: v1kind: Podmetadata: name: file-checkspec: containers: - name: busybox image: busybox command: ['sh', '-c', 'touch /tmp/healthy && sleep 3600'] livenessProbe: exec: command: - cat - /tmp/healthy initialDelaySeconds: 10 periodSeconds: 5EOFScoring
Section titled “Scoring”| Questions Correct | Score | Status |
|---|---|---|
| 10/10 | 100% | Excellent - Ready for exam |
| 8-9/10 | 80-90% | Good - Minor review needed |
| 6-7/10 | 60-70% | Review weak areas |
| <6/10 | <60% | Revisit Part 3 modules |
Cleanup
Section titled “Cleanup”k delete pod health-check file-check 2>/dev/nullk delete deploy api-server 2>/dev/nullKey Takeaways
Section titled “Key Takeaways”If you scored less than 80%, review these areas:
- Missed Q1-3: Review Module 3.1 (Probes) - probe types and configuration
- Missed Q4-5: Review Module 3.2 (Logging) - log commands and multi-container
- Missed Q6-7: Review Module 3.3 (Debugging) - systematic troubleshooting
- Missed Q8: Review Module 3.4 (Monitoring) - kubectl top commands
- Missed Q9: Review Module 3.5 (API Deprecations) - current versions
- Missed Q10: Review Module 3.1 (Probes) - exec probes
Next Part
Section titled “Next Part”Part 4: Application Environment, Configuration and Security - ConfigMaps, Secrets, SecurityContexts, and more.