# vexplor Ingress - Nginx Ingress Controller 기반
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: vexplor-ingress
  namespace: vexplor
  labels:
    app: vexplor
  annotations:
    # Nginx Ingress Controller 설정
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: "100m"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
    
    # WebSocket 지원
    nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
    nginx.ingress.kubernetes.io/upstream-hash-by: "$remote_addr"
    
    # SSL Redirect
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    
    # Cert-Manager (Let's Encrypt)
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - v1.vexplor.com
        - api.vexplor.com
      secretName: vexplor-tls
  rules:
    # Frontend 도메인
    - host: v1.vexplor.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: vexplor-frontend-service
                port:
                  number: 3000
    
    # Backend API 도메인
    - host: api.vexplor.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: vexplor-backend-service
                port:
                  number: 3001

