I managed to assign the old ip to the new cluster. These are the steps that I followed:
- Create a new static and public ip in the old cluster (nn.nn.nn.nn): az network public-ip create --resource-group MC_rg-my-old-cluster \
--name aks-public-ip-tmp --sku Standard --allocation-method static \
--query publicIp.ipAddress -o tsv - Put the new ip in the load balancer service of the nginx controller: spec.ports.loadBalancerIP: nn.nn.nn.nn
- Move old ip address (oo.oo.oo.oo) to the resource group of the new cluster:
- Find the resource group of the old cluster and open it;
- Click on the public ip address that you want to move;
- In the menu on the top there is a 'Move' item, select "Move to another resource group"
- Select the resource group of the new cluster
After the ip is moved (can take a while) you can use it in the load balancer service of the nginx controller in the new cluster:
spec.ports.loadBalancerIP: oo.oo.oo.oo
I don't know if steps 1 and 2 are really needed.