I have a k8s cluster that I run. I have the necessary scripts that can create the cluster and destroy it as necessary. I have some of my applications running on this cluster. Recently I configured Ingress controller service and I'm routing my traffic to the application services via this Ingress controller.
I would like to access the application using a hostname where I have defined this in my Ingress rules. For example., when I need to access application A, which has a service IP like 192.168.0.100, I would use the hostname application.a.local. For this I need to edit the /etc/hosts file on the machine that is running the cluster and add an entry there. This is a manual approach. How could I automate this?
Is there a better approach to configure hostname mapping? Any suggestions?