<p>I need to scrape a Prometheus exporter running in a pod.  It runs on port 9098, the exporter is working fine and i can manually <strong>scrape</strong> it from the host it is running on.  The issue is with the ingress.  I am trying to get the ingress to allow outside scraping on port 9098 (it is http and TCP).  Here is my ingress yaml.</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/balance-algorithm: roundrobin
    ingress.kubernetes.io/maxconn-server: &quot;10&quot;
    ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
  name: ingress-ecobee-exporter
  namespace: monitoring
spec:
  rules:
  - host: mysupercool.domain.name
    http:
      paths:
      - path: /
        backend:
          serviceName: ecobee-exporter-service
          servicePort: 9098
</code></pre>
<p>I have specified port 9098 to work in the containers/ports section of my haproxy-ingress.yaml.  And i can see the &quot;load balancer&quot; in the haproxy stats page, but the hosts never listen on port 9098 to redirect the traffic.</p>
<p>Thanks,
Sean</p>

Sean Iffland
<p>HAProxy Ingress uses ingress objects to exposes http services in the <code>bind</code> configured port; doc <a href="https://haproxy-ingress.github.io/docs/configuration/keys/#bind" rel="nofollow noreferrer">here</a>. The configured <code>servicePort</code> has the port name or number of the internal service, which does not reflect in the haproxy's listening ports. TLS's sni extension is used here to choose a certificate to start the handshake if using https. The http <code>Host</code> header is used to choose an ingress' hostname. That said, you should probably connect to the exporter using <code>http://mysupercool.domain.name</code> - provided that this domains resolves to your ingress and this is the only path matching <code>/</code> in this domain.</p>

<p><code>tcp-service</code> on the other hand exposes any tcp based services, http/s included, on any arbitrary port number. There is no sni or <code>Host</code> header reading - this is a plain L4 TCP proxy. Special care should be taken here: haproxy won't complain if a port number is reused. In this case the kernel will load balance new requests between every conflicting port.</p>
