To enable redirection, you need to deploy a middleware with redirectScheme.
Since this can be referenced from other namespaces, you will create it in the default
namespace for ease of sharing.
cat <<EOF > middleware.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: http-redirect
spec:
redirectScheme:
scheme: https
permanent: true
EOF
kubectl -n default apply -f middleware.yaml
kubectl -n default get middleware
To enable redirection, the Ingress resource must have the following annotation.
annotations:
traefik.ingress.kubernetes.io/router.middlewares: default-http-redirect@kubernetescrd