fix redirects

This commit is contained in:
Erki Aas 2024-07-28 15:37:19 +03:00
parent 0eb2dc6503
commit 73d185b2ee
4 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,25 @@
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: auth2-redirect
spec:
redirectRegex:
regex: ^https://auth2.k-space.ee/(.*)
replacement: https://auth.k-space.ee/${1}
permanent: false
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: auth2
spec:
entryPoints:
- websecure
routes:
- match: Host(`auth2.k-space.ee`)
kind: Rule
middlewares:
- name: auth2-redirect
services:
- kind: TraefikService
name: api@internal

View File

@ -645,6 +645,7 @@ metadata:
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/managed-by: Helm
annotations:
external-dns.alpha.kubernetes.io/hostname: auth.k-space.ee,auth2.k-space.ee
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.entrypoints: websecure

View File

@ -188,10 +188,26 @@ metadata:
name: proxmox-redirect
spec:
redirectRegex:
regex: ^https://proxmox.k-space.ee/(.*)$
replacement: https://pve.k-space.ee/$1
regex: ^https://proxmox.k-space.ee/(.*)
replacement: https://pve.k-space.ee/${1}
permanent: false
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: proxmox
spec:
entryPoints:
- websecure
routes:
- match: Host(`proxmox.k-space.ee`)
kind: Rule
middlewares:
- name: proxmox-redirect
services: # Dirty workaround, service can't be empty
- kind: TraefikService
name: api@internal
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:

View File

@ -68,6 +68,7 @@ ingress:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
external-dns.alpha.kubernetes.io/hostname: auth.k-space.ee,auth2.k-space.ee
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls: