Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected request redirect behaviour in kubernetes #3589

Closed
octopusx opened this issue Jul 10, 2018 · 2 comments
Closed

Unexpected request redirect behaviour in kubernetes #3589

octopusx opened this issue Jul 10, 2018 · 2 comments
Assignees
Labels
area/provider/k8s/ingress kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Milestone

Comments

@octopusx
Copy link

Do you want to request a feature or report a bug?

Bug

What did you do?

Deployed Traefik 1.6.3 to our organisation kubernetes cluster to use it for ingress. Trying to replace Nginx.
Some of our services require redirects and this is configured as annotations in their ingress kubernetes manifests.

When we did this using Nginx the following annotation did the job:

 apiVersion: extensions/v1beta1
 kind: Ingress
 
 metadata:
   annotations:
     nginx.ingress.kubernetes.io/app-root: /folder/index.html

Traefik has a similar annotation available as described here:

 apiVersion: extensions/v1beta1
 kind: Ingress
 
 metadata:
   annotations:
     traefik.ingress.kubernetes.io/app-root: /folder/index.html

We expected it to work in a similar fashion, as is indicated by the documentation, however the requests were not forwarded.

Much to our surprise after an amount of testing we found that enabling the ssl-redirect flag solves the problem:

 apiVersion: extensions/v1beta1
 kind: Ingress
 
 metadata:
   annotations:
     traefik.ingress.kubernetes.io/ssl-redirect: "true"
     traefik.ingress.kubernetes.io/app-root: /folder/index.html

The issue here is that either this is unexpected behaviour (that redirection doesn't work without the extra flag) or it is intended and therefore documentation should be updated accordingly.

I tried to provide an adequate level of detail without posting internal company data but please ask if you need more specific information or examples of any of the points mentioned in the issue.

What did you expect to see?

Executing the following: curl --verbose -L -k --header 'Host: target.com' 'http://our.traefik.deployment.com' should get us:

[...]
GET / HTTP/1.1
[...]
HTTP/1.1 301 Moved Permanently
[...]
GET /folder/index.html HTTP/1.1
[...]
HTTP/1.1 200 OK
[...]

What did you see instead?

Executing the following: curl --verbose -L -k --header 'Host: target.com' 'http://our.traefik.deployment.com' gets us:

[...]
GET / HTTP/1.1
[...]
HTTP/1.1 503 Service Unavailable
[...]

Output of traefik version: (What version of Traefik are you using?)

Version:      v1.6.3
Codename:     tetedemoine
Go version:   go1.10.2
Built:        2018-06-05_03:29:01PM
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml, provider, platform, ...)?

Traefik config:

logLevel = "DEBUG"
defaultEntryPoints = ["http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"

[ping]
entryPoint = "http"

[kubernetes]
namespaces = ["default", "kube-system"]

[web]
address = ":8080"

[api]
entryPoint = "traefik"
dashboard = true

[lifecycle]
gracetimeout = "80s"
requestacceptgracetimeout = "40s"

Kubernetes version:

Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3+coreos.0", GitCommit:"f1b890dbbf11abe58280b3ffe17d67749f5ae70e", GitTreeState:"clean", BuildDate:"2018-05-21T17:27:17Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Thank you for reading!

@dtomcej dtomcej added area/provider/k8s/ingress priority/P2 need to be fixed in the future kind/bug/confirmed a confirmed bug (reproducible). and removed status/0-needs-triage labels Jul 10, 2018
@dtomcej dtomcej self-assigned this Jul 10, 2018
@dtomcej
Copy link
Contributor

dtomcej commented Jul 10, 2018

Confirmed. According to the validation from (https://kubernetes.github.io/ingress-nginx/examples/rewrite/README/#app-root), we are not providing the same behaviour.

@traefiker
Copy link
Contributor

Closed by #3592.

@traefiker traefiker added this to the 1.7 milestone Jul 12, 2018
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/provider/k8s/ingress kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

3 participants