terraform-provider-azurerm: InvalidLoadBalancerProfile in AKS
After deplyoing an app with a load balancer into a fresh AKS cluster with no load balancer profile configured (only sku to Standard) and then changing for example number of nodes gives me:
Error: Code="InvalidLoadBalancerProfile" Message="Load balancer profile must
specify one of ManagedOutboundIPs, OutboundIPPrefixes and OutboundIPs."
Target="networkProfile.loadBalancerProfile"
Output of terrafom apply which is causing it I guess:
load_balancer_profile {
effective_outbound_ips = [
"/subscriptions/..../publicIPAddresses/.....",
]
managed_outbound_ip_count = 1
outbound_ip_address_ids = []
outbound_ip_prefix_ids = []
}
}
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and AzureRM Provider) Version
Terraform v0.12.23
- provider.azurerm v2.6.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 72
- Comments: 28 (7 by maintainers)
Commits related to this issue
- Bug: azurerm_kubernetes_cluster errors out with InvalidLoadbalancerProfile on changes (#6534) Fixes #6525 — committed to hashicorp/terraform-provider-azurerm by aristosvo 4 years ago
This issue (in my experience), means that all versions of the provider > 2.5 are broken for AKS, regardless of the version of the provider used to create the AKS cluster.
It’s actually a rather insidious break, because you can create AKS clusters using newer versions of the provider, but the first time you have a modification,
terraform applywill crap out every time.To me, this appears to be a grade A drop-everything-and-fix-it issue because to all intents and purposes the past four provider releases are fundamentally broken for all AKS users… please excuse me if I’ve got the wrong end of the stick and there’s a workaround I missed!
@nivhty upgrade to 2.10.0 for the fix.
It is still working in 2.5.0!
To make it possible to change your loadbalancer outbound IP settings without recreating the cluster I filled a PR, which is merged into 2.6.0. Due to this PR the loadbalancer outbound settings can be changed. But if these settings are not changed a bug in the code causes your AKS cluster to think you have no outbound loadbalancer settings, which blocks any other kind of change you want to make to your cluster.
The good news is 2.5.0 is still working and just limited functionality has made it past that. If you need 2.6+ functionality, this sad issue is blocking cluster changes after cluster creation.
I am having the same issue after upgrading to azure provider v2.6.0. I have tried to fix the issue by adding the
load_balancer_profileblock as so:However, I get the same error in the description of this issue.
It’s quit easy to separate the versions between two resources, although I feel your pain.
Bugs like these on advanced resources are not always easy to catch though…
I have just observed this with 2.9.0. this is the error message:
containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidLoadBalancerProfile" Message="Load balancer profile must specify one of ManagedOutboundIPsI basically did a
terraform plan,terraform applyand then anotherterraform planandterraform apply.@tombuildsstuff Can we tag this as a /bug? The fix is already available, including a test reproducing the failure.
@robologic et all: as a workaround you can also change the number of outbound IP’s for every change, the problem shows when no change in the
load_balancer_profileis applied. In that case theload_balancer_profileconfiguration is not included in the request towards Azure 😢Just linked in the issue above. If you’re looking to upgrade and are using the
BasicSKU of postgres, you’ll encounter another show-stopper bug.is this PR the official one ? https://github.com/terraform-providers/terraform-provider-azurerm/pull/6534. we need a custom build as this is breaking all cluster update 😦
@asubmani I’m sorry, it is not merged yet. If any of you can thoroughly review https://github.com/terraform-providers/terraform-provider-azurerm/pull/6534 it might speed up things a bit, but other than that I can do nothing.
👍 on the issue is the best way for the maintainers to indicate the need for the fix.