Skip to content

Traefik not redirecting properly if updated #10114

@JogeshwarS

Description

@JogeshwarS

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

We setup treafik in our EKS cluster on AWS. Everything was working fine. Mistakenly, we delete the service file and after recreating it the redirection was properly working.
Before reapplying service file:

routes:
    - match: Host(`demo.xyz`) && PathPrefix(`/`)
      kind: Rule
      services:
        - name: frontend
          port: 3000
          namespace: frontend-ns
    - match: Host(`demo.xyz`) && PathPrefix(`/api`)
      kind: Rule
      services:
        - name:api
          port: 8080
          namespace: frontend-ns

was working fine for both endpoint
After reapplying the service file:
/api was redirecting to demo.xyz without any issue in the logs

What did you see instead?

After hours of debugging (We didn't get anything), we deleted Traefik completed and reinstalled it, and then it started working again

What version of Traefik are you using?

2.10.1

What is your environment & configuration?

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: proxy-ingress-https-routes
  namespace: proxy-gateway-ns
  annotations:
    kubernetes.io/ingress.class: "traefik"
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/router.tls.certresolver: myresolver
    traefik.ingress.kubernetes.io/router.middlewares: httptohttps@kubernetescrd
    traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
    traefik.frontend.redirect.entryPoint: https
spec:
  entryPoints:
    - web
    - websecure
  routes:
    - match: Host(`demo.xyz`) && PathPrefix(`/`)
      kind: Rule
      services:
        - name: frontend
          port: 3000
          namespace: frontend-ns
    - match: Host(`demo.xyz`) && PathPrefix(`/api`)
      kind: Rule
      services:
        - name: api
          port: 8080
          namespace: frontend-ns
  tls:
    secretName: tls-certs
    options:
      name: proxy-tls-options
      namespace: proxy-gateway-ns

If applicable, please paste the log output in DEBUG level

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions