-
Couldn't load subscription status.
- Fork 23
Description
When using Traefik and the FunctionIngress object, we will get an Ingress record created, however I am not sure we will get functioning TLS with cert-manager. We do get that with Nginx presently, so this issue should be partly figuring out which additional annotations are needed and applying them.
Expected Behaviour
Add cert-manager should be supported with Traefik
Current Behaviour
Untested, it may be but I suspect it is not due to the additional annotations I found in a (French) blog post.
Currently only the annotations for cert-manager are added: https://github.com/openfaas-incubator/ingress-operator/blob/master/pkg/controller/controller.go#L538
Possible Solution
Edit the following code: https://github.com/openfaas-incubator/ingress-operator/blob/master/pkg/controller/controller.go#L514
Add these annotations:
traefik.ingress.kubernetes.io/redirect-entry-point: https
traefik.ingress.kubernetes.io/redirect-permanent: "true"
ingress.kubernetes.io/ssl-redirect: "true"
ingress.kubernetes.io/ssl-temporary-redirect: "false"
As see here: https://www.cerenit.fr/blog/kubernetes-ovh-traefik-cert-manager-secrets/
You can rebuild the controller with make and specify a TAG env-var, then tag this as your own username before pushing it. You can also run the cluster as a local Go binary.
How to test
K3s ships with Traefik running in "host mode", so this would be a very fast way of testing the fix. A VM on DO or a similar cloud will come with a public IP for the DNS certificate challenge.
You'll also need your own domain name.
- Get a cloud VM with Ubuntu 18.x - i.e. Civo or DigitalOcean
- Install k3s via https://k3s.io
- Install OpenFaaS & the IngressOperator -> https://docs.openfaas.com/reference/ssl/kubernetes-with-cert-manager/#deploy-the-ingressoperator
- Create a FunctionIngress with the Ingress type of
traefik - Create a DNS A record for your domain and the IP of the node
- See if you get a valid TLS cert
Context
This is an important piece of the puzzle for Traefik users.