---
# HTTPS IngressRoute for TowerOps
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: towerops-https
  namespace: towerops
spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`towerops.net`)
      kind: Rule
      services:
        - name: towerops
          port: 4000
  tls:
    secretName: towerops-net-tls
---
# HTTP to HTTPS redirect
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: towerops-http
  namespace: towerops
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`towerops.net`)
      kind: Rule
      services:
        - name: towerops
          port: 4000
      middlewares:
        - name: redirect-https
          namespace: towerops
---
# Middleware for HTTPS redirect
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: redirect-https
  namespace: towerops
spec:
  redirectScheme:
    scheme: https
    permanent: true
