Assigning an IP Address to Private DNS
In this step you assign an IP address from the aks-subnet range to the domain name (external access host).
To assign an IP address to private DNS:
- Set your main resource group name to an environment variable; for example:
RESOURCE_GROUP=srg-demo
vnet
and private-dns
zone are located.- Get the address prefix by running the command:
az network vnet subnet show -g $RESOURCE_GROUP --vnet-name <your virtual network> --name <subnet for AKS>| jq -r .addressPrefix
az network vnet subnet show -g $RESOURCE_GROUP --vnet-name demo-vnet --name aks-subnet | jq -r .addressPrefix
Example result:
10.1.1.0/24
You can select any IP from this range (excepting the first N IP addresses, which are occupied by AKS nodes).
Example selection in this range: 10.1.1.101
- Assign the IP by running the following command:
az network private-dns record-set a add-record -g $RESOURCE_GROUP -z <PRIVATE DNS ZONE> -n <RECORD SET NAME> -a <EXTERNAL-IP>
Parameters
<PRIVATE DNS ZONE>
is the private-dns
zone created earlier (in our example it was arcsight.private.com
).
<RECORD SET NAME>
the name of the record set relative to the zone (in our example, installer
).
<EXTERNAL-IP>
IP must be from aks-subnet range.
az network private-dns record-set a add-record -g $RESOURCE_GROUP -z arcsight.private.com -n installer -a 10.1.1.101
This command will create
installer.arcsight.private.com
with the IP address 10.1.1.101.Next Step: Labeling Azure Kubernetes Service Nodes