Hi,
I tried Traefik to forward kubernetes service(node port) in my LAN Network.
I have two services running on kubernetes
-simple 'hello' from google
-gitlab-ee
-
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 ?
[accesslog]
[api]
insecure=true
dashboard=true # Enabled Dashboard
debug=false
[[tls.certificates]]
certFile = "/var/traefik2/tls/mcert.crt"
keyFile = "/var/traefik2/tls/mkey.key"
stores = ["default"]
[tls.stores]
[tls.stores.default]
[tls.stores.default.defaultCertificate]
certFile = "/var/traefik2/tls/mcert.crt"
keyFile = "/var/traefik2/tls/mkey.key"
# ENTRYPOINTS
[entryPoints]
[entryPoints.websecure]
address = ":443"
[entryPoints.web]
address = ":80"
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
permanent = true
# ROUTERS
[http.routers]
[http.routers.my-api]
rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
service = "api@internal"
middlewares = ["auth"]
[http.routers.my-api.tls]
[http.middlewares.auth.basicAuth]
users = [
]
[http.routers.kub-hello-router]
entryPoints = ["web", "websecure"]
rule = "Host(`192.168.3.121`) && Path(`/hello`)"
service = "kub-hello-svc"
[http.routers.kub-hello-router.tls]
[http.routers.rgitlab-router]
entryPoints = ["web", "websecure"]
rule = "Host(`192.168.3.121`) && Path(`/glab`)"
service = "kub-gitlab-svc"
[http.routers.rgitlab-router.tls]
# SERVICES
[http.services]
[http.services.kub-hello-svc]
[http.services.kub-hello-svc.loadBalancer]
[[http.services.kub-hello-svc.loadBalancer.servers]]
url = "http://192.168.160.2:31080/hello" # hello - rancher
[http.services.kub-gitlab-svc]
[http.services.kub-gitlab-svc.loadBalancer]
[[http.services.kub-gitlab-svc.loadBalancer.servers]]
url = "http://192.168.160.2:31090" # gitlab - rancher /users/sign_in
# Config file
[providers.file]
directory = "/etc/traefik/"
watch = true
# ERROR DEBUG INFO
[log]
level="INFO"
Stucked from 3 days, thanks for your help )