You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: initialize Azure clouds natively in ANC - #9891
Only [5/5] switches the native provisioning path. The current English
migration and dependency diagrams are in #9910. The earlier certificate
PR #9902 has also been superseded by this finer-grained split.
This aggregate remains closed. Its original branch, commits, discussion,
and implementation description are retained for historical comparison.
What this PR does / why we need it:
Replace shell-based Azure cloud initialization in ANC's native configuration path
with Go initialization that runs before the existing provisioning scripts:
This ports the initialization responsibilities; it does not relocate the .sh
file into ANC or rewrite the remaining provisioning scripts.
Fetch and install Azure cloud CA certificates through the legacy ussec/usnat
endpoints or the RCV1P opt-in/root/intermediate endpoints.
Register daily certificate refresh using the running ANC binary, including
hotfix binaries, through refresh-cloud-certificates --location <region>.
Preserve unrelated cron entries and use systemd on Flatcar/ACL.
Configure RepoDepot for Ubuntu, Mariner, and Azure Linux before provisioning.
Certificate opt-out does not skip RepoDepot; immutable images do not configure
package repositories.
Only --provision-config without --nbc-cmd uses native cloud initialization.
Traditional CSE, NBC/Phase 2, and Phase 2.5 retain their existing shell behavior
and NBC precedence. The shell artifact, VHD mappings, and root AgentBaker
CustomData delivery remain unchanged for compatibility with those paths and
older VHD binaries. This PR does not remove the physical shell artifact or
reduce the current root CustomData payload.
Certificate behavior compatibility
A nonempty malformed opt-in response, a missing field, or any value other than
the JSON boolean true skips certificate installation and still permits
RepoDepot initialization. Failed requests and empty opt-in responses remain
fatal, as in the shell.
Downloaded certificate contents are cached and passed to the trust-store tools
with the shell's newline handling, without additional PEM/X.509 validation or
filtering. Public-certificate parsing is diagnostic-only and does not gate
installation.
An individual operation-certificate download failure or empty certificate
response is logged and skipped while processing continues. Missing operation
lists and RCV1P installation with no remaining .crt files still fail.
Legacy certificate retrieval failures remain fatal. Legacy trust-store
installation failures are logged without blocking later initialization.
Refresh clears the certificate staging cache, not existing system trust-store
certificates. Raw responses are never logged; AKS_CLOUD_LOG_CERTIFICATES=true
logs re-encoded public certificates only.
Best-effort cron and cache failure handling
These two failure cases now retain the shell's best-effort behavior:
Failure to read an existing crontab treats it as empty and still attempts
installation. Unexpected read errors and cron installation failures are
logged without blocking later repository initialization or provisioning.
RepoDepot cache refresh retries up to ten times. Exhaustion still returns a
classified cache-operation error and emits an error-level repository event;
the provisioning boundary logs the failure and continues instead of blocking
the provisioning scripts.
Regression tests exercise actual native provisioning entry points and require
exit code 0 after the cron failures and exhausted Ubuntu/Mariner/Azure Linux
cache refreshes. Repository failure events remain observable even when overall
initialization succeeds.
Preserved native boundaries and operational bounds
Nonfatal handling is limited to these ordinary cron/cache failures. Overall
context cancellation or timeout, repository setup errors, invalid refresh
configuration, and systemd refresh errors still stop native initialization.
Existing certificate failure handling is unchanged by this correction.
This is not a claim of complete shell equivalence outside the cases above.
Refresh scheduling requires a nonempty region, and Ubuntu Microsoft sources use
the node's architecture. Initialization uses the configured CSE_TIMEOUT budget,
with 30-second HTTP requests and two-minute command limits. Periodic certificate
refresh has a 15-minute budget and does not reconfigure repositories or reinstall
schedules.
Validation
From aks-node-controller:
go test -race . ./parser -count=1
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0 run --new-from-rev=origin/main --timeout=5m . ./parser
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /dev/null .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /dev/null .
Lint uses the CI-pinned golangci-lint v2.14.0. Native command fixtures were
regenerated for the initial template change. Also checked the native shell
template with bash -n and the diff with git diff --check.
Azure/VHD end-to-end provisioning has not been run.
Run native cloud certificate and RepoDepot initialization before the existing provisioning scripts for --provision-config. Add native periodic certificate refresh while retaining shell initialization for traditional CSE, NBC, and older VHDs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be499bac-1283-498e-b5b1-59d8c91047a4
Moves Azure cloud initialization into Go for ANC’s native --provision-config path, before existing provisioning scripts run. NBC and traditional CSE retain shell initialization.
Changes:
Adds certificate retrieval, validation, trust-store installation, and daily refresh scheduling.
Preserve the certificate compatibility fixes already present in the PR. Extract the operation-download test server helper, remove shadowing and slice-append warnings, and normalize empty-response errors without changing their return paths.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: be499bac-1283-498e-b5b1-59d8c91047a4
Avoid rejecting usable APT repositories on directory 403
aks-node-controller/cloud_repositories.go:121
🟡 Medium Risk — 🔄 Backward Compatibility: A usable Ubuntu repository can return 403 for its directory URL while serving APT metadata and packages, but this probe now makes native provisioning fail with exit code 240. The shell's check_url did not reject that response; remove the directory probe and rely on the existing package-manager refresh to check repository access. Add a regression case where the base URI returns 403 but metadata is available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Replace shell-based Azure cloud initialization in ANC's native configuration path
with Go initialization that runs before the existing provisioning scripts:
This ports the initialization responsibilities; it does not relocate the
.shfile into ANC or rewrite the remaining provisioning scripts.
ussec/usnatendpoints or the RCV1P opt-in/root/intermediate endpoints.
hotfix binaries, through
refresh-cloud-certificates --location <region>.Preserve unrelated cron entries and use systemd on Flatcar/ACL.
Certificate opt-out does not skip RepoDepot; immutable images do not configure
package repositories.
regression coverage, and updated native command fixtures/documentation.
Scope and compatibility
Only
--provision-configwithout--nbc-cmduses native cloud initialization.Traditional CSE, NBC/Phase 2, and Phase 2.5 retain their existing shell behavior
and NBC precedence. The shell artifact, VHD mappings, and root AgentBaker
CustomData delivery remain unchanged for compatibility with those paths and
older VHD binaries. This PR does not remove the physical shell artifact or
reduce the current root CustomData payload.
Certificate behavior compatibility
the JSON boolean
trueskips certificate installation and still permitsRepoDepot initialization. Failed requests and empty opt-in responses remain
fatal, as in the shell.
with the shell's newline handling, without additional PEM/X.509 validation or
filtering. Public-certificate parsing is diagnostic-only and does not gate
installation.
response is logged and skipped while processing continues. Missing operation
lists and RCV1P installation with no remaining
.crtfiles still fail.installation failures are logged without blocking later initialization.
Refresh clears the certificate staging cache, not existing system trust-store
certificates. Raw responses are never logged;
AKS_CLOUD_LOG_CERTIFICATES=truelogs re-encoded public certificates only.
Best-effort cron and cache failure handling
These two failure cases now retain the shell's best-effort behavior:
installation. Unexpected read errors and cron installation failures are
logged without blocking later repository initialization or provisioning.
classified cache-operation error and emits an error-level repository event;
the provisioning boundary logs the failure and continues instead of blocking
the provisioning scripts.
Regression tests exercise actual native provisioning entry points and require
exit code
0after the cron failures and exhausted Ubuntu/Mariner/Azure Linuxcache refreshes. Repository failure events remain observable even when overall
initialization succeeds.
Preserved native boundaries and operational bounds
Nonfatal handling is limited to these ordinary cron/cache failures. Overall
context cancellation or timeout, repository setup errors, invalid refresh
configuration, and systemd refresh errors still stop native initialization.
Existing certificate failure handling is unchanged by this correction.
This is not a claim of complete shell equivalence outside the cases above.
Refresh scheduling requires a nonempty region, and Ubuntu Microsoft sources use
the node's architecture. Initialization uses the configured
CSE_TIMEOUTbudget,with 30-second HTTP requests and two-minute command limits. Periodic certificate
refresh has a 15-minute budget and does not reconfigure repositories or reinstall
schedules.
Validation
From
aks-node-controller:Lint uses the CI-pinned golangci-lint
v2.14.0. Native command fixtures wereregenerated for the initial template change. Also checked the native shell
template with
bash -nand the diff withgit diff --check.Azure/VHD end-to-end provisioning has not been run.
Which issue(s) this PR fixes:
No linked issue.