Set Idle timeout and TCP Reset on Azure Load Balancer via a Service in AKS

Short post here. On a recent project, we had been deploying a workload on AKS that included a load balancer service type. This app has some long-running processes and we needed to stop the Azure load balancer from timing out so fast.

In order to better handle the long-running processes, I needed to enable the TCP reset and change the idle timeout (minutes) in the load balancing rule on the Azure Load Balancer. This is shown in the following screenshot:

So you can configure these settings by adding annotations to your Kubernetes manifest file. The full list of load balancer annotations can be found here: https://kubernetes-sigs.github.io/cloud-provider-azure/topics/loadbalancer/#loadbalancer-annotations The ones I needed specifically are:

  annotations:

    service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset: true

    service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: 30

This was great however it was not clear if the TCP Reset annotation was deprecated or not (see the following screenshot).

I tried it anyway and it worked. It looks like it will be removed at some point. This meets the need for now but is something to keep an eye on.

Read more