I got stuck with the problem.
I try to configure simple SSL redirect from http to https, but I get in 302 redirect loop.
what I done:
- configured KongIngress:
echo "apiVersion:configuration.konghq.com/v1
kind: KongIngress
metadata:
name: https-only
route:
protocols:
- https
https_redirect_status_code: 302
" | kubectl apply -f -
- attached it to Ingress:
kind: Ingress
metadata:
annotations:
:konghq.com/override: https-only
:kubernetes.io/ingress.class: kong
:kubernetes.io/tls-acme: ‘true’
got 302 redirect loop…
if I do the same with Nginx Ingress everything works fine:
kind: Ingress
metadata:
annotations:
:kubernetes.io/ingress.class: nginx
:kubernetes.io/tls-acme: ‘true’
:nginx.ingress.kubernetes.io/ssl-redirect: ‘true’
I suppose nginx.ingress.kubernetes.io/ssl-redirect: ‘true’ works not in the same way as https_redirect_status_code.
I use cert-manger for auto SSL generating and I have CloudFlare in front of k8s cluster, but as I wrote earlier there is no such problem with nginx ingress controller.
What can be a problem here? any workarounds?
kong:2.1
kong-ingress-controller:0.9.1
thanks in advance for any tips.