How to programmatically create Traefik resources through Kubernetes Operator

Hi, we're investigating the possibility to programmatically create Traefik V2 resources (e.g. Middlewares and IngressRoutes) by means of a golang Kubernetes Operator, that would watch for specific resources (in this case a standard Kubernetes Ingress) and then would create a Middleware/IngressRoute accordingly to that Ingress specifications.

What is the best practice here? I've not found a Traefik cliend sdk to be used with our Go code.
We were thinking about using exposed rest apis, but from documentation it seems to me that are read-only? Traefik API Documentation - Traefik

So should we create Yaml dinamically "by hand"?

The problem was with my wrong understanding about how Go operators work. I was very easily able to do what I wanted by importing this dependency into the go.mod file —>

require (
   [...]
   github.com/traefik/traefik/v2 v2.8.1
   [...]
)

Then Traefik CRDs were instantly available into the code of my operator, and I was able to create Traefik resources into a target cluster

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.