1.8 KiB
1.8 KiB
🚦 Traefik Overview
Traefik is a modern reverse proxy and load balancer that makes deploying, securing, and managing microservices easier.
🔄 Core Concepts
1️⃣ Entrypoint 🛬
- The starting point for incoming requests.
- Example:
:80for HTTP or:443for HTTPS.
2️⃣ Router 🚏
- Decides where a request should go based on rules.
- Connects entrypoints to services.
3️⃣ Service 🛠️
- The actual application or backend that processes the request.
🧩 Routers Details
Routers can have:
-
Middleware 🧱
-
Modify requests/responses before reaching the service.
-
Examples:
StripPrefix➡️ Remove part of the URL path.RateLimit➡️ Limit request rate.Auth➡️ Add authentication.
-
-
Rules 📜
-
Define how to match a request.
-
Examples:
Host("example.com")PathPrefix("/api")
-
⚙️ Traefik Configuration Types
-
Static Configuration 🗂️
- Defines Traefik’s own behavior.
- Example: entrypoints, providers, log level.
- Set in
traefik.ymlor CLI args.
-
Dynamic Configuration 📡
- Defines how Traefik routes requests.
- Example: routers, services, middlewares.
- Comes from files, Kubernetes CRDs, or Docker labels.
🔗 Request Flow
Request
⬇️
Entrypoint 🛬
⬇️
Router 🚏
⬇️
Middleware 1 🧱 → Middleware 2 🧱
⬇️
Service 🛠️
🌟 Summary
Traefik acts like a smart traffic cop 🚓 for your microservices, ensuring that requests go exactly where they should, with the right rules and transformations applied along the way.