apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: video-ingest
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    ingress.pomerium.io/allow_public_unauthenticated_access: "false"
    ingress.pomerium.io/pass_identity_headers: "true"
    ingress.pomerium.io/preserve_host_header: "true"
    ingress.pomerium.io/policy: |
      allow:
        or: 
    ingress.pomerium.io/allow_websockets: "true"
spec:
  ingressClassName: pomerium
  rules:
    - host: "bigasterisk.com"
      http:
        paths:
          - { pathType: Prefix, path: /video/ingest/,     backend: { service: { name: video,       port: { name: vite } } } }
          - { pathType: Prefix, path: /video/api/ingest/, backend: { service: { name: video-files, port: { name: api } } } }
  tls:
    - hosts: [bigasterisk.com]
      secretName: bigasterisk.com-tls
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: video
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    ingress.pomerium.io/allow_public_unauthenticated_access: "false"
    ingress.pomerium.io/pass_identity_headers: "true"
    ingress.pomerium.io/preserve_host_header: "true"
    ingress.pomerium.io/policy: |
      allow:
        or: 
          - { email: { is: "drewpca@gmail.com" }}
          - { email: { is: "kelsimp@gmail.com" }}
    ingress.pomerium.io/allow_websockets: "true"
spec:
  ingressClassName: pomerium
  rules:
    - host: "bigasterisk.com"
      http:
        paths:
          - { pathType: Prefix, path: /video/files/, backend: { service: { name: video-files, port: { name: files } } } }
          - { pathType: Prefix, path: /video/api/, backend: { service: { name: video-files, port: { name: api } } } }
          - { pathType: Prefix, path: /video/, backend: { service: { name: video, port: { name: vite } } } }
  tls:
    - hosts: [bigasterisk.com]
      secretName: bigasterisk.com-tls
