Skip to main content
In this guide, you’ll learn how to deploy Traefik as an Ingress controller on your Kubernetes cluster. We cover:
  1. Manual installation using Kubernetes manifests (Quick Start)
  2. Installation with Helm and customizing the service type
  3. Deploying a demo application behind Traefik
  4. Enabling and viewing Traefik access logs

Table of Contents

  1. Manual Installation (Quick Start)
  2. Helm Installation
  3. Demo App Ingress Configuration
  4. Viewing Traefik Logs
  5. 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 a ClusterRole:
Bind this role to a ServiceAccount in the 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):
Apply all resources:
Check the LoadBalancer IPs:

2. Helm Installation

Installing Traefik via Helm simplifies upgrades and customization.

2.1 Add the Traefik Helm Repository

2.2 Install with Default Values

Verify resources:

2.3 Customizing the Service Type

On clusters without a LoadBalancer (e.g., bare-metal), switch to NodePort. Create values.yaml:
Upgrade the release:
Confirm the NodePort assignment:
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

Apply:

3.2 Configure an Ingress Resource

Create whoami-ingress.yaml:
Apply and verify:
Access the demo app:

4. Viewing Traefik Logs

Tail the Traefik pod’s logs to inspect both general and access logs:
With logs.access.enabled: true, each HTTP request is recorded in the logs.

Watch Video

Practice Lab