<p>I have kube cluster &amp; its control plane endpoint is haproxy. I want to use hostname of system where haproxy lies and use it as hostname in the ingress resource. Is it possible to achieve this. The request ha proxy backend config is below:</p>
<pre><code>frontend k8s_frontend
    bind *:6443
    mode tcp
    default_backend k8s_backend

backend k8s_backend
    mode tcp
    balance roundrobin
    server master1  10.50.8.117:6443
    server master2  10.50.8.118:6443
    server master3  10.50.8.119:6443

frontend http_frontend
    bind :80
    bind :443 ssl crt /com.pem
    default_backend servers

backend servers
    balance roundrobin
    server worker1 10.50.8.120:443 ssl verify none
    server worker2 10.50.8.121:443 ssl verify none
</code></pre>
<p>Below is my ingress resource:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
  annotations:
    nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot;
    nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;
spec:
  rules:
  - host: &quot;HAPROXY_HOSTNAME&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/k8s&quot;
        backend:
          service:
            name: kubernetes-dashboard
            port:
              number: 443
</code></pre>

Surya Teja
<p>Yes, you can mention the hostname of HAProxy in the ingress source. The ingress controller node can be resolved as hostname along with deploying and exposing the echo server service as shown below. Kindly refer to this <a href="https://haproxy-ingress.github.io/docs/getting-started/" rel="nofollow noreferrer">document</a>.</p>
<p>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: haproxy
name: echoserver
spec:
rules:</p>
<ul>
<li>host: $HOST
http:
paths:
<ul>
<li>backend:
serviceName: echoserver
servicePort: 8080
path: /
EOF</li>
</ul>
</li>
</ul>
<p>More details on HAProxy Ingress Controller can be found <a href="https://www.haproxy.com/fr/blog/haproxy_ingress_controller_for_kubernetes/" rel="nofollow noreferrer">here</a>.</p>
