apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-rpc
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/preserve-trailing-slash: "true"
    #nginx.ingress.kubernetes.io/rewrite-target: /eth
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-origin: "*"
    nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS"
spec:
  tls:
  - hosts:
    - "rpc.{{ .Values.domain }}"
  rules:
  - host: "rpc.{{ .Values.domain }}"
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            # TODO: change to dshackle once https://github.com/emeraldpay/dshackle/issues/132 is solved
            name: geth-lighthouse-0
            port:
              number: 8545
