I am running traefik v2.2 in a self managed kubernetes cluster 1.17.3
I am trying the new kubernetesingress provider in Traefik 2.2. I followed the documentation page for v2.2 Latest here.
This works for HTTP fine. But if I try to configure a middleware for http/https redirection like announced in this blog post: https://containo.us/blog/traefik-2-2-ingress/
traefik complains that the ingress middleware can not be found. Log Messages:
2020-04-04T20:07:57.720776497Z time="2020-04-04T20:07:57Z" level=error msg="Cannot create service: subset not found" namespace=default serviceName=whoami servicePort=80 providerName=kubernetes ingress=myingress
2020-04-04T20:07:57.882206863Z time="2020-04-04T20:07:57Z" level=warning msg="Ingress default/myingress: the apiVersion 'extensions/v1beta1' is deprecated, use 'networking.k8s.io/v1beta1' instead."
2020-04-04T20:07:57.882260265Z time="2020-04-04T20:07:57Z" level=error msg="middleware \"redirect-http@kubernetesingress\" does not exist" entryPointName=web routerName=myingress-default-mydomain-foo-com-bar@kubernetes
2020-04-04T20:07:57.882269368Ztime="2020-04-04T20:07:57Z" level=error msg="middleware \"redirect-http@kubernetesingress\" does not exist" entryPointName=websecure routerName=myingress
my ingress config looks like this:
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
name: myingress
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
traefik.ingress.kubernetes.io/router.middlewares: redirect-http@kuberntes-crd
spec:
rules:
- host: mydomain.foo.com
http:
paths:
- path: /bar
backend:
serviceName: whoami
servicePort: 80
If I only use the "web" entry point it works for http.
I tried already to define the middleware with:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: redirect-http
spec:
redirectScheme:
scheme: https
But this did also not work. I am running kubernetes version 1.17. It is not clear to me if this feature should already work or if there is something missing.
Please let me know if I can provide any more useful information about this issue.
Thanks for any help.