<p>I'm using <code>Kubernetes version: 1.19.16</code> on bare metal <code>Ubuntu-18.04lts</code> server. When i tried to deploy the <code>nginx-ingress</code> yaml file it always fails with below errors.</p>
<p>Following steps followed to deploy nginx-ingress,</p>
<pre><code>$ git clone https://github.com/nginxinc/kubernetes-ingress.git
cd kubernetes-ingress/deployments

kubernetes-ingress/deployments$ git branch
* main

$ kubectl apply -f common/ns-and-sa.yaml
$ kubectl apply -f rbac/rbac.yaml
$ kubectl apply -f rbac/ap-rbac.yaml
$ kubectl apply -f common/default-server-secret.yaml
$ kubectl apply -f common/nginx-config.yaml

$ kubectl apply -f deployment/nginx-ingress.yaml
deployment.apps/nginx-ingress created
</code></pre>
<pre><code>$ kubectl get pods -n nginx-ingress -o wide
NAME                             READY   STATUS   RESTARTS   AGE   IP           NODE          NOMINATED NODE   READINESS GATES
nginx-ingress-75c4bd64bd-mm52x   0/1     Error    2          21s   10.244.1.5   k8s-master    &lt;none&gt;           &lt;none&gt;
</code></pre>
<pre><code>$ kubectl -n nginx-ingress get all
NAME                                 READY   STATUS             RESTARTS   AGE
pod/nginx-ingress-75c4bd64bd-mm52x   0/1     CrashLoopBackOff   12         38m

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

NAME                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-ingress-75c4bd64bd   1         1         0       38m
</code></pre>
<pre><code>$ kubectl logs nginx-ingress-75c4bd64bd-mm52x -n nginx-ingress   
W1003 04:53:02.833073       1 flags.go:273] Ignoring unhandled arguments: []
I1003 04:53:02.833154       1 flags.go:190] Starting NGINX Ingress Controller Version=2.3.1 PlusFlag=false
I1003 04:53:02.833158       1 flags.go:191] Commit=a8742472b9ddf27433b6b1de49d250aa9a7cb47e Date=2022-09-16T08:09:31Z DirtyState=false Arch=linux/amd64 Go=go1.18.5
I1003 04:53:02.844374       1 main.go:210] Kubernetes version: 1.19.16
F1003 04:53:02.846604       1 main.go:225] Error when getting IngressClass nginx: ingressclasses.networking.k8s.io &quot;nginx&quot; not found
</code></pre>
<pre><code>$ kubectl describe pods nginx-ingress-75c4bd64bd-mm52x -n nginx-ingress

Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  3m6s                 default-scheduler  Successfully assigned nginx-ingress/nginx-ingress-75c4bd64bd-mm52x to k8s-worker-1
  Normal   Pulled     87s (x5 over 3m5s)   kubelet            Container image &quot;nginx/nginx-ingress:2.3.1&quot; already present on machine
  Normal   Created    87s (x5 over 3m5s)   kubelet            Created container nginx-ingress
  Normal   Started    87s (x5 over 3m5s)   kubelet            Started container nginx-ingress
  Warning  BackOff    75s (x10 over 3m3s)  kubelet            Back-off restarting failed container
</code></pre>
<p>Nginx Ingress controller Deployment file <a href="https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/main/deployments/deployment/nginx-ingress.yaml" rel="nofollow noreferrer">Link</a> for the reference.</p>
<p>As I'm using <code>kubernetes-ingress.git</code> repository main branch, not sure whether main branch is compatible with my Kubernetes version or not.</p>
<p>Can anyone share some pointer to solve this?</p>

<p>I think you missed to install ingress-controller &quot;NGINX&quot; that is why it is not able to identify the same <a href="https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/common/ingress-class.yaml#L4" rel="nofollow noreferrer">https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/common/ingress-class.yaml#L4</a></p>
<pre><code>kubectl apply -f common/ingress-class.yaml 
</code></pre>
<p>You can follow thie steps from this document: <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/</a></p>
