apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: victoriametrics
  annotations:
    cert-manager.io/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/prefix_rewrite: "/m/"
spec:
  ingressClassName: pomerium
  rules:
    - host: "bigasterisk.com"
      http:
        paths:
          - pathType: Prefix
            path: /m/
            backend: { service: { name: victoriametrics, port: { number: 80 } } }
  tls:
    - hosts: [bigasterisk.com]
      secretName: bigasterisk.com-tls
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: vmalert
  annotations:
    cert-manager.io/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/prefix_rewrite: "/vmalert/"
spec:
  ingressClassName: pomerium
  rules:
    - host: "bigasterisk.com"
      http:
        paths:
          - pathType: Prefix
            path: /vmalert/
            backend: { service: { name: vmalert, port: { number: 80 } } }
  tls:
    - hosts: [bigasterisk.com]
      secretName: bigasterisk.com-tls
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: alertmanager
  annotations:
    cert-manager.io/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/prefix_rewrite: "/"
spec:
  ingressClassName: pomerium
  rules:
    - host: "bigasterisk.com"
      http:
        paths:
          - pathType: Prefix
            path: /alertmanager/
            backend: { service: { name: alertmanager, port: { number: 80 } } }
  tls:
    - hosts: [bigasterisk.com]
      secretName: bigasterisk.com-tls