Reputation: 549
I have a AKS cluster and I want to get the public IP of the virtual machine scale set associated with the cluster's agentpool. I found this documentation page and tried the following API call:
GET https://management.azure.com/subscriptions/{your sub ID}/resourceGroups/{RG name}/providers/Microsoft.Compute/virtualMachineScaleSets/{scale set name}/publicipaddresses?api-version=2017-03-30
but i get this response: {"value":[]}
Upvotes: 0
Views: 1770
Reputation: 31414
For your issue, you need to take care of the message that how does the VMSS create:
To create a scale set that assigns a public IP address to each virtual machine with the CLI, add the --public-ip-per-vm parameter to the vmss create command.
Only in this way you can get the public IP addresses via the REST API:
GET https://management.azure.com/subscriptions/{your sub ID}/resourceGroups/{RG name}/providers/Microsoft.Compute/virtualMachineScaleSets/{scale set name}/publicipaddresses?api-version=2017-03-30
But when you create the AKS cluster and enable the VMSS as the agent pool, the VMSS always behind in a Load Balancer so that it's publicIpAddressConfiguration
property is null
and give your response as empty.
Upvotes: 1
Reputation: 1051
You can validate whether the publicipaddresses
key of your scale set contains any values by visiting https://resources.azure.com/ and navigating to the scale set. It is entirely possible that your VMSS has no public IPs associated with the VMs.
Upvotes: 2
Reputation: 91
By default the virtual machine scale set of AKS doesn't have public IP. AKS nodes do not require their own public IP addresses for communication.
But you can assign a public IP per node(preview mode).
Here is the link to official documentation:
Upvotes: 2