diff --git a/production-resources.yaml b/production-resources.yaml index c297d72..ea5b7d1 100644 --- a/production-resources.yaml +++ b/production-resources.yaml @@ -11,3 +11,48 @@ spec: issuerRef: name: $APP_CERT_ISSUER kind: ClusterIssuer + +--- +# Redirect with domain replacement +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-volailles-ramon-to-volena +spec: + redirectRegex: + regex: ^https://(.*)(volailles-ramon)(.*) + replacement: https://${REDIRECT}${APP_DOMAIN} + permanent: true +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: redirect-volailles-ramon-to-volena +spec: + entryPoints: + - websecure + routes: + - match: Host(`volailles-ramon.fr`) || Host(`www.volailles-ramon.fr`) || Host(`volailles-ramon.com`) || Host(`www.volailles-ramon.com`) + kind: Rule + services: + - name: api@internal + kind: TraefikService + middlewares: + - name: redirect-volailles-ramon-to-volena + tls: + secretName: redirect-volailles-ramon-to-volena +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: redirect-volailles-ramon-to-volena +spec: + dnsNames: + - volailles-ramon.fr + - www.volailles-ramon.fr + - volailles-ramon.com + - www.volailles-ramon.com + secretName: redirect-volailles-ramon-to-volena + issuerRef: + name: $APP_CERT_ISSUER + kind: ClusterIssuer