Kube-probe HTTP probe failed with status code 400

The application received a bad request from the probe.

Understanding Kube-probe

Kube-probe is a diagnostic tool used in Kubernetes to monitor the health of applications running in a cluster. It helps ensure that applications are running smoothly by periodically checking their status and readiness. Kube-probe can be configured to perform HTTP, TCP, or command-based checks, making it versatile for different types of applications.

Identifying the Symptom

When using Kube-probe, you might encounter an error message stating: HTTP probe failed with status code 400. This indicates that the probe sent an HTTP request to the application, but the application responded with a 400 Bad Request status code.

What is a 400 Status Code?

A 400 Bad Request status code means that the server could not understand the request due to invalid syntax. This is often caused by incorrect request parameters or headers.

Exploring the Issue

The error HTTP probe failed with status code 400 suggests that the probe's request is not properly formatted or is missing required information. This can happen if the probe configuration is incorrect or if the application expects specific headers or parameters that are not being sent.

Common Causes

  • Incorrect probe path or method.
  • Missing or incorrect headers in the probe request.
  • Application misconfiguration expecting certain parameters.

Steps to Fix the Issue

To resolve the issue, follow these steps:

1. Verify Probe Configuration

Check the probe configuration in your Kubernetes deployment YAML file. Ensure that the httpGet path and port are correct. Here is an example of a correct configuration:

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

Ensure that the path matches the application's health endpoint.

2. Check Application Logs

Inspect the application logs to see if there are any clues about why the request is being rejected. Look for log entries around the time the probe fails. This can provide insights into what the application expects.

3. Test the Endpoint Manually

Use curl or a similar tool to manually send a request to the application's health endpoint. For example:

curl -v http://your-application-url:8080/healthz

Check the response and ensure it matches what the probe is sending.

4. Adjust Headers or Parameters

If the application requires specific headers or parameters, modify the probe configuration to include them. Unfortunately, Kubernetes HTTP probes have limited header configuration options, so you may need to adjust the application to accept the default probe request.

Additional Resources

For more information on configuring probes in Kubernetes, refer to the official Kubernetes documentation. If you need to troubleshoot further, consider using tools like kubectl to inspect pod and container statuses.

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