ip/kustomize/ingressroute.yml

51 lines
1.0 KiB
YAML
Raw Permalink Normal View History

2021-08-06 21:44:19 -04:00
---
# TODO: Named port for service
# but currently unsupported on my k3s cluster https://github.com/traefik/traefik/pull/7668
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: "ip-websecure"
spec:
entryPoints:
- "websecure"
routes:
- kind: Rule
match: Host(`ip.opti.cabillot.eu`)
middlewares: []
priority: 10
services:
- kind: Service
name: "ip"
port: 80
tls:
secretName: "ipcabilloteu-tls"
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: "ip-web"
spec:
entryPoints:
- "web"
routes:
- match: Host(`ip.opti.cabillot.eu`)
kind: Rule
priority: 10
services:
# in this IngressRoute the service will be never called
# because of the redirect middleware BUT DO NOT REMOVE !
- kind: Service
name: "ip"
port: 80
middlewares:
- name: "httpsredirect"
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: "httpsredirect"
spec:
redirectScheme:
scheme: https
permanent: true