Skip to main content

Basic IngressRoute

The simplest Traefik IngressRoute — route all traffic for a hostname to a single service.

Prerequisites​

Your app needs a Deployment and Service enabled:

base/base-values.yaml

image:
registry: docker.io
repository: traefik/whoami
tag: latest
port: 80

Configuration​

envs/prod/values.yaml

deployment:
enabled: true
replicas: 1

service:
enabled: true

customResources:
- |
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: my-app
annotations:
kubernetes.io/ingress.class: public-traefik
external-dns.alpha.kubernetes.io/target: public-v2.{{ .Values.captain_domain }}
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`{{ include "app.name" . }}.apps.{{ .Values.captain_domain }}`)
kind: Rule
services:
- name: '{{ include "app.name" . }}'
namespace: '{{ include "app.namespace" . }}'
port: 80

What Gets Created​

ResourceNamePurpose
Deploymentmy-app-prodRuns the application pods
Servicemy-app-prodClusterIP service for internal routing
IngressRoutemy-appRoutes external traffic to the service

Verify​

curl https://my-app-prod.apps.nonprod.antoniostacos.onglueops.com
note

The -prod suffix matches your environment folder name (envs/prod/). If you deploy to a different environment like envs/uat/, the suffix changes accordingly (e.g., my-app-uat).

Key Points​

  • The kubernetes.io/ingress.class: public-traefik annotation tells Traefik to handle this IngressRoute
  • The external-dns.alpha.kubernetes.io/target annotation creates the DNS record pointing to the load balancer
  • The service name must match the ArgoCD app name: <app-folder>-<env-folder> (e.g., my-app-prod)
  • Both web and websecure entrypoints are included so the app is reachable on both HTTP and HTTPS