diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index be9b922..767fa5b 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -5,13 +5,29 @@ metadata: namespace: manoonoils spec: entryPoints: - - web - - websecure + - web routes: - - match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) - kind: Rule - services: - - name: storefront - port: 3000 + - kind: Rule + match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) + middlewares: + - name: redirect-https + services: + - name: storefront + port: 3000 +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: storefront-secure + namespace: manoonoils +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`manoonoils.com`) || Host(`www.manoonoils.com`) + services: + - name: storefront + port: 3000 tls: certResolver: letsencrypt diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 1a44fe8..54dedf0 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -3,6 +3,7 @@ kind: Kustomization resources: - deployment.yaml - service.yaml + - middleware.yaml - ingress.yaml images: - name: ghcr.io/unchainedio/manoon-headless diff --git a/k8s/middleware.yaml b/k8s/middleware.yaml new file mode 100644 index 0000000..e71432c --- /dev/null +++ b/k8s/middleware.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-https + namespace: manoonoils +spec: + redirectScheme: + scheme: https + permanent: true