Setting TCP keepalive on a CONTAINER

1.4k Views Asked by At

I am using Azure Kubernetes, and trying to set TCP_Keepalive on a container basis. Is there away of achieving that?

1

There are 1 best solutions below

1
Philip Welz On

You could do this via sysctls on the pod manifest in AKS/Kubernetes:

spec:
  securityContext:
    sysctls:
    - name: "net.ipv4.tcp_keepalive_time"
      value: "45"

Here is also further documentation:

https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/

https://docs.syseleven.de/metakube/de/tutorials/confiugre-unsafe-sysctls