title: AKS Standard Load Balancer TCP Reset Annotations
body: <p>We are upgrading our AKS cluster in order to use Standard SKU load balancers that went GA recently. See this <a href="https://azure.microsoft.com/en-us/updates/standard-load-balancers-in-azure-kubernetes-service-aks/" rel="nofollow noreferrer">Microsoft Update Notification</a>.Previously only basic SKU load balancers were available and they  would not allow us to send a TCP reset when connections went stale. This lead to a lot of creative work arounds to deal with stale connections in connection pools for example.</p>
  
  <p>So during creation of an ingress I can configur the load balancer by using annontations. For example I can set type to  internal and timeout settings using annotations. However being able to set the TCP reset flag to true via annotations does not seem possible. I have found with some digging a list of the annotations in this <a href="https://gowalker.org/k8s.io/kubernetes/pkg/cloudprovider/providers/azure" rel="nofollow noreferrer">Go Walker</a> page. </p>
  
  <p>I have managed to create a ingress controller using the following yaml. <em>Note the annonations.</em> </p>
  
  <pre><code>controller:
    service:
      loadBalancerIP: 172.15.23.100
      annotations:
        service.beta.kubernetes.io/azure-load-balancer-internal: "true"
        service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: "15"
  </code></pre>
  
  <p>I ran the following commands:</p>
  
  <pre><code>helm install stable/nginx-ingress --namespace ingress -f dev-ingress.yaml --name dev-ingress --set controller.replicaCount=3
  </code></pre>
  
  <p>After a minute or so I can see the internal loadbalancer getting the specified IP address and I can also see it on the console see below:</p>
  
  <pre><code>kubectl -n ingress get svc dev-ingress-nginx-ingress-controller
  NAME                                         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE   SELECTOR
  dev-ingress-nginx-ingress-controller         LoadBalancer   172.15.24.11   172.15.23.100   80:30962/TCP,443:30364/TCP   24m   app=nginx-ingress,component=controller,release=dev-ingress
  </code></pre>
  
  <p>However the load balancing rules are created with a TCP reset to false. Which requires me to log into the console and change it. See screen shot below:</p>
  
  <p><a href="https://i.stack.imgur.com/rR9nL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rR9nL.png" alt="DefaultTCPRule"></a></p>
  
  <p>I really would like to script this into the creation as doing things via interfaces leads to Snowflake deployments. </p>
  
  <p>Something like the yaml below:</p>
  
  <pre><code>controller:
    service:
      loadBalancerIP: 172.15.23.100
      annotations:
        service.beta.kubernetes.io/azure-load-balancer-internal: "true"
        service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout: "15"
        service.beta.kubernetes.io/azure-load-balancer-tcp-reset: "true"
  </code></pre>
  
  <p>Anyone know how I can configure this during service/ingress creation? </p>
  
  <p><strong>Update:</strong></p>
  
  <p>Based on the limitations documented on the <a href="https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-tcp-reset" rel="nofollow noreferrer">TCP Reset setting for loadbalancers</a> document it appears that it is not supported from kubectl. However it also says that the portal is not supported. </p>