Review kubelet streaming connection timeouts

Verify effective streaming idle timeouts so unnecessary sessions do not remain open.

Description

The kubelet’s deprecated streamingConnectionIdleTimeout field no longer has any effect. For exec, attach or port-forward, check the runtime or other component that handles the stream.

Potential impact

Without an effective idle limit, unused sessions can stay open and continue consuming resources.

Remediation

Set an idle limit with a control supported by your Kubernetes version and container runtime. Test that normal debugging works and an inactive connection closes after the configured interval.

Examples

The foo/bar image illustrates the arguments. On older versions where it took effect, --streaming-connection-idle-timeout=0 disabled the limit. The second excerpt omits that option. Verify the timeout on the component handling the stream.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: foo/bar
      command: ["kubelet"]
      args: ["--streaming-connection-idle-timeout=0"]

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: foo/bar
      command: ["kubelet"]
      args: []

References