traefik2
A Traefik based Kubernetes ingress controller
About this chart
Traefik
Traefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
Introduction
This chart bootstraps Traefik version 2 as a Kubernetes ingress controller,
using Custom Resources IngressRoute: https://docs.traefik.io/providers/kubernetes-crd/.
Philosophy
The Traefik HelmChart is focused on Traefik deployment configuration.
To keep this HelmChart as generic as possible we tend to avoid integrating any third party solutions nor any specific use cases.
Accordingly, the encouraged approach to fulfill your needs:
- override the default Traefik configuration values (yaml file or cli)
- append your own configurations (
kubectl apply -f myconf.yaml) - extend this HelmChart (as a Subchart)
Installing
Prerequisites
With the command helm version, make sure that you have:
- Helm v3 installed
Add Traefik's chart repository to Helm:
helm repo add traefik https://helm.traefik.io/traefik
You can update the chart repository by running:
helm repo update
Deploying Traefik
helm install traefik traefik/traefik
Warning
If you are using Helm v2
You have to deploy CRDs manually with the following command:
kubectl apply -f traefik/crds
Exposing the Traefik dashboard
This HelmChart does not expose the Traefik dashboard by default, for security concerns. Thus, there are multiple ways to expose the dashboard. For instance, the dashboard access could be achieved through a port-forward :
kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000
Another way would be to apply your own configuration, for instance,
by defining and applying an IngressRoute CRD (kubectl apply -f dashboard.yaml):
# dashboard.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
- match: Host(`traefik.localhost`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
kind: Rule
services:
- name: api@internal
kind: TraefikService
Contributing
If you want to contribute to this chart, please read the Contributing Guide.
Deploy traefik2 with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has traefik2 on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttraefik2 is pinned at v9.18.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply