Observability Quiz
Quiz
Question 1 of 24
(0 answered)
Question 1
What happens when a liveness probe fails in Kubernetes?
โ
Correct!
When a liveness probe fails, Kubernetes kills and recreates the container (not the entire pod). Other containers in the pod continue running.
โ
Incorrect
When a liveness probe fails, Kubernetes kills and recreates the container (not the entire pod). Other containers in the pod continue running.
Think about what ’liveness’ means - is the container alive?
Question 2
What happens when a readiness probe fails?
โ
Correct!
When a readiness probe fails, the pod is removed from service endpoints (no traffic) but the container continues running and is NOT restarted.
โ
Incorrect
When a readiness probe fails, the pod is removed from service endpoints (no traffic) but the container continues running and is NOT restarted.
Readiness determines if the pod should receive traffic.
Question 3
If one container’s readiness probe fails in a multi-container pod, only that specific container stops receiving traffic while others continue normally.
โ
Correct!
When ANY container’s readiness probe fails in a pod, the ENTIRE pod is marked as NOT ready and removed from service endpoints. No traffic goes to ANY container in the pod.
โ
Incorrect
When ANY container’s readiness probe fails in a pod, the ENTIRE pod is marked as NOT ready and removed from service endpoints. No traffic goes to ANY container in the pod.
Think about how Services route traffic to pods, not individual containers.
Question 4
Which are valid probe types in Kubernetes?
โ
Correct!
Kubernetes supports HTTP GET, TCP Socket, Exec (command), and gRPC probes. UDP Socket is not a supported probe type.
โ
Incorrect
Kubernetes supports HTTP GET, TCP Socket, Exec (command), and gRPC probes. UDP Socket is not a supported probe type.
There are four supported probe methods.
Question 5
A pod has this startup probe configuration. How long does the container have to successfully start before being killed?
startupProbe:
httpGet:
path: /startup
port: 8080
failureThreshold: 30
periodSeconds: 10What will this code output?
โ
Correct!
Total time = failureThreshold ร periodSeconds = 30 ร 10 = 300 seconds (5 minutes). The probe runs every 10 seconds and allows up to 30 failures.
โ
Incorrect
Total time = failureThreshold ร periodSeconds = 30 ร 10 = 300 seconds (5 minutes). The probe runs every 10 seconds and allows up to 30 failures.
Multiply the two values to get total allowed time.
Question 6
Arrange the probe execution order when a container starts:
Drag to arrange in the correct order
โฎโฎ
Startup probe runs
โฎโฎ
Container starts
โฎโฎ
Liveness and readiness probes begin
โฎโฎ
Startup probe succeeds
โ
Correct!
Container starts โ Startup probe runs (liveness/readiness disabled) โ Startup probe succeeds โ Liveness and readiness probes begin.
โ
Incorrect
Container starts โ Startup probe runs (liveness/readiness disabled) โ Startup probe succeeds โ Liveness and readiness probes begin.
Question 7
What kubectl command is used to view the last 100 lines of logs from a pod named ‘api-server’?
โ
Correct!
The
kubectl logs command with --tail=N flag limits output to the last N lines.โ
Incorrect
The
kubectl logs command with --tail=N flag limits output to the last N lines.Use the –tail flag with kubectl logs.
Question 8
What is the purpose of a startup probe?
โ
Correct!
Startup probes give slow-starting containers extra time to initialize. While the startup probe runs, liveness and readiness probes are disabled. Once it passes, the other probes take over.
โ
Incorrect
Startup probes give slow-starting containers extra time to initialize. While the startup probe runs, liveness and readiness probes are disabled. Once it passes, the other probes take over.
Think about applications that need time for database migrations or large data loads.
Question 9
According to logging best practices, applications should write logs to files inside the container for Kubernetes to collect them.
โ
Correct!
Best practice (12-factor app) is to log to stdout/stderr, which Kubernetes captures automatically. Writing to files requires additional configuration for log collection.
โ
Incorrect
Best practice (12-factor app) is to log to stdout/stderr, which Kubernetes captures automatically. Writing to files requires additional configuration for log collection.
Think about the 12-factor app principles.
Question 10
Complete the kubectl command to follow logs in real-time:
Fill in the missing flag
kubectl logs pod-name _____โ
Correct!
The
-f or --follow flag streams logs in real-time, similar to tail -f.โ
Incorrect
The
-f or --follow flag streams logs in real-time, similar to tail -f.Question 11
Which are appropriate use cases for a liveness probe?
โ
Correct!
Liveness probes detect deadlocks, hung processes, and trigger container restarts. Waiting for dependencies and cache warming are readiness probe use cases.
โ
Incorrect
Liveness probes detect deadlocks, hung processes, and trigger container restarts. Waiting for dependencies and cache warming are readiness probe use cases.
Liveness is about ‘is the container alive and working?’ not ‘is it ready for traffic?’
Question 12
What is the difference between liveness and readiness probes?
What is the difference between liveness and readiness probes?
Liveness Probe: Checks if container is alive. Failure = container killed and restarted.
Readiness Probe: Checks if container is ready for traffic. Failure = pod removed from service endpoints but container keeps running.
Did you get it right?
โ
Correct!
โ
Incorrect
Question 13
Which probe parameter specifies how long to wait after container startup before the first probe check?
โ
Correct!
initialDelaySeconds specifies the delay before the first probe check runs after the container starts.โ
Incorrect
initialDelaySeconds specifies the delay before the first probe check runs after the container starts.The parameter name describes what it does - an initial delay.
Question 14
What does this Prometheus query return?
rate(http_requests_total[5m])What will this code output?
โ
Correct!
The
rate() function calculates the per-second average rate of increase over the specified time window (5 minutes).โ
Incorrect
The
rate() function calculates the per-second average rate of increase over the specified time window (5 minutes).The rate() function calculates per-second averages.
Question 15
When a startup probe is configured, liveness and readiness probes run in parallel with it from container start.
โ
Correct!
When a startup probe is configured, liveness and readiness probes are DISABLED until the startup probe succeeds. Only then do the other probes begin.
โ
Incorrect
When a startup probe is configured, liveness and readiness probes are DISABLED until the startup probe succeeds. Only then do the other probes begin.
The startup probe gives the container time to start before other health checks begin.
Question 16
What Kubernetes add-on provides resource metrics for HPA and
kubectl top commands?โ
Correct!
Metrics Server is a Kubernetes add-on that collects resource metrics (CPU, memory) and exposes them for HPA and kubectl top.
โ
Incorrect
Metrics Server is a Kubernetes add-on that collects resource metrics (CPU, memory) and exposes them for HPA and kubectl top.
It’s a server that provides metrics.
Question 17
Which information should be included in structured logs according to best practices?
โ
Correct!
Structured logs should include trace IDs, user IDs, request IDs, and log levels for context. NEVER log sensitive data like passwords or API keys.
โ
Incorrect
Structured logs should include trace IDs, user IDs, request IDs, and log levels for context. NEVER log sensitive data like passwords or API keys.
Think about what helps with debugging and what poses security risks.
Question 18
What are the four pillars of observability in Kubernetes?
What are the four pillars of observability in Kubernetes?
1. Health Probes - Liveness, readiness, startup probes
2. Logging - Structured logs, centralized aggregation
3. Metrics - Prometheus, resource and custom metrics
4. Tracing - Distributed request flow tracking
Did you get it right?
โ
Correct!
โ
Incorrect
Question 19
Arrange the monitoring stack components in the correct data flow order:
Drag to arrange from source to destination
โฎโฎ
Alert Notification (Slack, PagerDuty)
โฎโฎ
Metrics Collection (Prometheus)
โฎโฎ
Visualization (Grafana)
โฎโฎ
Alerting Rules
โ
Correct!
Flow: Metrics Collection โ Visualization โ Alerting Rules โ Alert Notification
โ
Incorrect
Flow: Metrics Collection โ Visualization โ Alerting Rules โ Alert Notification
Question 20
In a pod with multiple containers, if Container A’s readiness probe passes but Container B’s fails, what is the result?
โ
Correct!
If ANY container’s readiness probe fails, the ENTIRE pod is marked NOT ready and removed from service endpoints. No traffic goes to any container.
โ
Incorrect
If ANY container’s readiness probe fails, the ENTIRE pod is marked NOT ready and removed from service endpoints. No traffic goes to any container.
Services route to pods, not individual containers.
Question 21
Complete the kubectl command to view logs from a previous crashed container:
Fill in the missing flag
kubectl logs pod-name _____โ
Correct!
The
--previous or -p flag shows logs from the previous container instance, useful when a pod has restarted.โ
Incorrect
The
--previous or -p flag shows logs from the previous container instance, useful when a pod has restarted.Question 22
The
successThreshold parameter in probes determines how many consecutive successes are needed before the probe is considered successful.โ
Correct!
successThreshold specifies the minimum consecutive successes for the probe to be considered successful after having failed. Default is 1.
โ
Incorrect
successThreshold specifies the minimum consecutive successes for the probe to be considered successful after having failed. Default is 1.
The parameter name describes exactly what it does.
Question 23
What command checks if Metrics Server is installed in your cluster?
โ
Correct!
The command
kubectl get deployment metrics-server -n kube-system directly checks for the Metrics Server deployment.โ
Incorrect
The command
kubectl get deployment metrics-server -n kube-system directly checks for the Metrics Server deployment.Metrics Server runs as a deployment in the kube-system namespace.
Question 24
What is the recommended logging format for Kubernetes applications and why?
What is the recommended logging format for Kubernetes applications and why?
Structured JSON logging is recommended because:
- Easy to parse programmatically
- Consistent key names enable filtering
- Integrates well with log aggregation systems (ELK, Splunk)
- Supports adding context (trace IDs, user IDs)
- Machine-readable for alerting and analysis
Did you get it right?
โ
Correct!
โ
Incorrect
Quiz Results
Score
0/0
Accuracy
0%
Right
0
Wrong
Skipped
0
Last updated on