AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Error creating load balancer (will retry): Failed to create load balancer for service default/traefik: user supplied IP Address was not found

Open giorgited opened this issue 8 years ago • 15 comments

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.

giorgited avatar Mar 17 '18 13:03 giorgited

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

Cono52 avatar Mar 28 '18 14:03 Cono52

Make sure the ip address is in the resource group that holds the nodes. That resource group is prefixed with MC_

slack avatar Apr 03 '18 02:04 slack

@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.

ZaidDreakhGE avatar Apr 13 '18 11:04 ZaidDreakhGE

Is there a limitation to only one public ip ?

lionelperrin avatar Apr 25 '18 15:04 lionelperrin

@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 avatar Apr 25 '18 15:04 slack

@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 avatar Apr 25 '18 15:04 lionelperrin

@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)

feiskyer avatar Apr 26 '18 01:04 feiskyer

@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

gyurobenjamin avatar Apr 26 '18 13:04 gyurobenjamin

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

Denusdv avatar Jun 18 '18 08:06 Denusdv

There is a workaround here: https://github.com/Azure/AKS/issues/357

lmcarreiro avatar Jun 20 '18 01:06 lmcarreiro

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_.

james-burke-codes avatar Oct 23 '18 16:10 james-burke-codes

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....

akazemis avatar Jul 25 '19 08:07 akazemis

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 avatar Aug 19 '19 08:08 cochiseruhulessin

@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?

james-burke-codes avatar Aug 19 '19 10:08 james-burke-codes

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}

arindamdat avatar Mar 01 '20 07:03 arindamdat