- Manual installation using Kubernetes manifests (Quick Start)
- Installation with Helm and customizing the service type
- Deploying a demo application behind Traefik
- Enabling and viewing Traefik access logs
Table of Contents
- Manual Installation (Quick Start)
- Helm Installation
- Demo App Ingress Configuration
- Viewing Traefik Logs
- Links and References
1. Manual Installation (Quick Start)
This section walks you through deploying Traefik using static YAML manifests. We’ll configure RBAC, deploy Traefik, and expose it via LoadBalancer services.1.1 Create RBAC Resources
Traefik needs permission to watch and update Kubernetes resources. First, define aClusterRole:
kube-system namespace:
Ensure your cluster’s RBAC is enabled. If you run into
Forbidden errors, verify that the ServiceAccount and ClusterRoleBinding are created correctly.1.2 Deploy the Traefik Controller
Create a Deployment for Traefik, specifying the ServiceAccount:The
--api.insecure flag enables an unsecured dashboard. Do not use this in production environments. For secure dashboards, configure TLS and authentication.Expose Traefik with LoadBalancer Services
Create a Service manifest (traefik-svc.yaml):
2. Helm Installation
Installing Traefik via Helm simplifies upgrades and customization.2.1 Add the Traefik Helm Repository
2.2 Install with Default Values
2.3 Customizing the Service Type
On clusters without a LoadBalancer (e.g., bare-metal), switch toNodePort. Create values.yaml:
If you change ports in
values.yaml, ensure your firewall or cloud provider permits traffic on the new NodePorts.3. Demo App Ingress Configuration
Deploy a simple “whoami” service and expose it via Traefik.3.1 Deploy the whoami Application
3.2 Configure an Ingress Resource
Createwhoami-ingress.yaml:
4. Viewing Traefik Logs
Tail the Traefik pod’s logs to inspect both general and access logs:logs.access.enabled: true, each HTTP request is recorded in the logs.
5. Links and References
- Traefik Official Documentation
- Kubernetes Ingress Concepts
- Helm Chart for Traefik
- Traefik “whoami” Docker Image