Getting All hosts are taken by other resources with Nginx Ingress Controller
09:55 02 Jan 2021

I have setup Nginx Controller as mentioned in the docs https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/. I have setup the Ingress with the below configuration

IngressClass

apiVersion: networking.k8s.io/v1beta1
kind: IngressClass
metadata:
  name: nginx
  # annotations:
  #   ingressclass.kubernetes.io/is-default-class: "true"
spec:
  controller: nginx.org/ingress-controller

Ingress

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: hn-service-ingress
spec:
  ingressClassName: nginx
  rules:
  - host: hostnameservice.classpath.com
    http:
      paths:
      - path: /test
        backend:
          serviceName: hostname-service
          servicePort: 80

Below is the error when running the describe command. I am getting All hosts are taken by other resources

kubectl describe ingress hn-service-ingress
Name:             hn-service-ingress
Namespace:        pradeep
Address:
Default backend:  default-http-backend:80 ()
Rules:
  Host                           Path  Backends
  ----                           ----  --------
  hostnameservice.classpath.com
                                 /test    hostname-service:80 (100.96.1.12:8111,100.96.1.13:8111,100.96.2.13:8111)
Annotations:                     
Events:
  Type     Reason    Age   From                      Message
  ----     ------    ----  ----                      -------
  Warning  Rejected  5s    nginx-ingress-controller  All hosts are taken by other resources

When I used to check with the cafe example, it is working fine. Where am I going wrong?

Note: I have configured the AWS load balancer and set the /etc/hosts to point to the ELB from AWS using the dnslookup.

kubernetes-ingress nginx-ingress