<p>i try to deploy <code>nginx-ingress-controller</code> on bare metal , I have</p>
<p><strong>4 Node</strong></p>
<ol>
<li>10.0.76.201 - Node 1</li>
<li>10.0.76.202 - Node 2</li>
<li>10.0.76.203 - Node 3</li>
<li>10.0.76.204 - Node 4</li>
</ol>
<p><strong>4 Worker</strong></p>
<ol start="5">
<li>10.0.76.205 - Worker 1</li>
<li>10.0.76.206 - Worker 2</li>
<li>10.0.76.207 - Worker 3</li>
<li>10.0.76.214 - Worker 4</li>
</ol>
<p><strong>2 LB</strong></p>
<ol start="9">
<li><p>10.0.76.208 - LB 1</p>
</li>
<li><p>10.0.76.209 - Virtual IP (keepalave)</p>
</li>
<li><p>10.0.76.210 - LB 10</p>
</li>
</ol>
<p>Everything is on <code>BareMetal</code> , Load balancer located outside Cluster .</p>
<p><strong>This is simple haproxy config , just check 80 port ( Worker ip )</strong></p>
<pre><code>frontend kubernetes-frontends
  bind *:80
  mode tcp
  option tcplog
  default_backend kube



backend kube
        mode http
        balance roundrobin
        cookie lsn insert indirect nocache
        option http-server-close
        option forwardfor
        server node-1 10.0.76.205:80 maxconn 1000 check
        server node-2 10.0.76.206:80 maxconn 1000 check
        server node-3 10.0.76.207:80 maxconn 1000 check
        server node-4 10.0.76.214:80 maxconn 1000 check
</code></pre>
<p>I Install nginx-ingress-controller using Helm and everything work fine</p>
<pre><code>NAME                                            READY   STATUS      RESTARTS   AGE
pod/ingress-nginx-admission-create-xb5rw        0/1     Completed   0          18m
pod/ingress-nginx-admission-patch-skt7t         0/1     Completed   2          18m
pod/ingress-nginx-controller-6dc865cd86-htrhs   1/1     Running     0          18m

NAME                                         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/ingress-nginx-controller             NodePort    10.106.233.186   &lt;none&gt;        80:30659/TCP,443:32160/TCP   18m
service/ingress-nginx-controller-admission   ClusterIP   10.102.132.131   &lt;none&gt;        443/TCP                      18m

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ingress-nginx-controller   1/1     1            1           18m

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/ingress-nginx-controller-6dc865cd86   1         1         1       18m

NAME                                       COMPLETIONS   DURATION   AGE
job.batch/ingress-nginx-admission-create   1/1           24s        18m
job.batch/ingress-nginx-admission-patch    1/1           34s        18m
</code></pre>
<p><strong>Deploy nginx simple way and works fine</strong></p>
<pre><code>kubectl create deploy nginx --image=nginx:1.18
kubectl scale deploy/nginx --replicas=6
kubectl expose deploy/nginx --type=NodePort --port=80
</code></pre>
<p>after , i decided to create <code>ingress.yaml</code></p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tektutor-ingress 
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: &quot;tektutor.training.org&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/nginx&quot;
        backend:
          service:
            name: nginx 
            port:
              number: 80
</code></pre>
<p>works fine</p>
<pre><code>kubectl describe ingress tektutor-ingress

Name:             tektutor-ingress
Labels:           &lt;none&gt;
Namespace:        default
Address:          10.0.76.214
Ingress Class:    &lt;none&gt;
Default backend:  &lt;default&gt;
Rules:
  Host                   Path  Backends
  ----                   ----  --------
  tektutor.training.org
                         /nginx   nginx:80 (192.168.133.241:80,192.168.226.104:80,192.168.226.105:80 + 3 more...)
Annotations:             kubernetes.io/ingress.class: nginx
                         nginx.ingress.kubernetes.io/rewrite-target: /
Events:
  Type    Reason          Age                From                      Message
  ----    ------          ----               ----                      -------
  Normal  AddedOrUpdated  18m                nginx-ingress-controller  Configuration for default/tektutor-ingress was added or updated
  Normal  Sync            18m (x2 over 18m)  nginx-ingress-controller  Scheduled for sync
</code></pre>
<p>everything work fine , when i try curl any ip works <code>curl (192.168.133.241:80,192.168.226.104:80,192.168.226.105:80 + 3 more...)</code></p>
<p>now i try to add hosts</p>
<pre><code>10.0.76.201 tektutor.training.org
</code></pre>
<p>This is my master ip , is it correct to add here master ip ? when i try  <code>curl tektutor.training.org</code> not working</p>
<p>Can you please explain what I am having problem with this last step?
I set the IP wrong? or what ? Thanks !</p>
<p>I hope I have written everything exhaustively</p>
<p>I used to this tutor <a href="https://medium.com/tektutor/using-nginx-ingress-controller-in-kubernetes-bare-metal-setup-890eb4e7772" rel="nofollow noreferrer">Medium Install nginx Ingress Controller </a></p>

CaptainPy
<p><strong>TL;DR</strong></p>
<p>Put in your haproxy backend config values shown below instead of the ones you've provided:</p>
<ul>
<li><code>30659</code> instead of <code>80</code></li>
<li><code>32160</code> instead of <code>443</code> (if needed)</li>
</ul>
<hr />
<p>More explanation:</p>
<p><code>NodePort</code> works on certain set of ports (default: <code>30000</code>-<code>32767</code>) and in this scenario it allocated:</p>
<ul>
<li><code>30659</code> for your ingress-nginx-controller port <code>80</code>.</li>
<li><code>32160</code> for your ingress-nginx-controller port <code>443</code>.</li>
</ul>
<p>This means that every request trying to hit your cluster from <strong>outside</strong> will need to contact this ports (30...).</p>
<p>You can read more about it by following official documentation:</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Kubernetes.io: Docs: Concepts: Services</a></li>
</ul>
