0
0
Kubernetesdevops~20 mins

Probe timing parameters (initialDelay, period, timeout) in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Probe Timing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding initialDelaySeconds in Kubernetes probes
What is the main purpose of the initialDelaySeconds parameter in a Kubernetes liveness or readiness probe?
AIt specifies how often the probe runs after the first check
BIt defines the maximum time a probe can take before it times out
CIt sets how long to wait before starting the first probe after the container starts
DIt determines the number of failed probes before restarting the container
Attempts:
2 left
💡 Hint
Think about when the probe should start checking the container.
💻 Command Output
intermediate
1:30remaining
Effect of periodSeconds on probe frequency
Given this probe configuration snippet, how often will Kubernetes run the probe after the first check?
livenessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 10
  periodSeconds: 5
  timeoutSeconds: 2
AEvery 5 seconds after the initial delay
BEvery 10 seconds after the initial delay
COnly once after the initial delay
DEvery 2 seconds after the initial delay
Attempts:
2 left
💡 Hint
Look at the periodSeconds value.
💻 Command Output
advanced
2:00remaining
TimeoutSeconds effect on probe failure
What happens if a probe takes longer than the configured timeoutSeconds to respond?
readinessProbe:
  exec:
    command:
    - cat
    - /tmp/healthy
  initialDelaySeconds: 5
  periodSeconds: 10
  timeoutSeconds: 3
AThe container is immediately restarted
BThe probe waits indefinitely until the command finishes
CThe probe ignores the timeout and marks success
DThe probe is considered failed and Kubernetes acts accordingly
Attempts:
2 left
💡 Hint
TimeoutSeconds limits how long the probe waits for a response.
Troubleshoot
advanced
2:00remaining
Troubleshooting frequent container restarts due to probe timing
A container keeps restarting because its liveness probe fails. The probe is configured with initialDelaySeconds: 5, periodSeconds: 2, and timeoutSeconds: 1. The container takes about 10 seconds to start serving requests. What is the most likely cause?
AThe timeoutSeconds is too long, causing delayed failure detection
BThe initialDelaySeconds is too short, causing probes to run before the container is ready
CThe periodSeconds is too long, causing slow probe frequency
DThe probe command is incorrect and always fails
Attempts:
2 left
💡 Hint
Consider when the probe starts relative to container readiness.
Best Practice
expert
2:30remaining
Choosing probe timing parameters for a slow-starting application
You deploy a database container that takes 30 seconds to initialize. Which probe timing configuration best avoids false failures while ensuring quick detection of real failures?
livenessProbe:
  tcpSocket:
    port: 5432
  initialDelaySeconds: ?
  periodSeconds: ?
  timeoutSeconds: ?
AinitialDelaySeconds: 35, periodSeconds: 10, timeoutSeconds: 5
BinitialDelaySeconds: 10, periodSeconds: 5, timeoutSeconds: 1
CinitialDelaySeconds: 5, periodSeconds: 2, timeoutSeconds: 10
DinitialDelaySeconds: 0, periodSeconds: 1, timeoutSeconds: 1
Attempts:
2 left
💡 Hint
Think about waiting longer than startup time before probing.