I'm trying to setup a K8 ingress to route to multiple services based on the hostname. Like mentioned here.
In Azure, I'm able to map DNS name with Public IP using az-cli
like this,
az network public-ip update --ids $PUBLICIPID --dns-name $DNSNAME
However, this command isn't letting me to add multiple DNS entries to the same publicIP.
What will be the right way to achieve this in Azure KS? Preferably using az-cli
or some other cli
tools.
I dont think you can assign multiple Azure managed DNS names to the same public IP, but you can use Azure DNS or some external DNS provider to have as many CNAME records pointing to the same DNS record as you want to.
az network dns record-set cname set-record --resource-group myresourcegroup --zone-name contoso.com --record-set-name test-cname --cname www.contoso.com
an alternative would be to use external dns to let kubernetes manage it.