Kube-probe Readiness probe failed: service unavailable

The application is not ready to serve traffic.

Understanding Kube-probe

Kube-probe is a diagnostic tool used in Kubernetes to check the health of applications running in a cluster. It helps ensure that applications are running smoothly and are ready to handle requests. Kube-probe can perform both liveness and readiness checks, which are crucial for maintaining the stability and reliability of applications.

Identifying the Symptom

One common symptom encountered when using Kube-probe is the error message: Readiness probe failed: service unavailable. This indicates that the readiness probe has determined that the application is not ready to serve traffic, which can lead to issues with service availability and user experience.

What is Observed?

When this error occurs, you may notice that the application is not accessible, and Kubernetes may not route traffic to the pod. This can result in downtime or degraded service performance.

Exploring the Issue

The readiness probe is designed to check whether an application is ready to handle requests. If the probe fails, it means that the application has not yet reached a state where it can serve traffic reliably. This can be due to several reasons, such as incomplete initialization, missing dependencies, or configuration errors.

Understanding the Error Code

The error code service unavailable typically indicates that the application is not responding as expected. This can be due to the application not being fully initialized or other underlying issues that prevent it from being ready.

Steps to Fix the Issue

To resolve the readiness probe failure, follow these steps:

1. Verify Application Initialization

Ensure that the application has completed its initialization process. Check the application logs for any errors or warnings that might indicate issues during startup. You can use the following command to view logs:

kubectl logs <pod-name>

2. Check Readiness Probe Configuration

Review the readiness probe configuration in your Kubernetes deployment. Ensure that the probe is correctly configured to check the appropriate endpoint or command. For example:


readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 5

Adjust the initialDelaySeconds and periodSeconds as needed to give the application sufficient time to initialize.

3. Validate Application Dependencies

Ensure that all necessary dependencies and services are available and running. This may include databases, external APIs, or other services that the application relies on. Use the following command to check the status of other services:

kubectl get pods

4. Test Application Endpoint

Manually test the application's readiness endpoint to ensure it responds correctly. You can use curl or a similar tool:

curl http://<pod-ip>:8080/healthz

If the endpoint does not return a successful response, investigate further into the application code or configuration.

Additional Resources

For more information on configuring readiness probes, refer to the Kubernetes documentation. Additionally, consider exploring container probes for a deeper understanding of how probes work in Kubernetes.

Master

Kube-probe

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

Kube-probe

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the whitepaper on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid