<p>I have configured 2 nodes Kubernetes cluster in AWS using EC2 (Not using EKS). I have configured an Ingress controller using Traefik version 1.7. I have tried setting up rules in the ingress controller using the host. But when I do describe on the Ingress, my host is set to wildcard always.</p>

<p>Below is the Ingress YAML</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-test
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: www.random.com
  - http:
      paths:
      - backend:
          serviceName: secondapp
          servicePort: 80
        path: /
</code></pre>

<p>Here www.random.com is a junk hostname.</p>

<p>Below is the describe command out</p>

<pre><code>Name:             ingress-test
Namespace:        default
Address:
Default backend:  default-http-backend:80 (&lt;none&gt;)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *
        /   secondapp:80 (192.168.1.132:80)
Annotations:
  kubernetes.io/ingress.class:  traefik
</code></pre>

<p>I am able to hit the webpage for this app from the EC2's external IP, but the Ingress controller is not doing any filtering based on the host. So hitting this page using curl by specifying the host in the header has no effect, ie: <code>curl -H "Host: www.random.com" http://&lt;external_ip&gt;</code>. Also, I am not able to access the Traefik GUI from the external IP. I am guessing this is because of the wildcarded host, as Ingress controller routes request bases on the hostnames. I searched through the network but could find anything around this. Would appreciate any help.</p>

rj99999
<p>Your ingress seems to be formatted incorrectly: you have an array under <code>rules</code>; however, your <code>host</code> needs to be part of the same object as your <code>http:</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-test
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: www.random.com
    # Note I removed the dash before http
    http:
      paths:
      - backend:
          serviceName: secondapp
          servicePort: 80
        path: /
</code></pre>

<p>This is untested but should resolve the problem</p>
