To reduce repeated Terraform code caused by Kubernetes Services and Traefik IngressRoutes. These are needed to expose applications / services hosted on my homelab, but were previously defined in full for each.
To reduce repeated code, and allow for easy reuse, a Terraform module was created. This Terraform module can be expanded and changed to fit changing needs - for example it has already been expanded to connect to external endpoints, outside the Kubernetes cluster.
Additionally, the creation of the Terraform module also allowed for easier integration of Traefik plugins and middleware. Traefik plugins and middleware allow for extension and enhancement of the core Traefik functionality, from modifying paths at it's simplist through to integration of OIDC and WAFs.
Lastly, this project also served as a chance to improve my knowledge of variable validation in Terraform.