<p>Using Calico as CNI and CRI-O. DNS settings properly configured. Installed NGINX ingress controller via official documentation page of NGINX using helm. Set <code>replicaset</code> to 2 when installing.</p>
<p>After that used this file for creating 3 objects: <code>Deployment</code>, <code>Service</code> for exposing web server and <code>Ingress</code>.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  name: test-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-service-pod
  template:
    metadata:
      labels:
        app: nginx-service-pod
    spec:
      containers:
      - image: nginx 
        name: test-nginx
---
apiVersion: v1
kind: Service
metadata:
   name: nginx-service
spec:
   type: ClusterIP
   selector:
      app: nginx-service-pod
   ports:
      - port: 80
        targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: k8s.example.com
    http:
      paths:
      - path: /test
        pathType: Prefix
        backend:
          service:
            name: nginx-service
            port:
              number: 80
...

</code></pre>
<p>Tried to test deployment service by curling it and it is working correct:</p>
<pre><code># curl http://10.103.88.163
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Welcome to nginx!&lt;/title&gt;
&lt;style&gt;
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
&lt;p&gt;If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.&lt;/p&gt;

&lt;p&gt;For online documentation and support please refer to
&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;
Commercial support is available at
&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

</code></pre>
<p>But when I'm trying to curl Ingress getting error:</p>
<pre><code># curl http://k8s.example.com/test
curl: (7) Failed to connect to k8s.example.com port 80: Connection refused

</code></pre>
<p>Why this is happening? Because as I see there is no misconfig in the objects configuration.</p>

<p>This problem should be resolved by adding</p>
<pre><code>spec: 
  template:
    spec:
      hostNetwork: true
</code></pre>
<p>to the ingress controller yaml manifest. For more please check <a href="https://github.com/kubernetes/ingress-nginx/issues/4799" rel="nofollow noreferrer">this github issue</a> and <a href="https://github.com/kubernetes/ingress-nginx/issues/4799#issuecomment-560406420" rel="nofollow noreferrer">this answer</a>.</p>
