---
# ============================================================================
# Ingress for nerdycupid.ai (with TLS)
# ============================================================================
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nerdycupid-ai-ingress
  namespace: undateable
  labels:
    app.kubernetes.io/name: nerdycupid
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "50m"
    nginx.ingress.kubernetes.io/hsts: "true"
    nginx.ingress.kubernetes.io/hsts-max-age: "31536000"
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - nerdycupid.ai
        - www.nerdycupid.ai
      secretName: nerdycupid-ai-tls-secret
  rules:
    - host: nerdycupid.ai
      http:
        paths:
          - path: /api/auth
            pathType: Prefix
            backend:
              service:
                name: auth-service
                port:
                  number: 8001
          - path: /api/profiles
            pathType: Prefix
            backend:
              service:
                name: profiles-service
                port:
                  number: 8002
          - path: /api/messages
            pathType: Prefix
            backend:
              service:
                name: messaging-service
                port:
                  number: 8003
          - path: /ws
            pathType: Prefix
            backend:
              service:
                name: websocket-service
                port:
                  number: 8005
          - path: /
            pathType: Prefix
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
    - host: www.nerdycupid.ai
      http:
        paths:
          - path: /api/auth
            pathType: Prefix
            backend:
              service:
                name: auth-service
                port:
                  number: 8001
          - path: /api/profiles
            pathType: Prefix
            backend:
              service:
                name: profiles-service
                port:
                  number: 8002
          - path: /api/messages
            pathType: Prefix
            backend:
              service:
                name: messaging-service
                port:
                  number: 8003
          - path: /ws
            pathType: Prefix
            backend:
              service:
                name: websocket-service
                port:
                  number: 8005
          - path: /
            pathType: Prefix
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
---
# ============================================================================
# Ingress for nerdycupid.io (with TLS)
# ============================================================================
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nerdycupid-io-ingress
  namespace: undateable
  labels:
    app.kubernetes.io/name: nerdycupid
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "50m"
    nginx.ingress.kubernetes.io/hsts: "true"
    nginx.ingress.kubernetes.io/hsts-max-age: "31536000"
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - nerdycupid.io
        - www.nerdycupid.io
      secretName: nerdycupid-io-tls-secret
  rules:
    - host: nerdycupid.io
      http:
        paths:
          - path: /api/auth
            pathType: Prefix
            backend:
              service:
                name: auth-service
                port:
                  number: 8001
          - path: /api/profiles
            pathType: Prefix
            backend:
              service:
                name: profiles-service
                port:
                  number: 8002
          - path: /api/messages
            pathType: Prefix
            backend:
              service:
                name: messaging-service
                port:
                  number: 8003
          - path: /ws
            pathType: Prefix
            backend:
              service:
                name: websocket-service
                port:
                  number: 8005
          - path: /
            pathType: Prefix
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
    - host: www.nerdycupid.io
      http:
        paths:
          - path: /api/auth
            pathType: Prefix
            backend:
              service:
                name: auth-service
                port:
                  number: 8001
          - path: /api/profiles
            pathType: Prefix
            backend:
              service:
                name: profiles-service
                port:
                  number: 8002
          - path: /api/messages
            pathType: Prefix
            backend:
              service:
                name: messaging-service
                port:
                  number: 8003
          - path: /ws
            pathType: Prefix
            backend:
              service:
                name: websocket-service
                port:
                  number: 8005
          - path: /
            pathType: Prefix
            backend:
              service:
                name: frontend-service
                port:
                  number: 80
---
# ============================================================================
# Certificates for nerdycupid domains
# ============================================================================
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: nerdycupid-ai-tls
  namespace: undateable
spec:
  secretName: nerdycupid-ai-tls-secret
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  commonName: nerdycupid.ai
  dnsNames:
    - nerdycupid.ai
    - www.nerdycupid.ai
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: nerdycupid-io-tls
  namespace: undateable
spec:
  secretName: nerdycupid-io-tls-secret
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  commonName: nerdycupid.io
  dnsNames:
    - nerdycupid.io
    - www.nerdycupid.io
