0

kubernetes ingress rules, AWS ALB rule has default path rule if no path is provided in the URL. I couldn't figure out similar config in Traefik ingressroute. Right now - https://example.com goes to the default wildfly page. https://example.com/foo goes to the app login page. How do I configure so that https://example.com would directly go to https://example.com/foo

Ingressroute:
spec:
  entryPoints:
    - web
    - websecure
  routes:
  - kind: Rule
    match: Host(`example.com`) && PathPrefix(`/`)
    middlewares:
      - name: https-redirect
        namespace: ns
    services:
    - name: service-1
      port: 80

Another ingressroute:

spec:
  entryPoints:
    - web
  routes:
    - match: Host(`example.com`)
      kind: Rule
      middlewares:
        - name: https-redirect
      services:
        - name: service-1
          port: 80

Middleware:

kind: Middleware
metadata:
  name: https-redirect
spec:
  redirectScheme:
    scheme: https
    permanent: true

1 Answers1

1

According to Traefik docs, you can create a typical defaultBackend Kubernetes Ingress like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
 name: cheese

spec:
  defaultBackend:
    service:
      name: stilton
      port:
        number: 80

You can then set priority for this Ingress to ensure it matches the right type of requests, as traefik.ingress.kubernetes.io/router.priority annotation. You can read more about this here.

zer0
  • 2,153
  • 10
  • 12