Skip to content

feat: support LocalDNS and generated kubelet configuration - #264

Draft
hbc (bcho) wants to merge 17 commits into
mainfrom
hbc/config-validate
Draft

feat: support LocalDNS and generated kubelet configuration#264
hbc (bcho) wants to merge 17 commits into
mainfrom
hbc/config-validate

Conversation

@bcho

Copy link
Copy Markdown
Member

Summary

  • add AKS LocalDNS profile parsing, validation, Corefile rendering, and node labels
  • generate kubelet configuration, including image credential provider settings
  • preserve generated machine goals across daemon reconciliation
  • extend E2E coverage for LocalDNS enable/disable and repave drift
  • update Unbounded to v0.2.3-alpha.0

Validation

@bcho
hbc (bcho) marked this pull request as ready for review August 7, 2026 21:52
Copilot AI lite review requested due to automatic review settings August 7, 2026 21:52
@bcho
hbc (bcho) marked this pull request as draft August 7, 2026 21:52

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 extends AKS FlexNode’s configuration/adapter layer to support AKS LocalDNS profiles (including Corefile template rendering and node label state) and to generate kubelet configuration (including exec image credential provider settings), with accompanying documentation, dependency updates, and E2E coverage updates.

Changes:

  • Add LocalDNS profile types, validation, and Corefile template rendering aligned to AKS/AgentBaker behavior, and propagate LocalDNS state via node labels.
  • Generate kubelet configuration (maxPods, image GC thresholds, logging verbosity) and support kubelet exec image credential provider config with validation.
  • Expand E2E infra/scripts to validate LocalDNS enable/disable and repave drift scenarios; update docs and bump dependencies (Unbounded + k8s libs).

Reviewed changes

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

Show a summary per file
File Description
pkg/config/localdns.go Exposes LocalDNS types/constants at the public config layer.
pkg/config/localdns_test.go Unit tests for Corefile template rendering and validation behavior.
pkg/config/localdns_adapter_test.go Verifies ToAgentConfig LocalDNS adaptation + node label behavior.
pkg/config/kubelet_config_test.go Adds tests for kubelet exec image credential provider JSON + validation.
pkg/config/internal/localdns/testdata/localdns.corefile.golden Golden output for LocalDNS Corefile template rendering.
pkg/config/internal/localdns/localdns.go Implements LocalDNS contract validation + Corefile template rendering.
pkg/config/internal/localdns/localdns_test.go Golden test coverage for internal LocalDNS rendering.
pkg/config/internal/localdns/assets/localdns.corefile.tmpl Embedded Corefile template used for rendering.
pkg/config/copy_test.go Ensures deep copy covers new kubelet provider pointer.
pkg/config/config.go Adds Networking.LocalDNS and kubelet image credential provider config + validation.
pkg/config/adapter.go Adapts LocalDNS + kubelet configuration into shared agent config.
pkg/config/adapter_test.go Extends adapter tests for kubelet configuration/provider adaptation.
hack/e2e/lib/validate.sh Adds runtime LocalDNS validation checks (service, resolv.conf, nft rules, DNS queries).
hack/e2e/lib/upgrade-drift.sh Adds LocalDNS disable-through-repave drift scenario validation.
hack/e2e/lib/node-join-msi.sh Configures host resolver for LocalDNS and supplies nodeIP + localDNS config in MSI join flow.
hack/e2e/lib/infra.sh Captures MSI VM private IP for nodeIP validation and config generation.
hack/e2e/infra/main.bicep Exposes MSI VM private IP from infra outputs.
go.mod Bumps Unbounded and Kubernetes library versions.
go.sum Updates dependency checksums for bumped modules.
docs/usages/configuration.md Documents LocalDNS profile and kubelet image credential provider settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +250 to +253
! systemd-run --quiet --pipe --wait --machine="${machine}" systemctl cat localdns.service >/dev/null 2>&1
! ip link show localdns >/dev/null 2>&1
! iptables -w -t raw -S | grep -q 'unbounded-localdns: skip conntrack'
systemd-run --quiet --pipe --wait --machine="${machine}" \
Comment thread go.mod
Comment on lines 11 to 13
github.com/Azure/kubelogin v0.2.15
github.com/Azure/unbounded v0.2.2
github.com/Azure/unbounded v0.2.3-alpha.1.0.20260806010226-43ec4d137b23
github.com/go-logr/logr v1.4.4
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.

2 participants