Retry middleware not working

Hi
I'm currently working on setting up retry middleware for my service running on Kubernetes with Traefik. Here's the configuration I've used:

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: test-retry
spec:
  retry:
    attempts: 4
    initialInterval: 100ms

I was hoping this middleware would handle retries in case of service failures. However, I'm encountering a couple of issues:

  • When I delete all service pods, I receive a "No Response" message, and it seems that Traefik only attempts the request once.
  • I also tested with a long delay (sleep) in my service, expecting Traefik to retry, but I received a 504 status code and there were no additional attempts.

Could anyone help me understand how to ensure this middleware is functioning correctly or provide guidance on how to properly test it? Any insights into what might be going wrong or additional steps I should take would be greatly appreciated.

2 Likes