简体   繁体   中英

Multiple DNS Names for a public IP in Azure AKS

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM