From 73d185b2eeada70f5cca99a425922ec1abd3c2b6 Mon Sep 17 00:00:00 2001 From: Erki Aas Date: Sun, 28 Jul 2024 15:37:19 +0300 Subject: [PATCH] fix redirects --- passmower/application-extras.yaml | 25 +++++++++++++++++++++++++ passmower/application.yaml | 1 + passmower/proxmox.yaml | 20 ++++++++++++++++++-- passmower/values.yaml | 1 + 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 passmower/application-extras.yaml diff --git a/passmower/application-extras.yaml b/passmower/application-extras.yaml new file mode 100644 index 0000000..ceba4b4 --- /dev/null +++ b/passmower/application-extras.yaml @@ -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 \ No newline at end of file diff --git a/passmower/application.yaml b/passmower/application.yaml index ede670a..444b7a0 100644 --- a/passmower/application.yaml +++ b/passmower/application.yaml @@ -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 diff --git a/passmower/proxmox.yaml b/passmower/proxmox.yaml index 29ed867..cc681da 100644 --- a/passmower/proxmox.yaml +++ b/passmower/proxmox.yaml @@ -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: diff --git a/passmower/values.yaml b/passmower/values.yaml index 7942166..2435e42 100644 --- a/passmower/values.yaml +++ b/passmower/values.yaml @@ -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: