# Public Ingress - Share URLs and required resources (no auth required)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: umami-share
  namespace: umami
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: traefik
  tls:
  - hosts:
    - umami0213.kro.kr
    secretName: umami-tls
  rules:
    - host: umami0213.kro.kr
      http:
        paths:
          # Share page
          - path: /share
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Share API
          - path: /api/share
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Websites API (used by share page)
          - path: /api/websites
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Next.js static files
          - path: /_next
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Internationalization (language files)
          - path: /intl
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Tracking script (also public)
          - path: /script.js
            pathType: Exact
            backend:
              service:
                name: umami
                port:
                  number: 3000
          # Tracking API (required for script.js to send data)
          - path: /api/send
            pathType: Exact
            backend:
              service:
                name: umami
                port:
                  number: 3000
---
# Protected Ingress - Dashboard (Authelia SSO required)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: umami-ingress
  namespace: umami
  annotations:
    traefik.ingress.kubernetes.io/router.middlewares: authelia-authelia-auth@kubernetescrd
spec:
  ingressClassName: traefik
  tls:
  - hosts:
    - umami0213.kro.kr
    - www.umami0213.kro.kr
    secretName: umami-tls
  rules:
    - host: umami0213.kro.kr
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
    - host: www.umami0213.kro.kr
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: umami
                port:
                  number: 3000
