Error creating load balancer (will retry): Failed to create load balancer for service default/traefik: user supplied IP Address was not found
I have followed this documentation https://docs.microsoft.com/en-us/azure/aks/static-ip to create a static IP for my traefik svc but im keeping getting the "not found" error like the one shown in the documentation.
I have verified that the public-ip is in the same resource group as the AKS.
When i run this query: az network public-ip list --resource-group myAksRG --query [0].ipAddress --output tsv i can verify that my static ip is indeed in the right palce.
I have the exact same issue
Error creating load balancer (will retry): Failed to ensure load balancer for service default/myapp: user supplied IP Address 1.2.3.4 was not found
Make sure the ip address is in the resource group that holds the nodes. That resource group is prefixed with MC_
@Cono52 @giorgited Hi, did you manage to find a fix? I also have the same problem and I'm pretty sure my IP address is in the same resource group as the cluster.
Is there a limitation to only one public ip ?
@lionelpenuchot AFAIR, you should be able to attach as many public ips up to the Azure quota of "Frontend ip configurations per LB": https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits#load-balancer
@slack Thanks for this very quick answer. Actually, I've created several services like:
apiVersion: v1
kind: Service
metadata:
labels:
app: test
service: env1-webui
name: env1-webui
spec:
loadBalancerIP: X.X.X.X
type: LoadBalancer
ports:
- name: "http"
port: 80
targetPort: 5000
selector:
app: test
service: env1-webui
The first service works as expected but the other services fail with the following error message:
Error creating load balancer (will retry): Failed to ensure load balancer for service default/env3-webui: network.SecurityGroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="SecurityRuleParametersMissing" Message="Required security rule parameters are missing for security rule with Id: /subscriptions/xxxxxxxx/resourceGroups/MC_xxxxxx_eastus/providers/Microsoft.Network/networkSecurityGroups/aks-agentpool-xxxxxx-nsg/securityRules/a6942766a46dd11e8ab840a58ac1f001-TCP-80-Internet. Security rule must specify SourceAddressPrefixes, SourceAddressPrefix, or SourceApplicationSecurityGroups." Details=[]
I've noticed that the ip name is always the first ip. a6942766a46dd11e8ab840a58ac1f001-TCP-80-Internet.
@lionelperrin Have you used SourceAddressPrefixes in the NSG? If so, replace it with multiple SourceAddressPrefix could fix it. (this is a known issue in Kubernetes v1.8.X and upgrading to 1.9.X or 1.10.X also fixes it)
@slack why resource group needs to be prefixed with MC_ ? Also why is it not in the documentation? https://docs.microsoft.com/en-us/cli/azure/network/public-ip?view=azure-cli-latest#az_network_public_ip_list
I faced the same issue, validated that the static IP in the same resource group. az network public-ip list --resource-group myAksRG shows the IP correctly. I don't fully understand the matter of MC perfix. when I try to add MC_ the azure complains on "not found group".
Please help me to fix it
There is a workaround here: https://github.com/Azure/AKS/issues/357
Make sure the ip address is in the resource group that holds the nodes. That resource group is prefixed with
MC_
to elaborate on Slack's comment. When you create your AKS resource it also creates another resource group where all the actual Kubernetes VMs etc are, which will be prefixed with MC_. Your Public IP resource needs to be in that Resource Group, not the one you created your AKS service in.
You can get the correct resource group to create your static ip against using the following command: az aks show --name <AKS NAME> -g <RESOURCE GROUP> then look at the value for nodeResourceGroup it will be MC_
how about private ip addresses? could we use a static private ip address? I tried to do so but I'm getting this error in my service:
Error creating load balancer (will retry): failed to ensure load balancer for service XYZ: user supplied IP Address 12.5.100.253 was not found in resource group MC_ABC....
how about private ip addresses? could we use a static private ip address? I tried to do so but I'm getting this error in my service:
Error creating load balancer (will retry): failed to ensure load balancer for service XYZ: user supplied IP Address 12.5.100.253 was not found in resource group MC_ABC....
We have the same issue.
@cochiseruhulessin @akazemis is it because you're creating the IP address in the RG with the AKS resource or are you creating it in RG MC_ABC?
For those who are still seeking the answer: How you can create a Public IP Address in Standard SKU and use it in your service(type=Loadbalancer) is documented here. Important:
- Public IP Address must be in SKU Standard.
- Add the following annotation to your Loadbalancer service so that k8s can locate the Public IP at the specified resource group: service.beta.kubernetes.io/azure-load-balancer-resource-group: {rg-of-public-ip}