Repository navigation
Make AKS node pool OS SKU configurable - #21118
Conversation
Add shared DTO callback options for system and user node pools, preserve legacy C# overloads, and persist OS SKU in generated Bicep. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97
Co-authored-by: Copilot App <[email protected]> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97
Retain only shared DTO wire naming and writeback fixes required by node-pool callbacks. Regenerate snapshots, migrate affected Python fixtures, and cover integral DTO writeback without importing terminal APIs or tests. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97
ef77903 to
6242ce4
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21118Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21118" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Shared cross-language transport changes warrant human review, with full polyglot and live Azure deployment validation still outstanding.
No open issues 🎉
What changed in this PR
Enables AKS node-pool OS SKU selection through the AppHost model, addressing #18284 without changing default SKUs or removing existing C# overloads.
Changes:
- Adds validated node-pool configuration callbacks and persists OS SKU choices in generated Bicep.
- Aligns cross-language DTO wire names and fixes Python callback writeback and integral-number conversion.
- Updates documentation, fixtures, snapshots, and deployment verification.
| File | Description |
|---|---|
| tests/PolyglotAppHosts/Aspire.Hosting/TypeScript/apphost.mts | Configures AzureLinux through callbacks. |
| tests/PolyglotAppHosts/Aspire.Hosting/Python/apphost.py | Uses callbacks and camel-case DTO keys. |
| tests/PolyglotAppHosts/Aspire.Hosting/Java/AppHost.java | Configures AzureLinux through callbacks. |
| tests/PolyglotAppHosts/Aspire.Hosting.Go/Python/apphost.py | Aligns Delve option keys. |
| tests/PolyglotAppHosts/Aspire.Hosting.Foundry/Python/apphost.py | Aligns model DTO keys. |
| tests/PolyglotAppHosts/Aspire.Hosting.Dotnet/Python/apphost.py | Aligns launch-profile option keys. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.Network/Python/apphost.py | Aligns access-rule DTO keys. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.AppService/Python/apphost.py | Aligns site-configuration keys. |
| tests/PolyglotAppHosts/Aspire.Hosting.Azure.AppContainers/Python/apphost.py | Aligns scale-option keys. |
| tests/Aspire.Hosting.RemoteHost.Tests/AtsMarshallerTests.cs | Tests integral conversion and rejection. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/AtsTypeScriptCodeGeneratorTests.Generate_AksNodePools_ExposeConfigurationCallbacks.verified.txt | Captures callback API signatures. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/AtsTypeScriptCodeGeneratorTests.cs | Verifies generated AKS callbacks. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj | References AKS integration for tests. |
| tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/AtsGeneratedAspire.verified.rs | Updates wire names and aliases. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py | Updates combined generated Python output. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/AtsGeneratedAspire.verified.py | Updates Python DTO and runtime output. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/AtsPythonCodeGeneratorTests.cs | Tests generated callback writeback. |
| tests/Aspire.Hosting.CodeGeneration.Python.Tests/Aspire.Hosting.CodeGeneration.Python.Tests.csproj | References AKS integration for tests. |
| tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/AtsGeneratedAspire.verified.java | Updates Java DTO wire names. |
| tests/Aspire.Hosting.CodeGeneration.Java.Tests/AtsJavaCodeGeneratorTests.cs | Aligns transport and callback assertions. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go | Updates combined generated Go output. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/AtsGeneratedAspire.verified.go | Updates Go DTO wire names. |
| tests/Aspire.Hosting.CodeGeneration.Go.Tests/AtsGoCodeGeneratorTests.cs | Aligns builder-option assertions. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/Snapshots/AzureKubernetesEnvironmentExtensionsTests.NodePoolCallbacks_BicepReflectsOsSku_systemOsSku=null_workerOsSku=null.verified.bicep | Verifies unspecified SKUs remain omitted. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/Snapshots/AzureKubernetesEnvironmentExtensionsTests.NodePoolCallbacks_BicepReflectsOsSku_systemOsSku=null_workerOsSku=FutureLinuxSku.verified.bicep | Verifies custom SKU emission. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/Snapshots/AzureKubernetesEnvironmentExtensionsTests.NodePoolCallbacks_BicepReflectsOsSku_systemOsSku=AzureLinux_workerOsSku=Ubuntu.verified.bicep | Verifies independent pool SKUs. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/Snapshots/AzureKubernetesEnvironmentExtensionsTests.NodePoolCallbacks_BicepReflectsOsSku_systemOsSku=AzureLinux_workerOsSku=AzureLinux.verified.bicep | Verifies AzureLinux on both pools. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesInfrastructureTests.cs | Checks automatic pool defaults. |
| tests/Aspire.Hosting.Azure.Kubernetes.Tests/AzureKubernetesEnvironmentExtensionsTests.cs | Tests validation, copying, replacement, and Bicep. |
| tests/Aspire.Deployment.EndToEnd.Tests/AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs | Checks deployed SKUs before and after redeployment. |
| src/Aspire.Hosting.RemoteHost/Ats/AtsMarshaller.cs | Converts integral numeric DTO writeback. |
| src/Aspire.Hosting.CodeGeneration.Rust/AtsRustCodeGenerator.cs | Emits camel-case serialization with aliases. |
| src/Aspire.Hosting.CodeGeneration.Python/PythonModuleBuilder.cs | Supports DTO writeback and updated keys. |
| src/Aspire.Hosting.CodeGeneration.Python/AtsPythonCodeGenerator.cs | Generates callback registration and wire keys. |
| src/Aspire.Hosting.CodeGeneration.Java/AtsJavaCodeGenerator.cs | Aligns DTO serialization wire names. |
| src/Aspire.Hosting.CodeGeneration.Go/AtsGoCodeGenerator.cs | Aligns DTO serialization wire names. |
| src/Aspire.Hosting.Azure.Kubernetes/README.md | Documents configuration and migration. |
| src/Aspire.Hosting.Azure.Kubernetes/AzureKubernetesEnvironmentExtensions.cs | Adds callbacks, validation, and SKU emission. |
| src/Aspire.Hosting.Azure.Kubernetes/AksNodePoolOptions.cs | Defines shared callback options. |
| src/Aspire.Hosting.Azure.Kubernetes/AksNodePoolConfig.cs | Stores the optional OS SKU. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Eric Erhardt (eerhardt)
left a comment
There was a problem hiding this comment.
Just a few questions.
Use AksNodePoolConfig directly for configuration callbacks and validate final values when generating Bicep. Remove the duplicate options type and cover extension composition and regeneration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97
This comment has been minimized.
This comment has been minimized.
Make Name and Mode getter-only while retaining mutable pool configuration. Cover system and user pool callback writeback with the real AKS DTO. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fc18aa8d-5ea4-469a-a828-e930f7192b97
Tests selector11 / 99 PR test projects · 4 PR jobs, from 43 changed files. Selected PR test projects (11 / 99)
Selected PR jobs (4)
How these were chosen — grouped by what changed🔧 🔧 🔧 📦 affected project 🔧 🔧 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Document the new configuration-callback overloads for WithSystemNodePool and AddNodePool, including the OsSku property, and call out the TypeScript/Java/Python breaking change requiring callbacks instead of scalar-options overloads. Documents changes from microsoft/aspire#21118 Co-authored-by: Copilot <[email protected]>
|
Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Review the workflow run logs for details. Pull request created: #1915
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1915 targeting Updated the AKS integration reference ( Note This draft PR needs human review before merging. |
Document the new configuration-callback overloads for WithSystemNodePool and AddNodePool, including the OsSku property, and call out the TypeScript/Java/Python breaking change requiring callbacks instead of scalar-options overloads. Documents changes from microsoft/aspire#21118 Co-authored-by: Copilot <[email protected]>
Document the new configuration-callback overloads for WithSystemNodePool and AddNodePool, including the OsSku property, and call out the TypeScript/Java/Python breaking change requiring callbacks instead of scalar-options overloads. Documents changes from microsoft/aspire#21118 Co-authored-by: Copilot <[email protected]>
…dance (#2042) ## Summary <!-- Describe what this pull request changes and why. --> Consolidate the AKS-specific documentation for Aspire 17.0 into this PR, targeting `release/17.0`. - Document existing AKS clusters, scoping, identity/network prerequisites, private-cluster connectivity, and cleanup behavior: [microsoft/aspire#20921](microsoft/aspire#20921). - Document existing registries, cross-resource-group and cross-subscription references, kubelet `AcrPull`, separate cluster identities, and migration precautions: [microsoft/aspire#20919](microsoft/aspire#20919). - Explain the Standard control-plane tier default, billing and upgrade implications, and working C# and TypeScript Free-tier overrides: [microsoft/aspire#20917](microsoft/aspire#20917). - Document node pool OS SKUs, callback configuration, defaults, and migration risks; correct stale TypeScript calls on both AKS pages: [microsoft/aspire#21118](microsoft/aspire#21118). Supersedes docs PRs #1900 (registry and identities), #1872 (Standard tier), and #1915 (node pool OS SKU). Their relevant content and review feedback are incorporated here. Generic Kubernetes PRs #1935 and #1963 are intentionally excluded and unchanged. The integration reference contains the detailed configuration examples. The deployment guide explains the defaults and upgrade considerations and links to those examples instead of duplicating them. Existing-resource references are explicitly distinguished from reprovisioning an Aspire-managed cluster. ## Third-party links and affiliations <!-- List any third-party links added or changed by this pull request and disclose any material affiliation with the linked organizations, such as employment, sponsorship, or ownership. Write "None" if this pull request doesn't add or change third-party links. --> None. Added external guidance links are first-party Microsoft Learn AKS documentation: pricing tiers, IMDS restrictions, control-plane role assignments, pre-created kubelet identities, and OS SKU migration. ## Validation <!-- List the checks you ran or explain why validation isn't needed. --> - `git diff --check` — passed. - `pnpm --dir src/frontend exec vitest run --config vitest.config.ts tests/unit/twoslash-blocks.vitest.test.ts tests/unit/api-reference.vitest.test.ts tests/unit/seo-lengths.vitest.test.ts tests/unit/apphost-examples.vitest.test.ts` — passed, 66 tests across 4 files. - `npx tsc --project tsconfig.apphost.json --noEmit` — passed in a temporary Aspire 17.0 TypeScript AppHost for both the new-cluster and existing-cluster examples. - `aspire publish --apphost apphost.mts --output-path ./artifacts --non-interactive` — passed in the temporary TypeScript AppHost. Asserted generated Free tier, AzureLinux and Ubuntu OS SKUs, separate user-assigned identities, registry subscription scope, and removal of the default ACR module. - `env 'Parameters__cluster-name=docs-cluster' 'Parameters__cluster-resource-group=docs-cluster-rg' 'Parameters__cluster-subscription=00000000-0000-0000-0000-000000000002' aspire publish --apphost apphost.mts --output-path ./existing-artifacts --non-interactive` — passed. Asserted an existing-cluster reference, no cluster tier/node-pool mutations or replacement identities, and a separate kubelet registry role module. - `aspire publish --apphost apphost.cs --output-path ./artifacts --non-interactive` — passed in a temporary Aspire 17.0 C# AppHost. Asserted the Free-tier and OS SKU outputs. - `aspire start --non-interactive --isolated --apphost src/apphost/Aspire.Dev.AppHost/Aspire.Dev.AppHost.csproj --format Json` and `aspire wait frontend --apphost src/apphost/Aspire.Dev.AppHost/Aspire.Dev.AppHost.csproj --non-interactive` — passed. The isolated preview remains running for live-site review. - Playwright browser checks — both impacted pages render without an Astro error overlay; C#/TypeScript tabs show the new examples; the deployment guide's tier link resolves to the integration section; internal documentation targets exist; all five added Microsoft Learn guidance URLs return HTTP 200. - `pnpm --dir src/frontend exec prettier --check src/content/docs/integrations/cloud/azure/aks/index.mdx src/content/docs/deployment/kubernetes/aks.mdx` — reports formatting differences already present in both base files. Avoided unrelated reformatting, including formatter changes to existing code fences and indentation. Source behavior was checked against `microsoft/aspire` `release/17.0` at `ada71fb1409066a7082f3a80d20a7d848cab15d8`; smoke tests used the installed Aspire 17.0 SDK and generated TypeScript modules. No Azure resources were provisioned or destroyed, no local production site build was run, and no PR was merged. Cloud deployment and in-place cluster migration remain untested. User review of the live preview is the next step.

Description
Allow AppHosts to select an AKS node pool OS SKU, such as
AzureLinux, without editing generated Bicep that deployment later regenerates.Use a single
AksNodePoolConfigtype forWithSystemNodePoolandAddNodePoolcallbacks and the stored app model. VM size, autoscaling counts, and OS SKU remain mutable so extensions can compose changes through the retained configuration orworkers.Resource.Config. Validate final values when applying them to Bicep agent pool profiles, rather than copying or freezing configuration after the callback. Subsequent mutations do not change artifacts already generated; regenerating uses the current model values.OsSkuis part of the configuration constructor alongside the other pool properties.An unset SKU remains omitted from Bicep, preserving existing AKS defaults. Existing parameter-based C# overloads remain supported. Configuration callbacks use
[AspireDto]writeback, so polyglot consumers configure local data instead of invoking remote property setters. Include the shared DTO wire-name, Python callback writeback, and integral-number conversion fixes these callbacks require. Regenerate affected snapshots and align existing Python DTO fixtures with the camel-case wire names.This PR targets
maindirectly and has no terminal-feature dependency. Terminal APIs, documentation, tests, and generated terminal method signatures are unchanged.The TypeScript AKS deployment scenario now selects
AzureLinuxfor both system and workload pools and verifies their deployed OS SKUs after initial deployment and redeployment.User-facing usage
C# AppHost:
TypeScript AppHost:
Breaking changes
Polyglot node-pool configuration in this preview integration now uses callbacks instead of scalar options objects or keyword arguments. For example, replace
aks.addNodePool("workers", { minCount: 0 })withaks.addNodePool("workers", async pool => { pool.minCount = 0; }). Java and Python consumers likewise pass a configuration callback. Existing parameter-based C# calls and default behavior are unchanged. The previewAksNodePoolConfigpositional constructor gainsOsSku, and its VM size, counts, and OS SKU properties are mutable.Python DTO dictionary keys now consistently use camel case to match the host's JSON payloads, for example
pool["osSku"]. Go, Java, and Rust DTO serialization likewise uses those wire names.Validation
The latest mutable-configuration change reran AKS, TypeScript codegen, Python codegen, and the deployment project build. AKS coverage includes retained-reference composition, correcting temporarily invalid configuration before generation, rejecting invalid final values, and mutations between Bicep generations. Regenerated and reviewed the affected snapshots. The other codegen and RemoteHost suites below passed earlier for the unchanged shared DTO fixes.
dotnet test --project tests/Aspire.Hosting.Azure.Kubernetes.Tests/Aspire.Hosting.Azure.Kubernetes.Tests.csproj --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 152 tests.dotnet test --project tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.csproj --no-launch-profile -- --filter-class '*.AtsTypeScriptCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 136 tests.dotnet test --project tests/Aspire.Hosting.CodeGeneration.Python.Tests/Aspire.Hosting.CodeGeneration.Python.Tests.csproj --no-launch-profile -- --filter-class '*.AtsPythonCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 29 tests, including generated AKS DTO callback writeback. Used Python 3.14 onPATH.dotnet test --project tests/Aspire.Hosting.CodeGeneration.Java.Tests/Aspire.Hosting.CodeGeneration.Java.Tests.csproj --no-launch-profile -- --filter-class '*.AtsJavaCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 60 tests. Used a temporary JDK 21.dotnet test --project tests/Aspire.Hosting.CodeGeneration.Go.Tests/Aspire.Hosting.CodeGeneration.Go.Tests.csproj --no-launch-profile -- --filter-class '*.AtsGoCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 33 tests.dotnet test --project tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Aspire.Hosting.CodeGeneration.Rust.Tests.csproj --no-launch-profile -- --filter-class '*.AtsRustCodeGeneratorTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 20 tests.dotnet test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --no-launch-profile -- --filter-class '*.AtsMarshallerTests' --filter-class '*.CallbackProxyTests' --filter-class '*.CapabilityDispatcherTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed: 274 tests, including integral DTO writeback and invalid-number rejection.dotnet build tests/Aspire.Deployment.EndToEnd.Tests/Aspire.Deployment.EndToEnd.Tests.csproj --no-restore --verbosity quiet /p:SkipNativeBuild=true— passed, zero warnings or errors.git diff --check— passed.Fixes #18284
Checklist
<remarks />and<code />elements on your triple slash comments?