Skip to content

feat(aks-node-controller): add kubelet config fields for flag migration - #9576

Merged
Gao Peng (gaopenghigh) merged 2 commits into
mainfrom
gaopeng/kubelet-config-schema
Sep 18, 2026
Merged

Gao Peng (gaopenghigh) merged 2 commits into
mainfrom
gaopeng/kubelet-config-schema

Conversation

@gaopenghigh

@gaopenghigh Gao Peng (gaopenghigh) commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Add seven missing KubeletConfigFileConfig fields to aks-node-controller as a prerequisite for a later kubelet flag-to-config migration. The existing serializers already handle these fields, so no handwritten production parser changes are needed. (Upstream Kubernetes is pushing everyone off flags — as of v1.37, AddKubeletConfigFlags marks every flag that has a config-file equivalent as deprecated. So AKS eventually has to move.)

No customer impact. This is additive schema support only. Existing callers leave the new fields unset and retain their existing serialized output. No producer populates the fields in this PR; no CLI flags are removed, config-file delivery enabled, version gates changed, or provisioning scripts modified. Future activation/flag cleanup must be a separate change restricted to stable Kubernetes agent-pool versions >=1.38. Existing versions remain unchanged.

Changes

  • Append field numbers 46–52 without modifying existing fields or wire numbers; regenerate Go bindings with the repository-pinned protobuf tools.
  • Use an explicitly optional boolean for enableServer, preserving omitted versus explicit false.
  • Preserve string values, including the zero duration "0s", and structured taints (key, value, effect, optional RFC3339 timeAdded).
  • Add JSON/protobuf round-trip, exact legacy-output, Windows-path, taint-order and no-activation regressions.
  • Document the contract and the distinction between decoding compatibility and support for applying new settings.

Upstream references

Kubernetes deprecates config-backed flags in AddKubeletConfigFlags, directing users to --config. The seven corresponding registrations are linked individually:

Flag Config field Upstream registration
--enable-server enableServer source
--volume-plugin-dir volumePluginDir source
--cgroup-driver cgroupDriver source
--runtime-request-timeout runtimeRequestTimeout source
--container-runtime-endpoint containerRuntimeEndpoint source
--register-with-taints registerWithTaints source
--hairpin-mode hairpinMode source

Field names/types match the kubelet v1beta1 configuration API and core Taint type. This is not a claim of Kubernetes 1.38 runtime validation.

Validation

Run from aks-node-controller:

  • go test -mod=readonly ./parser -run 'TestKubeletConfig|Test_getKubeletConfigFileContent' -count=1 — passed.
  • go build -mod=readonly ./... — passed.
  • go test -mod=readonly ./... -count=1 — passed, including the existing historical-consumer compatibility tests.
  • golangci-lint run ./... — passed, zero issues.
  • Repository-pinned buf format/lint and WIRE_JSON breaking checks against upstream base — passed; generated kubelet bindings reproduce byte-for-byte with protoc 28.3 / protoc-gen-go 1.35.2.
  • No-activation tests cover version strings 1.31–1.37, 1.38 alpha, and 1.38 stable; these are parser regressions, not kubelet binary tests.

No live cluster rollout or node restart was performed. Older consumers ignoring unknown fields is not sufficient for future flag removal; compatible consumer delivery remains a separate prerequisite.

Which issue(s) this PR fixes:

No linked issue. Additive prerequisite only; the actual flag migration is out of scope.

Copilot AI balanced review requested due to automatic review settings September 18, 2026 01:07
@github-actions

github-actions Bot commented Sep 18, 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✅ passedSep 18, 2026, 6:49 PM

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   17 suites   49s ⏱️
484 tests 484 ✅ 0 💤 0 ❌
487 runs  487 ✅ 0 💤 0 ❌

Results for commit 95b4519.

♻️ This comment has been updated with latest results.

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.

🟢 Approval recommended

The schema additions are backward-compatible, accurately generated, documented, and comprehensively tested without changing runtime activation.

Pull request overview

Adds additive kubelet configuration schema support without activating flag migration.

Changes:

  • Adds seven protobuf fields and structured taints.
  • Regenerates Go protobuf bindings.
  • Adds compatibility, serialization, and no-activation tests.
File summaries
File Description
aks-node-controller/proto/README.md Documents schema and migration constraints.
aks-node-controller/proto/aksnodeconfig/v1/kubelet_config.proto Defines new kubelet fields and taints.
aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go Updates generated Go bindings.
aks-node-controller/parser/kubelet_config_test.go Covers serialization and compatibility behavior.
Review details

Files not reviewed (1)

  • aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go: Generated file
  • Files reviewed: 3/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 18, 2026 18:48
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 72%
github.com/Azure/agentbaker/aks-node-controller/common 100%
github.com/Azure/agentbaker/aks-node-controller/helpers 71%
github.com/Azure/agentbaker/aks-node-controller/parser 89%
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100%
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 67%
github.com/Azure/agentbaker/aks-node-controller/utils 0%
github.com/Azure/agentbaker/apiserver 25%
github.com/Azure/agentbaker/cmd 0%
github.com/Azure/agentbaker/cmd/starter 0%
github.com/Azure/agentbaker/fuzz/api 0%
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 0%
github.com/Azure/agentbaker/pkg/agent 76%
github.com/Azure/agentbaker/pkg/agent/datamodel 76%
github.com/Azure/agentbaker/pkg/agent/toggles 0%
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 88%
Summary 74% (6315 / 8577)

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
staging_cse_windows Package 1 58%
debug 0%
provisioningscripts 2%
parts_windows Package 1 76%
test 0%
windows 21%
Summary 36% (1434 / 6706)

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 20%
Summary 20% (2821 / 13863)

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.

🟢 Approval recommended

The additive schema changes preserve existing wire numbers and serialized output while receiving comprehensive regression coverage.

Review details

Files not reviewed (1)

  • aks-node-controller/pkg/gen/aksnodeconfig/v1/kubelet_config.pb.go: Generated file
  • Files reviewed: 6/7 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@gaopenghigh
Gao Peng (gaopenghigh) enabled auto-merge (squash) September 18, 2026 18:58
@gaopenghigh
Gao Peng (gaopenghigh) merged commit 5a48985 into main Sep 18, 2026
43 checks passed
@gaopenghigh
Gao Peng (gaopenghigh) deleted the gaopeng/kubelet-config-schema branch September 18, 2026 21:05
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.

4 participants