From the demo from traefik image page,it can route Host:{containerName}.{domain} to container by default like this: Can traefik do this in k8s provider?
This requirement can be solved by Traefik Template.
# Override default configuration template.
#
# Optional
# Default: <built-in template>
#
# filename = "kubernetes.tmpl"
The template write by go template, then you can do everything in the template.