What is a readiness probe?

0104

A readiness probe is a mechanism in Kubernetes used to determine if a container is ready to accept traffic. It helps manage the lifecycle of applications by ensuring that only healthy and fully initialized containers receive requests.

Key Points:

  • Purpose: To check if the application inside the container is ready to handle requests.
  • Behavior: If the readiness probe fails, Kubernetes will stop sending traffic to that container until it passes the probe again.
  • Configuration: You can configure readiness probes using various methods, such as HTTP GET requests, TCP socket checks, or executing commands inside the container.

Example:

A common configuration for a readiness probe might look like this in a deployment YAML:

readinessProbe:
  httpGet:
    path: /health
    port: 80
  initialDelaySeconds: 5
  periodSeconds: 10

In this example, Kubernetes checks the /health endpoint on port 80 every 10 seconds after an initial delay of 5 seconds.

If you have more questions or need further details, feel free to ask!

0 Comments

no data
Be the first to share your comment!