Skip to content

test(e2e): add real-vm gate for native cloud initialization - #10253

Draft
Abigail Liang (abigailliang-aks-sig-node) wants to merge 5 commits into
abigailliang/anc-cloud-init-alignfrom
abigailliang/anc-cloud-init-e2e-gate
Draft

Abigail Liang (abigailliang-aks-sig-node) wants to merge 5 commits into
abigailliang/anc-cloud-init-alignfrom
abigailliang/anc-cloud-init-e2e-gate

Conversation

@abigailliang-aks-sig-node

@abigailliang-aks-sig-node Abigail Liang (abigailliang-aks-sig-node) commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Stacked on #10252, which adds native cloud initialization in init-cloud. This PR is test and CI only: it does not change ANC or provisioning code.

Standard E2E installs the PR-built ANC only as the provisioning hotfix. init-cloud therefore runs the ANC already on the VHD, and #10252 is not exercised until a VHD is built from it. This PR adds a manual real-VM gate that also installs the PR-built ANC at the VHD path, simulating such a VHD.

  • Pipeline: .pipelines/e2e-anc-cloud-init.yaml (manual, scenario tag nativecloudinit=true).

  • Scenarios: eight, each provisioning through Node Ready and the normal pod validations.

    Image Native, opted in Native, not opted in Native, legacy certificate endpoint NBC precedence (both flags)
    Ubuntu 22.04 Ubuntu2204_NativeCloudInit_OptedIn Ubuntu2204_NativeCloudInit_NotOptedIn Ubuntu2204_NativeCloudInit_LegacyCertEndpoint Ubuntu2204_CloudInit_NBCPrecedence
    Azure Linux 3 AzureLinuxV3_NativeCloudInit_OptedIn AzureLinuxV3_NativeCloudInit_NotOptedIn AzureLinuxV3_NativeCloudInit_LegacyCertEndpoint AzureLinuxV3_CloudInit_NBCPrecedence

    The legacy-endpoint scenarios set only the node location to usseceast, which selects the legacy certificate endpoint used by USSec and USNat. The VM, cluster, ARM and identity stay in public Azure, and no opt-in tag is requested.

  • Fixture: a boothook installs the hash-checked PR-built ANC and instruments the real init-aks-cloud.sh. A loopback proxy (e2e/cmd/cloud-repo-proxy), used as the RepoDepot endpoint, serves the public Ubuntu and Microsoft repositories.

    • The proxy does not modify vendor metadata, signatures or packages.
    • WireServer is not redirected, except in the network namespace used by the legacy refresh check below.
    • The scenarios run in public Azure, using the akscustom input contract to set a RepoDepot endpoint.
  • Checks:

    • init-cloud completed and wrote the empty marker.
    • Native scenarios never call the script; NBC scenarios call it exactly once, from the VHD binary.
    • RepoDepot traffic was observed.
    • On opted-in native VMs:
      • the installed certificates verify against the system trust bundle;
      • the scheduled refresh command points at the VHD binary;
      • running that command leaves repositories and the crontab unchanged.
    • On legacy-endpoint VMs:
      • initialization selects the legacy endpoint for usseceast and, like the shell, continues past the empty legacy package that public WireServer returns;
      • the scheduled refresh command points at the VHD binary, and running it leaves repositories and the crontab unchanged;
      • run again in a network namespace where WireServer's address is a local double, that command requests only the legacy endpoint and installs the double's generated root CA into the system trust bundle.

Shared E2E code changes are limited to two items:

  • A behavior-preserving refactor in vmss.go (if/else becomes a switch, and the Go build helper is extracted), plus a new case for this fixture.
  • An opt-in preflight in e2e_run.sh that runs only when REQUIRE_NATIVE_CLOUD_INTEGRATION=true.

Other scenarios and pipelines are unaffected.

Not covered here

  • The systemd refresh backend (Flatcar/ACL) and injected WireServer or RepoDepot failures are covered only by unit and component tests in feat(anc): initialize Azure cloud natively in init-cloud for AKSNodeConfig #10252. Legacy Mariner is not supported by the native path.
  • Azure Linux scenarios run on AMD64 only; the vendor repository publishes no ARM64 metadata.
  • Hotfix-aware replay of cloud initialization is not implemented yet; it will follow in a separate PR on this stack.

Sovereign and custom clouds

  • The scenarios run in a public region. They simulate a custom cloud with the akscustom input contract and a loopback RepoDepot proxy, and do not reproduce an air-gapped network.
  • Regions starting with ussec or usnat select the legacy certificate endpoint. The legacy-endpoint scenarios select it by location only, and check certificate installation against a WireServer double because public WireServer's legacy package is empty. Real sovereign certificates, VHDs and HTTPS RepoDepot endpoints are not covered.
  • Custom clouds that provision through NBC or traditional CSE keep the shell initialization; the NBC-precedence scenarios check this.
  • init-cloud runs the ANC on the VHD, so validation in a real custom cloud needs a released VHD that contains feat(anc): initialize Azure cloud natively in init-cloud for AKSNodeConfig #10252. That validation is required before the native path is enabled in those clouds.

Running it

  • The YAML does not create an ADO pipeline definition or a required check; the pipeline must be registered.
  • Run it on this branch with a subscription that has Microsoft.Compute/PlatformSettingsOverride registered and does not auto-inject the RCV1P opt-in tag.
  • Missing prerequisites fail the gate instead of skipping it.
  • See e2e/README.md, section "Native cloud-initialization integration gate".

Results

Ran locally on real VMs in westus3, because the pipeline is not registered yet. Both runs used #10252 at 9efe3bad02.

  • Passed: the opted-in and NBC-precedence scenarios on Ubuntu 22.04 and Azure Linux 3 (4/4).
  • Passed, in a second run: the two legacy-endpoint scenarios (2/2).
  • Not run yet: the two not-opted-in scenarios, because the subscription used auto-injects the RCV1P tag.
  • Not yet run on real VMs: later feat(anc): initialize Azure cloud natively in init-cloud for AKSNodeConfig #10252 commits, which remove legacy Mariner support, move process-group handling into OS-specific files so ANC still builds for Windows, make the shell fallback also remove the native refresh cron entry, and set PATH on both refresh cron entries so update-ca-certificates resolves on Ubuntu. Unit tests and ShellSpec cover them; the cron entry was also checked with a real cron daemon in an Ubuntu 22.04 container.

Which issue(s) this PR fixes:

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   21 suites   1m 16s ⏱️
817 tests 817 ✅ 0 💤 0 ❌
844 runs  844 ✅ 0 💤 0 ❌

Results for commit c6e2cf7.

♻️ This comment has been updated with latest results.

@abigailliang-aks-sig-node
Abigail Liang (abigailliang-aks-sig-node) force-pushed the abigailliang/anc-cloud-init-e2e-gate branch 4 times, most recently from 000cd2c to 0ac4eda Compare December 5, 2026 00:22
Standard E2E installs the PR-built ANC only as the provisioning hotfix,
so init-cloud still runs the ANC already on the VHD and does not exercise
native cloud initialization until a VHD is built from the change.

Add a manual gate (.pipelines/e2e-anc-cloud-init.yaml, tag
nativecloudinit=true) with six Ubuntu 22.04 and Azure Linux 3 scenarios:
native opted-in, native opted-out and NBC precedence. A boothook fixture
installs the PR-built ANC at both the VHD and hotfix paths, instruments
the real init-aks-cloud.sh, and serves the public vendor repositories
through a loopback proxy used as the RepoDepot endpoint.

Each scenario provisions through Node Ready and checks the empty handoff
marker, which initializer ran and from which binary, repository traffic,
and on opted-in native VMs, that the WireServer certificates verify
against the system trust bundle and that the refresh schedule runs the
VHD binary without changing repositories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27252e94-5b2b-4932-9585-70e98b9e21e4
Running the gate on real VMs failed on three test-side checks:

- WireServer can serve expired CA certificates, which legacy
  initialization also installs, so trust validation ignores validity
  periods.
- Successful provisioning deletes its inputs, so the NBC precedence
  scenario checks the ANC log entry recording that both were provided.
- The E2E egress firewall blocks https://archive.ubuntu.com and allows
  the Azure Ubuntu mirror only over HTTP, so the repository proxy
  forwards Ubuntu there. apt still verifies the signed metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27252e94-5b2b-4932-9585-70e98b9e21e4
Legacy Mariner is no longer supported by the native cloud initialization
path, so it is not pending VM coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27252e94-5b2b-4932-9585-70e98b9e21e4
Add Ubuntu 22.04 and Azure Linux 3 scenarios whose node configuration
reports a legacy location (usseceast) without the certificate opt-in, so
native initialization selects the legacy certificate endpoint. They check
that initialization continues past public WireServer's empty legacy
package, and run the scheduled refresh in a network namespace whose
WireServer double serves a generated root only from the legacy endpoint:
the refresh must never query the opt-in endpoint and must install the
root into the system trust bundle.

Also share the repository validator with these scenarios, make the
NBC-precedence unit-test fixture include the ANC log line its validator
requires, add a case where that line is missing, and document the eight
scenarios in the e2e README.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27252e94-5b2b-4932-9585-70e98b9e21e4
aks-node-controller now prefixes its refresh cron entry with a PATH that
includes the sbin directories, so update-ca-certificates resolves under
cron on Ubuntu.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27252e94-5b2b-4932-9585-70e98b9e21e4
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
parts_windows Package 1 74% ➖
staging_cse_windows Package 1 72% ➖
debug 0% ❌
provisioningscripts 2% ❌
Summary 40% (2077 / 7276) ❌

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 32% ❌
Summary 32% (5593 / 17355) ❌

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-live-patching/pkg/status 100% ✔
github.com/Azure/agentbaker/apiserver 52% ❌
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 35% ❌
github.com/Azure/agentbaker/pkg/agent 79% ➖
github.com/Azure/agentbaker/pkg/agent/datamodel 78% ➖
github.com/Azure/agentbaker/pkg/agent/toggles 0% ❌
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 87% ✔
github.com/Azure/agentbaker/aks-node-controller 75% ➖
github.com/Azure/agentbaker/aks-node-controller/common 100% ✔
github.com/Azure/agentbaker/aks-node-controller/config 66% ➖
github.com/Azure/agentbaker/aks-node-controller/generalize 80% ✔
github.com/Azure/agentbaker/aks-node-controller/helpers 68% ➖
github.com/Azure/agentbaker/aks-node-controller/internal/localdns 81% ✔
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 92% ✔
github.com/Azure/agentbaker/aks-node-controller/testutil/cloudfixture 80% ✔
github.com/Azure/agentbaker/aks-node-controller/utils 0% ❌
Summary 85% (7672 / 9918) ✔

This branch has not been deployed

No deployments
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.

1 participant