I am looking to setup a http to https redirect at the ingress level in my kubernetes cluster. The redirect works when specifying two separate ingresses as described in Issue 2679. One using web (http) with a redirect middleware, the other using websecure (https).
Is it possible to configure the redirect using a single ingress? I thought this would be possible by specifying both entrypoints
along with the middleware, however it results in a ERR_TOO_MANY_REDIRECTS
Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: my-traefik
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
name: my-ingress
namespace: my-namespace
spec:
rules:
- host: my.domain.com
http:
paths:
- backend:
service:
name: web
port:
number: 8080
path: /
pathType: ImplementationSpecific
Middleware:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: redirect-https
namespace: default
spec:
redirectScheme:
scheme: https
port: "443"