apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/auth-secret: prometheus-remote-write-auth
    nginx.ingress.kubernetes.io/auth-type: basic
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  name: prometheus-remote-write
  namespace: monitoring
spec:
  rules:
  - host: push.ankhmorpork.thaum.xyz
    http:
      paths:
      - backend:
          service:
            name: prometheus-k8s-write-0
            port:
              name: web
        path: /primary(/|$)(.*)
        pathType: Prefix
      - backend:
          service:
            name: prometheus-k8s-write-1
            port:
              name: web
        path: /secondary(/|$)(.*)
        pathType: Prefix
  tls:
  - hosts:
    - push.ankhmorpork.thaum.xyz
    secretName: prometheus-remote-write-tls
