Before you begin
You will need the following:- A running Talos cluster: If you don’t have one yet, see the Getting Started or Production Cluster guides to create a cluster.
-
kubectl and helm installed locally: Check out the Installing Helm guide to learn how to install Helm.
Verify your setup by running:
Step 1: Install the Gateway API CRDs and Traefik RBAC
The Gateway API resources (likeGateway, HTTPRoute, etc.) are not built into Kubernetes by default.
This step installs the required Custom Resource Definitions (CRDs) and grants Traefik the permissions it needs to manage them.
Step 2: Install Traefik via Helm
Next, install Traefik using the official Helm chart by doing the following:- Create a
values.yamlfile that enables the Gateway provider:
- Add the Traefik Helm repository and install:
Note: When you install Traefik with the kubernetesGateway provider enabled, it automatically creates a GatewayClass named traefik, so you don’t need to create one yourself.
Step 3: Create a Gateway
The Gateway defines the entry point for external traffic into your Kubernetes cluster and tells Traefik which ports and protocols to listen on. Here, we will create a simple HTTP listener on port 8000;Step 4: Deploy a Sample Application
Deploy a simple test application called whoami. This application returns information about each HTTP request it receives, making it easy to confirm routing behavior.Step 5: Create an HTTPRoute
Next, map all traffic from the Gateway’s web listener to thewhoami service using the HTTPRoute below.
Step 6: Test the Setup
Finally, verify that Traefik is routing traffic correctly. You will forward the Traefik service locally and send an HTTP request to yourwhoami application through the Gateway.