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

HTTPS redirect annotation does not work #992

Open
sandeepsharmadevops opened this issue Mar 17, 2019 · 10 comments
Open

HTTPS redirect annotation does not work #992

sandeepsharmadevops opened this issue Mar 17, 2019 · 10 comments
Assignees
Labels

Comments

@sandeepsharmadevops
Copy link

Hi There!

I have recently started evaluating the Skipper as an ingress controller for K8S, at very initial level need info on how to disable the HTTPS redirect, i have tried the below but nothing worked for me so far.

using latest version of skipper 0.10.180

below cmd line options are not passed, but HTTP --> HTTPS is happening, is this there OOB?, can we disable from skipper cmd line option?
-kubernetes-https-redirect
-kubernetes-https-redirect-code

tried to disable via annotations in ingress k8s object, but still redirection is happening, how to disable it
zalando.org/skipper-ingress-redirect: false

NOTE: as current i don't have requirement to redirect HTTP --> HTTPS

Thx.

@szuecs
Copy link
Member

szuecs commented Mar 17, 2019

Hi!
You can disable it via command line option -kubernetes-https-redirect=false.
If the ingress annotation doesn’t work we will consider this also as bug.

Latest is https://github.com/zalando/skipper/releases/tag/v0.10.186 , but this won’t fix the ingress annotation.

@szuecs szuecs assigned szuecs and unassigned szuecs Mar 17, 2019
@szuecs szuecs added bugfix Bug fixes and patches question labels Mar 17, 2019
@sandeepsharmadevops
Copy link
Author

thanks for update @szuecs able to disable the HTTPS redirect with suggestion above, it seems this is by default available even cmd line options is not defined...correct?

Annotations are not working, after disabling the HTTPS redirect, tried to enable via annotations, but not working, seems a bug, even not able to view annotations in YAML output, blank annotations.

Thx

@szuecs
Copy link
Member

szuecs commented Mar 17, 2019

@sandeepsharmadevops thanks for testing the annotation!
Yes the default is set to =true. It's basically how Go flags package work and we set the default to true, because we thought it makes sense for most people.

@szuecs szuecs changed the title how to disable HTTPS redirect HTTPS redirect annotation does not work Mar 17, 2019
@sandeepsharmadevops
Copy link
Author

sandeepsharmadevops commented Mar 18, 2019

@szuecs yes, it make sense to enable it oob, in case someone want to disable it, can be done via controller, only downside of this, that it applies globally, until annotations working.

one more thing, i was evaluating ip whitelisting via annotations, it working fine as expected and throwing 404, can we customize the response status code/content. Intention is to allow only few ip ranges for rest send 404 with custom content.

@sandeepsharmadevops
Copy link
Author

Hi @szuecs could you please share info about the above.

Thanks in advance.

@szuecs
Copy link
Member

szuecs commented Apr 3, 2019

@sandeepsharmadevops Sorry for not replying, missed this comment.

If the annotation is not working it is a bug. I have to test it and then fix it.
For the custom 404 you can use a custom inline route or an eskip routes file, that does a default match for everything:

skipper -inline-routes 'mycatchall: * -> inlineContent("Hello, world!") -> status(404) -> <shunt>' 

You can pass inlineContent(string) an html string if you like.

@sandeepsharmadevops
Copy link
Author

Thanks for update @szuecs even i was not looking for the prompt response. I will try your suggestions and let you know. Also let me know once bug in annotation gets fixed, i will test and let you know about the status.

Thanks Again!!!

@justinrcs
Copy link
Contributor

Using the annotation does work, double check that your annotation is using quotes around the value, otherwise Skipper will ignore it.

zalando.org/skipper-ingress-redirect: "false"

szuecs added a commit that referenced this issue Jul 26, 2019
Signed-off-by: Sandor Szücs <[email protected]>
aryszka pushed a commit that referenced this issue Jul 26, 2019
* make docs more clear and add links from reference to tutorial

Signed-off-by: Sandor Szücs <[email protected]>

* make also #992 more clear

Signed-off-by: Sandor Szücs <[email protected]>
@myaser
Copy link
Member

myaser commented Jul 22, 2020

what is the status of this issue
I see it was documentation issue, or there is a bug still?

I would like to contribute to skipper (Kubernetes ingress controller area) and was searching for my first issue 😄

@szuecs
Copy link
Member

szuecs commented Jul 22, 2020

@myaser the issue is not fixed.
Basically the default -kubernetes-https-redirect=true can not be overridden by zalando.org/skipper-ingress-redirect: "false" annotation.
Seems to be more simple than #1478 to fix, because testing is more simple and you don't need to introduce new types, which is in refactoring for adding a validation webhook for routegroups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants