<p>I am implementing an ingress controller with AWS and following <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller/blob/master/docs/walkthrough.md" rel="nofollow noreferrer">this</a> tutorial. </p>

<p>When creating an ingress as shown <a href="https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/master/examples/echoservice/echoserver-ingress.yaml" rel="nofollow noreferrer">here</a>, a  host name should be given.   </p>

<pre><code>spec:
  rules:
  - host: echoserver.example.com #How to let kubernate assign ALB's DNS name and not give our own DNS name.
    http:
      paths:
      - path: /
        backend:
          serviceName: echoserver
          servicePort: 80
</code></pre>

<p>But I want to give the ALB's generated DNS name as I don't have my own DNS name. Is there any way to do it ? I tried ommiting the <strong>host</strong> attribute. But when I describe the ingress as mentioned in my tutorial mentioned above (section 13) running </p>

<pre><code> kubectl describe ing -n echoserver echoserver  
</code></pre>

<p>The value of Address in the response of above command is empty, therefore no way to hit the ingress.   </p>

<p><em>UPDATE</em>:  </p>

<p>I created a ALB (through the aws UI, and allowed to forward requests to a target group which is created as default) and set its DNS name to the host name(in simple letters) in ingress yaml file. But I can't see it works. I follow the steps mentioned in above <a href="https://github.com/kubernetes-sigs/aws-alb-ingress-controller/blob/master/docs/walkthrough.md" rel="nofollow noreferrer">above tutorial</a>.  </p>

<pre>
kubectl logs -n kube-system \
    $(kubectl get po -n kube-system | \
    egrep -o alb-ingress[a-zA-Z0-9-]+) | \
    egrep -o '\[ALB-INGRESS.*$'
</pre>  

<p>When the above log command executed only the following output returned:    </p>

<pre>
[ALB-INGRESS] [controller] [INFO]: Log level read as "", defaulting to INFO. To change, set LOG_LEVEL environment variable to WARN, ERROR, or DEBUG.
[ALB-INGRESS] [controller] [INFO]: Ingress class set to alb
[ALB-INGRESS] [controller] [INFO]: albNamePrefix undefined, defaulting to f0591ff6
</pre>

<p>As per step 12, when the log command executed,  </p>

<pre>kubectl logs -n kube-system \
    $(kubectl get po -n kube-system | \
    egrep -o alb-ingress[a-zA-Z0-9-]+) | \
    egrep -o '\[ALB-INGRESS.*$' | \
    grep 'echoserver\/echoserver'
</pre>

<p>there is no any logs.   </p>

<p>Also, when following command executed:<br>
kubectl describe ing -n echoserver echoserver<br>
The response is:  </p>

<p><pre>
Name:             echoserver
Namespace:        echoserver
Address:
Default backend:  default-http-backend:80 (172.17.0.4:8080)
Rules:
  Host                                                Path  Backends
  ----                                                ----  --------
  ingress-alb-3455057285.us-east-2.elb.amazonaws.com
                                                      /   echoserver:80 ()
Annotations:
Events:  
</pre></p>

<p>Any idea please where things go wrong ?<br>
I did not set any IAM roles here. If it is required, let me know how should I do it.</p>

Débora
<p>It would be quite easy to create a shell script that does the following:</p>

<ol>
<li><p>Describe your AWS load balancer  </p>

<p><a href="https://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html" rel="nofollow noreferrer">ELBv1</a></p>

<pre><code>aws elb describe-load-balancers --load-balancer-name my-load-balancer
</code></pre>

<p><a href="https://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html" rel="nofollow noreferrer">ELBv2</a></p>

<pre><code>aws elbv2 describe-load-balancers --load-balancer-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
</code></pre></li>
<li><p>Filter LB DNS name from the step 1 output: </p>

<p>ELBv1  </p>

<pre><code>jq '.LoadBalancerDescriptions[].DNSName'
</code></pre>

<p>ELBv2  </p>

<pre><code>jq '.LoadBalancers[].DNSName'
</code></pre></li>
<li><p>Insert results from the step 3 to your ingress yaml template file</p></li>
<li>Apply resulting YAML file from the step 4 to your cluster.</li>
</ol>
