How to watch IngressRoutes with informer

Ive made my own DNS record provisioner that adds records based off annotations on services and ingresses. With kubernetes ingress I can do like this to watch for events:

	ingressInformer := informerFactory.Networking().V1beta1().Ingresses().Informer()


But how do I do this with traefik without importing the entire traefik github project?

You need to import the clientset, the informers, and the versioned CRDs, as demonstrated by the client code just like here:

That way you can use the externalversion factory to create your informers. This is what we do at line 167: traefik/client.go at master · traefik/traefik · GitHub

1 Like