Skip to content

Add controller-backed E2E machine state#233

Merged
bcho merged 10 commits into
mainfrom
hbc/controller-backed-e2e
Jul 14, 2026
Merged

Add controller-backed E2E machine state#233
bcho merged 10 commits into
mainfrom
hbc/controller-backed-e2e

Conversation

@bcho

@bcho bcho commented Jul 10, 2026

Copy link
Copy Markdown
Member

Related PRs

Summary

  • add the ConfigMap-backed aks-flex-controller machine endpoint
  • add the Kubernetes service-proxy machine client and daemon/bootstrap credential wiring
  • route ARM, ARM proxy, and in-cluster backends through one machine-client constructor
  • serve and consume the ARM SDK machine shape, using properties.eTag as the settings version
  • let bootstrap idempotently overwrite stale remote versions from local config and seed daemon state from the returned ETag
  • move daemon CSR approval into the controller
  • build the controller with the Microsoft Go image and publish it with deployment manifests and a local E2E registry
  • migrate E2E joins and repave tests from host-local machine JSON to controller-backed state
  • remove the old e2ehelper, local machine client, and unused no-op machine client
  • add controller lifecycle demo scripts for upgrade and soft reboot
  • use the released Unbounded v0.1.21 dependency instead of a pseudo-version
  • document the in-cluster machine bootstrap, daemon, ETag, status, and service-proxy flow

Validation

  • go test ./...
  • go vet ./...
  • golangci-lint run --timeout=5m
  • git diff --check
  • bash -n for shell scripts under hack/e2e, hack/demo, and scripts
  • kubectl kustomize hack/controller-deployment
  • kubectl kustomize hack/e2e/controller-registry

GitHub PR checks and full Azure E2E are running against the latest commit.

@bcho bcho temporarily deployed to e2e-testing July 10, 2026 18:38 — with GitHub Actions Inactive

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 introduces a controller-backed, ConfigMap-sourced “Machine” endpoint that is reachable through the Kubernetes API server service-proxy, and migrates E2E flows away from host-local machine JSON toward that in-cluster state while wiring bootstrap/daemon clients through a unified machine-client constructor.

Changes:

  • Add aks-flex-controller HTTP server + CSR approver and publish deployment manifests and controller image build/release workflow.
  • Add an in-cluster (service-proxy) MachineClient and update bootstrap/daemon/start flows to adopt properties.eTag as the settings version.
  • Migrate E2E join/repave flows to update controller-backed machine state via ConfigMap and remove the old local-e2e machine client and e2ehelper.

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/aks-flex-config Remove bootstrap-token CSR label.
pkg/kubeauth/rest.go New bootstrap REST config helper.
pkg/flexcontroller/server.go New controller HTTP server + CSR approver wiring.
pkg/flexcontroller/server_test.go Unit tests for controller/server behavior.
pkg/daemon/daemon.go Daemon now constructs machine client internally.
pkg/config/config.go Add machine client config + validation.
pkg/config/config_test.go Tests for machine client config validation.
pkg/cmd/start/start.go Run EnsureMachine earlier; adopt settings version.
pkg/cmd/daemon/daemon.go Remove extra wrapper; call daemon.Run directly.
pkg/cmd/controller/controller.go New CLI command for controller.
pkg/aksmachine/types.go Set SettingsVersion fallback; doc tweaks.
pkg/aksmachine/types_test.go Validate SettingsVersion is populated.
pkg/aksmachine/noop.go Remove no-op machine client.
pkg/aksmachine/ensure.go Adopt remote ETag into goal via pointer.
pkg/aksmachine/ensure_test.go Expanded EnsureMachine adoption/update tests.
pkg/aksmachine/client.go Unify machine client routing via options.
pkg/aksmachine/client_nonlocal.go Remove nonlocal wrapper (old API).
pkg/aksmachine/client_local.go Remove local file-backed machine client.
pkg/aksmachine/client_local_test.go Remove local client tests.
pkg/aksmachine/client_incluster.go New in-cluster service-proxy machine client.
pkg/aksmachine/client_incluster_test.go Tests for in-cluster client routing/parsing.
pkg/aksmachine/client_armapi.go Parse more ARM machine goal fields + ETag.
pkg/aksmachine/client_armapi_test.go Tests for expanded ARM parsing behavior.
pkg/aksmachine/client_armapi_proxy.go ARM proxy now uses machineClient.endpointUrl.
Makefile Build controller; remove local_e2e tagged tests.
hack/e2e/run.sh Ensure controller deployed for E2E flows.
hack/e2e/lib/upgrade-drift.sh Repave tests now driven by controller state.
hack/e2e/lib/node-join.sh Remove local machine JSON seeding/deletion.
hack/e2e/lib/node-join-token.sh Configure in-cluster machine client + publish machine JSON.
hack/e2e/lib/node-join-offline.sh Configure in-cluster machine client + publish machine JSON.
hack/e2e/lib/node-join-msi.sh Configure in-cluster machine client + publish machine JSON.
hack/e2e/lib/node-join-kubeadm.sh Use controller flows; remove CSR label use.
hack/e2e/lib/infra.sh Update infra script header/comments.
hack/e2e/lib/controller.sh New controller deploy + machine ConfigMap helpers.
hack/e2e/lib/common.sh Add docker/go/python3 prereqs; remove e2ehelper CSR approver.
hack/e2e/lib/cleanup.sh Collect controller logs; remove CSR approver stop.
hack/demo/aks-flex-node-upgrade.sh New demo script for controller-backed upgrade.
hack/demo/aks-flex-node-soft-reboot.sh New demo script for MachineOperation soft reboot.
hack/controller-deployment/service.yaml Service for controller.
hack/controller-deployment/service-account.yaml ServiceAccount for controller.
hack/controller-deployment/rbac.yaml RBAC for controller + service-proxy access.
hack/controller-deployment/kustomization.yaml Kustomize base for controller deployment.
hack/controller-deployment/deployment.yaml Controller Deployment manifest.
hack/controller-deployment/configmap.yaml Seed empty machine ConfigMap.
go.mod Bump Go version; add logr direct dep.
docs/design/in-cluster-machine.md Design doc for in-cluster machine flow.
Dockerfile.aks-flex-controller Build/publish controller image.
cmd/e2ehelper/main.go Remove e2ehelper entrypoint.
cmd/e2ehelper/localmachine/localmachine.go Remove local-machine helper command.
cmd/e2ehelper/localmachine/localmachine_test.go Remove local-machine helper tests.
cmd/e2ehelper/daemoncsr/daemoncsr.go Remove daemon CSR approver helper command.
cmd/e2ehelper/daemoncsr/daemoncsr_test.go Remove daemon CSR approver helper tests.
cmd/aks-flex-controller/main.go New controller main entrypoint.
.github/workflows/e2e-tests.yml Include controller assets; increase timeout.
.github/workflows/controller-image.yml New GHCR controller image workflow.
.env.example Add controller image/registry E2E knobs.
.dockerignore Add dockerignore for controller builds.

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

Comment thread pkg/config/config.go
Comment thread pkg/aksmachine/client_incluster.go Outdated
Comment thread pkg/aksmachine/ensure.go
Comment thread hack/controller-deployment/rbac.yaml Outdated

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 60 out of 60 changed files in this pull request and generated 2 comments.

Comment thread pkg/aksmachine/client_incluster.go
Comment thread pkg/flexcontroller/server.go Outdated
@bcho bcho deployed to e2e-testing July 13, 2026 23:16 — with GitHub Actions Active
@bcho bcho marked this pull request as ready for review July 13, 2026 23:30
Copilot AI review requested due to automatic review settings July 13, 2026 23:30

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 60 out of 60 changed files in this pull request and generated 2 comments.

Comment thread pkg/config/config.go
Comment thread pkg/aksmachine/ensure.go
@bcho bcho merged commit fe6a4fa into main Jul 14, 2026
11 checks passed
@bcho bcho deleted the hbc/controller-backed-e2e branch July 14, 2026 21:13
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.

3 participants