Forward kubernetes service (302)


I tried Traefik to forward kubernetes service(node port) in my LAN Network.

I have two services running on kubernetes

-simple 'hello' from google

  • Without Traefik, With Kubectl port-forward :
    All is working fine

  • With Traefik, Without Kubectl port-forward :

  • Hello service working fine.
  • Gitlab-ee doen't work but it has exactly the same configuration than hello service (except the port of course). This service is reachable on / but the gitlab server redirect us to /users/sign_in to login. Traefik don't follow this redirect and fall in timeout with 302 HTTP code.

How can i handle this redirection ?
is it normal that i have to ?

  dashboard=true # Enabled Dashboard

  certFile = "/var/traefik2/tls/mcert.crt"
  keyFile = "/var/traefik2/tls/mkey.key"
  stores = ["default"]

      certFile = "/var/traefik2/tls/mcert.crt"
      keyFile = "/var/traefik2/tls/mkey.key"


    address = ":443"  
    address = ":80"
      to = "websecure"
      scheme = "https"
      permanent = true


    rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
    service = "api@internal"
    middlewares = ["auth"]
    users = [

    entryPoints = ["web", "websecure"]
    rule = "Host(``) && Path(`/hello`)"
    service = "kub-hello-svc"

    entryPoints = ["web", "websecure"]
    rule = "Host(``) && Path(`/glab`)"
    service = "kub-gitlab-svc"


        url = ""                # hello - rancher

        url = ""                      # gitlab - rancher     /users/sign_in

# Config file
  directory = "/etc/traefik/"
  watch = true


Stucked from 3 days, thanks for your help )

Hey @StoryDevOffical

I ask out of curiosity, Why you don't use Kubernetes Ingress or Kubernetes Ingressroute in order to create routing?

Using statically assigned IP addresses is not a good idea, I would recommend to create Ingress configuration and refer to Kubernetes Service object that expose Gitlab.

Here is recording that should help you to achieve this Workshop: Getting Started with Traefik - YouTube

Hi @jakubhajek

I am running local cluster(k3s with rancher on premise) so i don't have external load balancer to work with ingress (related to external ip).

I just want to access my service on LAN network and forward them with traefik, like i can do with kubectl port-forward

Here i asked how can i replace kubectl port-forward, traefik was an advice so i'm trying it.