Best/Bulletproof migration check list from v1 to v2 (on Kubernetes)


We have more or less 2500 Ingress, and we need to migrate from Traefik v1.7 to Traefik v2.5 (in order to upgrade k8s to 1.22, cause traefik v1 is not compliant with kubernetes v1.22).

We read this manual: Traefik v1 to v2 | Traefik | v2.5 and understood v1 annotations will not be compliant with traefik v2.

We found in this documentation:

  • Ingress objects without traefik specific v1 annotations are traefik v2 compliants
  • Ingress objects with traefik specific v1 annotations (referenced here: Kubernetes Ingress | Traefik | v1.7) must be transformed to IngressRoutes + Middleware objects

We didn't found in this migration documentation, but found sniffing around:

1. What do you think about this above check list or we missed something ? Or do you have a better and improved checklist to identify v2 not compliant 'things' ?
(@jakubhajek @ldez )

We considered this following zero downtime migration strategy:

  • list and post to customers all not compliant objects (in the above checklist)
  • leave time to customers in this list to prepare and deliver on k8s clusters v2 compliant objects
    • For customers objetcs not in this list (Ingress and Services without traefik annotations): nothing to do
    • For customers objects in this list: they create v2 compliant objects/annotations (and still continue to deliver v1 compliant)
  • all customers delivered v2 compliant objects: upgrade traefik v1 to v2 on cluster

2. What do you think about this strategy ? Do you have a better and improved one ?

Thank you.


Hello @Berber-31-33

Thanks for asking the question.

You can have a look at the blog post:

one of our Ambassadors shared his experience with migration from v1 to v2. The blog post covers migration based on Docker but the high-level idea seems to be good enough for the Kubernetes environment as well.

We can't say if your strategy is good enough since we don't know how does your environment works and what else might be impacted during the migration process. We published the prerequisites that should be met once preparing for the migration such as migrating annotation from v1 to v2, or by using the Traefik Migration tool that migrates from Ingress to Ingressroute CRD - as I've already explained in another post

Each environment is different that's why there is no ready-to-use plan that can be used. I would definitely try to test the plan in a test environment before going further with a live environment. You can install Traefik V1 together with V2 on the same cluster and based on labelselector, namespace, or ingressclass set which object should be processed by v2. Having such installation you can consider implementing gradual migrations.
I hope that some of those pieces of information can be helpful.

I would love to see how other community users are dealing with such migrations.

Thank you,

1 Like