How to delete a middleware after it is created?

Hello, I'm new to traefik. I've been testing it and ended up creating a lot of wrong middlewares.. I can see it in the dashboard, however I've found no way to delete it and it's pretty annoying. I'm using AWS EKS and Flux. If I change the middleware name, it creates a new one instead. Is there a command line or something to clean things up?

Thanks in advance.

hi @GioB

Thanks for using Traefik and asking the question. Seems that issue you describe is not directly related to Traefik, however I will try to give you some hints.

Deleting middleware is easy as deleting Kubernetes objects. The middlewares are recreated probably because of the FluxCD that is connected with any Git repository as a source of truth of your cluster.
I recommend to see what are the sources added to Flux, a few commands that can be helpful:

  • flux get all
  • flux get source git -A

If you don't have Flux binary installed you can use crd's:

kubectl get gitrepositories.source.toolkit.fluxcd.io -A

You should see that Flux is connected to repository with the entire configuration. You should update the repository by updating / deleting the files otherwise if you do that manually, the reconciliation loop that is part of Flux will recreate the objects again.

Hope that helps,