I am implementing an ingress controller with AWS and following this tutorial.
When creating an ingress as shown here, a host name should be given.
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
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 host attribute. But when I describe the ingress as mentioned in my tutorial mentioned above (section 13) running
kubectl describe ing -n echoserver echoserver
The value of Address in the response of above command is empty, therefore no way to hit the ingress.
UPDATE:
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 above tutorial.
kubectl logs -n kube-system \ $(kubectl get po -n kube-system | \ egrep -o alb-ingress[a-zA-Z0-9-]+) | \ egrep -o '\[ALB-INGRESS.*$'
When the above log command executed only the following output returned:
[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
As per step 12, when the log command executed,
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'
there is no any logs.
Also, when following command executed:
kubectl describe ing -n echoserver echoserver
The response is:
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:
Any idea please where things go wrong ?
I did not set any IAM roles here. If it is required, let me know how should I do it.