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

Http redirect to https using annotations doesn't work #7935

Closed
1 task done
trhumphries opened this issue Oct 6, 2021 · 4 comments
Closed
1 task done

Http redirect to https using annotations doesn't work #7935

trhumphries opened this issue Oct 6, 2021 · 4 comments
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale

Comments

@trhumphries
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong 2.5

Current Behavior

I have an ingress controller that uses the annotations for force http to https redirect. Its defined as:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-api
  namespace: test
  annotations:
    konghq.com/https-redirect-status-code: '302'
    konghq.com/protocols: https
    konghq.com/snis: api-ci.test.com
    kubernetes.io/ingress.class: kong
spec:
  tls:
    - hosts:
        - api-ci.test.com
      secretName: test-tls-csi
  rules:
    - host: api-ci.test.com
    - http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: test-api
                port:
                  number: 80

Note in this example sensitive data is obfuscated.

Using http://api-ci.test.com from a browser results in a response of:
{"message":"no Route matched with those values"}

While changing to https://api-ci.test.com results in the page being loaded via https

Expected Behavior

When I use http:// it should redirect to https://

Steps To Reproduce

See the Ingress example above

Anything else?

No response

@dndx dndx added the area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller label Oct 6, 2021
@fffonion
Copy link
Contributor

fffonion commented Oct 6, 2021

Might be an question for @Kong/team-k8s

@trhumphries
Copy link
Author

That link leads to a 404

@rainest
Copy link
Contributor

rainest commented Oct 8, 2021

The link is a means to send our team a Github notification mostly. It also goes to an internal project board that's only visible if you're part of our Github org.

Does this work without the SNI annotation? I'm curious if this is a variant of #6425. We fixed that for routes that have protocols: http, https, but possibly not for routes that are HTTPS-only with a pseudo-route to handle the redirect.

@fffonion fffonion added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Oct 20, 2021
@stale
Copy link

stale bot commented Nov 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 3, 2021
@stale stale bot closed this as completed Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... stale
Projects
None yet
Development

No branches or pull requests

4 participants