Traefik

Traefik proxy is reverse proxy which can be used as ingress controller for workloads running in local Docker Compose or Kubernetes

Perquisites

  1. helm

  2. localhost.direct as DNS for localhost with HTTPS (SSL) and sub-domain support

Traefik with Docker Compose

Follow compose docs to setup docker compose env.

network-diagram-compose-tls-traefik.png

Traefik with Kubernetes

Install and configure Traefik Proxy to use as Gateway API of Kubernetes We will be setting localhost.direct FQDN to point to your localhost (127.0.0.1) along with its wildcard certs.

Source: Run Traefik with Kubernetes in Docker Desktop

ingress-vs-gateway-api
gateway-api
  1. Create traefik kubernetes namespace if not exists

  1. Create wildcard-localhost-direct-tls secret

  1. Deploy Gateway API CRD's (One time Task)

  1. Deploying Traefik Proxy v3.0

Gateway API is not installed on Kubernetes clusters by default.

  1. Verify

The service named service/traefik should get a EXTERNAL-IP of localhost which can be seen in the list printed above

This means that you can access the Traefik load balancer by navigating to https://traefik.localhost.direct/dashboard/#/ in your browser.

  1. ALL DONE - Enjoy

Last updated

Was this helpful?