Kube-probe HTTP probe failed with status code 404

The HTTP probe is trying to access a path that does not exist on the application.

Understanding Kube-probe

Kube-probe is a diagnostic tool used within Kubernetes to monitor the health of applications running in a cluster. It helps ensure that applications are running smoothly by checking their availability and responsiveness. Kube-probe can perform HTTP, TCP, and command-based checks to verify the status of an application.

Identifying the Symptom

One common symptom that developers encounter is the error message: HTTP probe failed with status code 404. This indicates that the HTTP probe attempted to access a specific path on the application, but the server returned a 404 Not Found status code.

What is a 404 Status Code?

A 404 status code is an HTTP response status code indicating that the server could not find the requested resource. This typically means that the URL path specified in the request does not exist on the server.

Details About the Issue

The error occurs when the HTTP probe is configured to check a path that is not available on the application. This could be due to a typo in the URL, a misconfiguration in the probe settings, or the endpoint not being implemented in the application.

Common Causes

  • Incorrect path specified in the probe configuration.
  • The application has not yet started serving the endpoint.
  • The endpoint was removed or renamed in the application code.

Steps to Fix the Issue

To resolve the HTTP probe failed with status code 404 issue, follow these steps:

Step 1: Verify the Probe Configuration

Check the probe configuration in your Kubernetes deployment YAML file. Ensure that the path specified in the httpGet section matches a valid endpoint on your application. For example:

livenessProbe:
httpGet:
path: /healthz
port: 8080

Ensure that /healthz is a valid endpoint.

Step 2: Test the Endpoint Manually

Use a tool like curl to manually test the endpoint. Run the following command to check if the endpoint is accessible:

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

If you receive a 404 status code, the endpoint may not exist or be incorrectly configured.

Step 3: Update the Application Code

If the endpoint is missing, update your application code to include the necessary endpoint. Ensure that the application is serving the endpoint correctly.

Step 4: Redeploy the Application

After making changes to the probe configuration or application code, redeploy your application to apply the updates. Use the following command to apply changes:

kubectl apply -f your-deployment-file.yaml

Conclusion

By following these steps, you can resolve the HTTP probe failed with status code 404 issue in Kubernetes. Ensuring that your probe configurations are accurate and your application endpoints are correctly implemented will help maintain the health and availability of your applications. For more information, refer to the Kubernetes documentation on probes.

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