-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for getting SNAT Ports from Load Balancer/AKS (data "azurerm_lb_outbound_rule") #19301
Comments
Hi @ElvenSpellmaker! Thanks for raising this. Is there at this moment a way to get the number you are looking for? I mean, in your example you are setting a value, is this the same value expected as an output, like:
An example how to solve this via |
Hey, you can definitely see the number in the portal (from my screenshot above) https://user-images.githubusercontent.com/2286713/201972120-5758db8f-7753-4f0a-a84c-6b83b0023cc9.png |
So to understand what you're looking for, correct me if I'm wrong:
Can you explain what the difference is between the two or why this helps? |
The use-case is so we can set an alert up on SNAT ports used as a % of the total allocated without having to hardcode it. It's the same value, just it can't currently be retrieved in TF, but can be seen in the portal and set by both the AKS resource and by standalone outbound_rule resources. See:
|
Also for completeness to your original question, yes this can be obtained by $ az network lb outbound-rule list -g MC-foo-bar-baz --lb-name kubernetes --subscription <sub>
[
{
"allocatedOutboundPorts": 5816,
... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Description
Due to the low SNAT port defaults of 1024 (even when you have a few nodes) when using the default Load Balancer configuration in Kubernetes and ran into SNAT port exhaustion.
(Moving to NAT Gateway isn't an option at the present time but still.)
We've since done this in our K8s to up the amount of allocated ports, allowing us to have 10 nodes:
However there's no way for us to retrieve the number, which we'd love so we may alert on X% of SNAT ports used for example, as there's no data source for Outbound Rules.
It'd be nice to expose this from the outputs of
azurerm_kubernetes_cluster
as well seeing as we set this from this resource (but no way of retrieving it), but at least some way of getting them (i.e.data "azurerm_lb_outbound_rule
) would be great.New or Affected Resource(s)/Data Source(s)
azurerm_lb_outbound_rule (new data), azurerm_kubernetes_cluster (affected data)
Potential Terraform Configuration
No response
References
https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections
The text was updated successfully, but these errors were encountered: