apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: node-grpc-NETWORKNAME
  namespace: NETWORKNAME
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "GRPCS"
    cert-manager.io/cluster-issuer: letsencrypt-production

    ### HAProxy Ingress
    haproxy.org/server-proto: "h2"              # Force GRPC/H2 mode
    haproxy.org/server-ssl: "true"             # The backend (server) is http
    haproxy.org/abortonclose: "true"
    haproxy.org/backend-config-snippet: |-
      http-reuse aggressive

spec:
  tls:
    - hosts:
      - NETWORKNAME.mobilecoin.com
      - '*.NETWORKNAME.mobilecoin.com'
      secretName: NETWORKNAME-mobilecoin-wildcard-tls
  rules:
  - host: node1.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 3223
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 3223
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 3223
      - path: /consensus_client.ConsensusClientAPI
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 3223
  - host: peer1.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 8443
      - path: /build_info
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 8443
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 8443
      - path: /consensus_peer.ConsensusPeerAPI
        pathType: Prefix
        backend:
          service:
            name: node1
            port:
              number: 8443
  - host: node2.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 3223
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 3223
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 3223
      - path: /consensus_client.ConsensusClientAPI
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 3223
  - host: peer2.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 8443
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 8443
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 8443
      - path: /consensus_peer.ConsensusPeerAPI
        pathType: Prefix
        backend:
          service:
            name: node2
            port:
              number: 8443
  - host: node3.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 3223
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 3223
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 3223
      - path: /consensus_client.ConsensusClientAPI
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 3223
  - host: peer3.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 8443
      - path: /build_info
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 8443
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 8443
      - path: /consensus_peer.ConsensusPeerAPI
        pathType: Prefix
        backend:
          service:
            name: node3
            port:
              number: 8443
  - host: node4.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 3223
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 3223
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 3223
      - path: /consensus_client.ConsensusClientAPI
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 3223
  - host: peer4.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 8443
      - path: /build_info
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 8443
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 8443
      - path: /consensus_peer.ConsensusPeerAPI
        pathType: Prefix
        backend:
          service:
            name: node4
            port:
              number: 8443
  - host: node5.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 3223
      - path: /build_info.BuildInfoApi
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 3223
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 3223
      - path: /consensus_client.ConsensusClientAPI
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 3223
  - host: peer5.NETWORKNAME.mobilecoin.com
    http:
      paths:
      - path: /attest.AttestedApi
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 8443
      - path: /build_info
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 8443
      - path: /consensus_common.BlockchainAPI
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 8443
      - path: /consensus_peer.ConsensusPeerAPI
        pathType: Prefix
        backend:
          service:
            name: node5
            port:
              number: 8443
