I'm trying to migration from V1 to V2 with the support of cert-manager which allows to have serveral replicas of traefik and avoid using 1Go volumes for acme.json
Ok found a first issue, when I create a certificate within the traefik2 namespace, the certificate request is handled by traefik v1 instance as it also matches the ingress class traefik.
As it's not on the same LB and the same IP, certificate is never issued.
I think I have a clue - I hope it's because I have both traefik v1 and traefik v2 in the same cluster and so they conflicts somehow. I tried to tuned ingressclass for Traefik2 to distinguish them but seems it did not work or I missed something.
I'll try next week by shuttng down traefik v1 and see if it works this way.
Ok got it - I'll write a detailed blog post by end of the week but, my main findings:
You can't have two traefik instances (v1.x & v2.x) in the same cluster as they would conflict. My certificate request for traefik v2 generated by cert-manager was intercepted by traefik v1. As traefik v2 in my setup has its own LB, it could never match. So I had to turn down traefik v1. I quickly tried to customize the ingress class for traefik v2 but I didn't get it right. This would have allowed me to say cert manager to use the traefikv2 ingress class instead of default one (linked with traefik v1)
As cert-manager will pop-up a traditionnal ingress, you need to enable kubernetes-ingress also on traefik v2 side
As annotations are no longer supported on traefik v2 side, you need to create a Certificate object
As I use a wildcard zone for my k8s cluster, switching from Traefik V1 LB to Traefik v2 LB, it may require you to wait a little bit so that Lets Encrypt certificates can be generated successfully.
Kubernetes Ingress mode in traefik v2 (without annotations) allows you to switch easily from v1 to v2 and then upgrade traditional ingress to traefik IngressRoutes
kubectl apply -f deployment.yaml
error: error validating "deployment.yaml": error validating data: [ValidationError(Deployment): unknown field "k8s-app" in io.k8s.api.apps.v1.Deployment, ValidationError(Deployment): unknown field "matchLabels" in io.k8s.api.apps.v1.Deployment, ValidationError(Deployment): unknown field "name" in io.k8s.api.apps.v1.Deployment, ValidationError(Deployment): unknown field "replicas" in io.k8s.api.apps.v1.Deployment, ValidationError(Deployment.spec): unknown field "containers" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): unknown field "serviceAccountName" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): unknown field "terminationGracePeriodSeconds" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec, ValidationError(Deployment.spec): missing required field "template" in io.k8s.api.apps.v1.DeploymentSpec]; if you choose to ignore these errors, turn validation off with --validate=false