Skip to content

fix(kubelet): remove streamingConnectionIdleTimeout for k8s >= 1.34#8812

Open
abigailliang-aks-sig-node wants to merge 4 commits into
mainfrom
remove-streaming-connection-idle-timeout
Open

fix(kubelet): remove streamingConnectionIdleTimeout for k8s >= 1.34#8812
abigailliang-aks-sig-node wants to merge 4 commits into
mainfrom
remove-streaming-connection-idle-timeout

Conversation

@abigailliang-aks-sig-node

@abigailliang-aks-sig-node abigailliang-aks-sig-node commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove streamingConnectionIdleTimeout from both the kubelet command line and the kubelet config file for Kubernetes >= 1.34, where this field was removed from KubeletConfiguration.

Context: RP-side flow (scriptless path)

Step 1: defaults_kubelet.go — removeKubeletFlags()
        └── k8s >= 1.34: delete(kubeletConfig, "--streaming-connection-idle-timeout")
                ↓
        kubeletConfig map (flag is already gone)
                ↓
Step 2: scriptless_direct.go — processKubeletConfigFileContent()
        └── cfg.StreamingConnectionIdleTimeout = kubeletFlags["--streaming-connection-idle-timeout"]
            → empty string (key was deleted in step 1)
                ↓
Step 3: scriptless_direct.go — processKubeletFlags()
        └── filterKubeletFlags() strips translated flags when enableKCF=true
            → flag not on command line either way
                ↓
Step 4: Proto sent to aks-node-controller
        └── KubeletConfigFileConfig.StreamingConnectionIdleTimeout = "" (omitted by protojson)

RP already handles this in removeKubeletFlags(). However, the field may still arrive in KubeletConfigFileConfig from:

  • Older RP versions that haven't rolled out yet
  • The GetAKSNodeConfig (NBC conversion) path where the removal may not be applied

Changes (defense-in-depth)

File Change
aks-node-controller/helpers/utils.go ValidateAndSetLinuxKubeletFlags(): delete --streaming-connection-idle-timeout for >= 1.34
aks-node-controller/parser/parser.go getCSEEnv(): clear KubeletConfigFileConfig.StreamingConnectionIdleTimeout for >= 1.34 before marshaling
pkg/agent/baker.go ValidateAndSetLinuxNodeBootstrappingConfiguration(): same flag deletion for the old NBC path

Why both flag deletion AND config file clearing?

  • Flag deletion (helpers/utils.go, baker.go): covers enableKCF=false case where translated flags stay on the command line
  • Config file clearing (parser.go): covers enableKCF=true case where the field would appear in kubeletconfig.json if RP sets it

Test plan

Copilot AI review requested due to automatic review settings July 1, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent streamingConnectionIdleTimeout from being propagated to kubelet for Kubernetes >= 1.34, where the corresponding KubeletConfiguration field/flag has been removed, by stripping it from kubelet CLI flags and clearing it from the kubelet config-file content.

Changes:

  • Delete --streaming-connection-idle-timeout from kubelet flags for Kubernetes >= 1.34 in both the legacy NodeBootstrappingConfiguration path and the aks-node-controller helper path.
  • Clear KubeletConfigFileConfig.StreamingConnectionIdleTimeout for Kubernetes >= 1.34 before marshaling kubelet config-file JSON in aks-node-controller.
  • Add version gating comments explaining why the field must not appear for 1.34+.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/agent/baker.go Removes --streaming-connection-idle-timeout from kubelet flags for k8s >= 1.34 in the NodeBootstrappingConfiguration validation path.
aks-node-controller/parser/parser.go Clears StreamingConnectionIdleTimeout before kubelet config-file JSON marshaling for k8s >= 1.34.
aks-node-controller/helpers/utils.go Removes --streaming-connection-idle-timeout from kubelet flags for k8s >= 1.34 in helper validation.

Comment thread aks-node-controller/parser/parser.go
Comment thread aks-node-controller/helpers/utils.go Outdated
Copilot AI review requested due to automatic review settings July 1, 2026 22:56
@abigailliang-aks-sig-node
abigailliang-aks-sig-node changed the base branch from main to scriptless-kubelet-config-file-sync July 1, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread aks-node-controller/parser/parser.go
ImageGcHighThresholdPercent: to.Ptr(int32(90)),
ImageGcLowThresholdPercent: to.Ptr(int32(70)),
CgroupsPerQos: to.Ptr(true),
CpuManagerPolicy: "static",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change block due to gofmt/goimports column alignment.

When a struct literal contains multiple fields, gofmt attempts to align the values ​​following the colons into the same column. The width of the aligned column is determined by the longest field name in the group:

// nested
"--client-ca-file": "/etc/kubernetes/certs/ca.crt",
"--authentication-token-webhook": "true",
"--authorization-mode": "Webhook",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same gofmt behave

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 18, 2026, 3:43 AM

This comment was marked as duplicate.

Copilot AI review requested due to automatic review settings July 14, 2026 00:41

This comment was marked as duplicate.

Copilot AI review requested due to automatic review settings July 14, 2026 00:44

This comment was marked as duplicate.

streamingConnectionIdleTimeout was removed from KubeletConfiguration in k8s 1.34.
This ensures it does not appear on the command line or in the config file for those versions.

Changes:
- Delete --streaming-connection-idle-timeout from KubeletFlags in baker (Linux + Windows)
- Filter deprecated flags from CustomConfiguration output path without mutating RP data
- Add getDeprecatedKubeletFlags util for version-gated flag filtering
- Clear the flag in aks-node-controller parser (scriptless path)
- Mark proto field and Go struct field as deprecated
- Regenerate kubelet_config.pb.go via make proto-generate
- Add comprehensive unit tests covering version gating, final command line output,
  custom configuration path, and non-reintroduction
- Add e2e test removing streaming-connection-idle-timeout from NBC template
Copilot AI review requested due to automatic review settings July 15, 2026 00:20
@abigailliang-aks-sig-node
abigailliang-aks-sig-node force-pushed the remove-streaming-connection-idle-timeout branch from cd3803e to 95936ac Compare July 15, 2026 00:20

This comment was marked as duplicate.

@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172264217
Failed job/stage/task: �2e / Run AgentBaker E2E / Run AgentBaker E2E

TL;DR: Ubuntu 24.04 Gen2 E2E package validation reached the node and then failed because expected moby-containerd 2.3.2-ubuntu24.04u1 was missing from installed packages.

Likely cause/signature: deterministic VHD/package-content or expectation skew ($e2eSig).

Confidence: High.

Recommended owner/action: VHD/package owner should compare Ubuntu 24.04 package feed/build inputs against installed package inventory and either fix the package source/image content or correct expected metadata.

Strongest alternative: test expectation advanced before package/feed availability; less likely to be PR-change-caused because PR #8812 changes kubelet streaming idle timeout logic, not containerd packaging.

Evidence: E2E est-log.json reports the package assertion; sibling Ubuntu 24.04 Gen2 leaves show the same signature; retry evidence is deterministic rather than transient.

Wiki signature: ubuntu2404-gen2-moby-containerd-232-ubuntu2404u1-missing

Copilot AI review requested due to automatic review settings July 15, 2026 21:15
@abigailliang-aks-sig-node

Copy link
Copy Markdown
Contributor Author

AgentBaker Linux gate detective

Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172264217 Failed job/stage/task: �2e / Run AgentBaker E2E / Run AgentBaker E2E

TL;DR: Ubuntu 24.04 Gen2 E2E package validation reached the node and then failed because expected moby-containerd 2.3.2-ubuntu24.04u1 was missing from installed packages.

Likely cause/signature: deterministic VHD/package-content or expectation skew ($e2eSig).

Confidence: High.

Recommended owner/action: VHD/package owner should compare Ubuntu 24.04 package feed/build inputs against installed package inventory and either fix the package source/image content or correct expected metadata.

Strongest alternative: test expectation advanced before package/feed availability; less likely to be PR-change-caused because PR #8812 changes kubelet streaming idle timeout logic, not containerd packaging.

Evidence: E2E est-log.json reports the package assertion; sibling Ubuntu 24.04 Gen2 leaves show the same signature; retry evidence is deterministic rather than transient.

Wiki signature: ubuntu2404-gen2-moby-containerd-232-ubuntu2404u1-missing

fix at #8959

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go: Generated file

Comment on lines +233 to +235
// streamingConnectionIdleTimeout was removed from Kube
// letConfiguration in k8s 1.34+.
// It must not appear on the command line or in the config file for those versions.
@aks-node-assistant

Copy link
Copy Markdown
Contributor

Detective summary

Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172411891

Failed job/stage/task: Build VHD across the VHD matrix during Packer azure-arm ARM deployment validation.

TL;DR: the gate failed before image provisioning because ARM validation hit QuotaExceeded for standardDDSv5Family cores in WestUS3. The missing BCC log publish failures are downstream/collateral.

Likely cause / signature

  • Signature: Packer azure-armInvalidTemplateDeploymentQuotaExceeded for standardDDSv5Family cores → packer.mk:38packer.mk:98 → exit code 2.
  • Likely cause: infrastructure/regional VM-family quota exhaustion in the VHD gate subscription/region, not the kubelet flag changes in PR fix(kubelet): remove streamingConnectionIdleTimeout for k8s >= 1.34 #8812.
  • Classification: Infrastructure / Packer capacity failure.
  • Confidence: Very high.
  • Strongest alternative: PR changed SKU/matrix demand; less likely because changed files are kubelet/ANC/parser-related and ARM rejects quota before repo code runs.

Recommended owner / action

Node Lifecycle / VHD gate infra owner: increase standardDDSv5Family quota in WestUS3 or reduce/throttle concurrent matrix jobs using that family; re-run after capacity is restored.

Evidence

  • Timeline: multiple Build VHD task failures; BCC log publish failures are secondary.
  • Logs: Build VHD logs 191, 199, and 221 show InvalidTemplateDeployment / QuotaExceeded for standardDDSv5Family.
  • Wiki signature: linux-vhd-packer-westus3-vm-family-quota-exceeded

…ection-idle-timeout

# Conflicts:
#	aks-node-controller/parser/parser.go
Copilot AI review requested due to automatic review settings July 18, 2026 03:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go: Generated file
Comments suppressed due to low confidence (2)

pkg/agent/utils.go:424

  • This comment is misleading: the function still mutates the caller's custom config by merging in missing default flags (see the loop just above). Suggest rewording to clarify that only deprecated-flag removal is avoided, not all mutation.
	// Filter out deprecated flags at output time rather than mutating the caller's CustomConfiguration.

aks-node-controller/helpers/utils.go:235

  • The word "KubeletConfiguration" is broken across two comment lines ("Kube" / "letConfiguration"), which reads like a typo in rendered docs and makes grepping harder. Rewrap the comment without splitting the identifier.
	// streamingConnectionIdleTimeout was removed from Kube
	// letConfiguration in k8s 1.34+.
	// It must not appear on the command line or in the config file for those versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants