Hello there,
I haven't found in the v2 documentation how to have http to https redirection.
I'm using IngressRoute and Services
Here is my Traefik Deployment config:
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
namespace: default
name: traefik
labels:
app: traefik
spec:
replicas: 1
selector:
matchLabels:
app: traefik
template:
metadata:
labels:
app: traefik
spec:
serviceAccountName: traefik-ingress-controller
containers:
- name: traefik
image: traefik:v2.0
args:
- --api
- --accesslog
- --entrypoints.web.Address=:80
- --entrypoints.websecure.Address=:443
- --providers.kubernetescrd
- --certificatesresolvers.default.acme.tlschallenge=true
- --certificatesresolvers.default.acme.email=email@example.com
- --certificatesresolvers.default.acme.storage=acme.json
ports:
- name: web
containerPort: 80
- name: websecure
containerPort: 443
- name: admin
containerPort: 8080
IngressRoute:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: apollo-ingressroutetls
spec:
entryPoints:
- websecure
routes:
- match: Host(`apollo.example.com`) && PathPrefix(`/`)
kind: Rule
services:
- name: apollo-nginx
port: 8000
tls:
certResolver: default
And a Service:
apiVersion: v1
kind: Service
metadata:
name: apollo-nginx
labels:
app: apollo-nginx
spec:
type: ClusterIP
ports:
- port: 8000
targetPort: 8000
name: http
selector:
app: apollo-nginx
So if someone has the answer, I'm quite interested ^^