Repository navigation
[aks-preview] Add direct Agent Sandbox extension commands - #10517
Alima Azamat (alimaazamat) wants to merge 7 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Alima Azamat (@alimaazamat)! We will review the pull request and get back to you soon. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Hi Alima Azamat (@alimaazamat), |
There was a problem hiding this comment.
🟢 Approval recommended
The additive flags follow the existing decorator flow, preserve profile state, and include focused coverage with no identified blocking issues.
No open issues 🎉
What changed in this PR
Adds Agent Sandbox controls to aks-preview, using the existing managed-cluster create/update decorators and vendored SDK.
Changes:
- Adds preview flags to enable Agent Sandbox during cluster creation and enable or disable it during updates.
- Rejects conflicting flags and preserves existing profile fields and state when appropriate.
- Adds focused tests, command help, usage guidance, and Pending release notes.
| File | Description |
|---|---|
src/aks-preview/README.rst |
Documents usage, prerequisites, and service eligibility. |
src/aks-preview/HISTORY.rst |
Adds Pending release notes for the new flags. |
src/aks-preview/azext_aks_preview/tests/latest/test_agent_sandbox_profile.py |
Tests registration, forwarding, serialization, profile preservation, and decorator pipelines. |
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py |
Validates flags and applies the requested profile state. |
src/aks-preview/azext_aks_preview/custom.py |
Adds Agent Sandbox parameters to command handlers. |
src/aks-preview/azext_aks_preview/_params.py |
Registers the preview CLI flags. |
src/aks-preview/azext_aks_preview/_help.py |
Describes the flags, prerequisites, and mutual exclusion. |
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
FumingZhang
left a comment
There was a problem hiding this comment.
Could you split the shared k8s-extension delete-error fix, its tests, and version/history changes into a separate PR for review by the corresponding owners?
For this AKS review, please keep this PR focused on the aks-preview Agent Sandbox integration and its wrapper changes. If the AKS behavior depends on the separately published fix, please document that dependency explicitly.
By the way, the ADO style/linter failures in build 366323 occur before either checker runs: the generated-index guard detects a change that is not present in the PR's merge-base diff. The stale synthetic merge is being compared against an advanced main containing an automated index update.
Please sync the branch with the latest main and trigger a new build against the refreshed merge commit, rather than only retrying the old build's failed jobs. Please do not edit the generated index to work around this failure.
Once rerun, please confirm that both ADO tasks actually execute and pass. If the comparison issue recurs, it should be addressed separately by the CI owners.
| from azext_aks_preview._helpers import raise_validation_error_if_extension_type_not_in_allow_list | ||
|
|
||
|
|
||
| class AgentSandboxExtensionTestCase(unittest.TestCase): |
There was a problem hiding this comment.
These unit tests provide useful wrapper coverage, but the delegated extension implementation is mocked, so they do not exercise the actual command-to-service lifecycle.
Could you add or extend a scenario covering az aks extension create → show/list → configuration update → delete for Microsoft.AgentSandbox on an eligible cluster?
The existing-instance live update described in the PR is useful evidence, but fresh-create authorization and deletion remain unverified. Please provide a live run/log link with the tested SHA, CLI/extension versions, region, and relevant prerequisites. If service registration still blocks a path, please record it explicitly as blocked rather than validated.
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Split out fix: #10528 |
Expose managed profile enablement on create/update and disablement on update, preserving existing profiles when flags are omitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
Replace profile flags with the existing ClusterConfig extension wrapper, document configuration and ownership prerequisites, and propagate lifecycle errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
Keep deletion idempotent for missing extensions while surfacing authorization, throttling, and service failures. Cover the real delete delegate with lookup-failure regression tests and prepare the 1.9.5 dependency release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
Move k8s-extension code, regression tests, and release changes to a dedicated PR for module-owner review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
b38c120 to
18edde4
Compare
Exercise the actual direct extension client on an explicitly selected eligible cluster, including fresh create, show/list, replica update, delete, and cleanup. Fail service errors rather than substituting mock validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
Fresh lifecycle validation demonstrated that ClusterConfig rejects aks-managed names for direct customer creation. Use agent-sandbox in the scenario and command examples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
FumingZhang I don't know how I have been retrying the old build's failed jobs, are you talking about the "/azp run" triggering the builds? I haven't retried anything but if there is a new /azp run will it trigger the updated refreshed commit? |
You're right—pushes or an authorized CI is green, and the review feedback is addressed. LGTM from the AKS/aks-preview perspective. |
|
@Azure/act-observability-squad Can you PTAL, this is Ignite critical |
Keep feature notes under Pending for the December 1 release target. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e9999ee-7df3-4e69-9868-14375740b6b3
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
LGTM - just two small things before I approve and merge
|
🤖 PR Validation — ❌ Action needed
❌Azure CLI Extensions Breaking Change Test
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
1 added suppression
src/aks-preview/azext_aks_preview/tests/latest/test_agent_sandbox_extension_scenario.pyself.skipTest(Related commands
az aks extension create --extension-type Microsoft.AgentSandboxaz aks extension update/show/list/deleteaz aks extension typediscovery for Agent SandboxChanges
Replaces this PR's earlier managed-profile flags with direct extension installation through the existing
aks extensionwrapper. Addmicrosoft.agentsandboxto its allowlist; reuse the installedk8s-extensionimplementation and extension client withcluster_type="managedClusters".The request goes to
Microsoft.KubernetesConfiguration/extensions(ClusterConfig), then Extension Manager and Helm. Configuration settings, protected settings, and configuration-file arguments are forwarded by the existing wrapper. NoagentSandboxProfilewrites or profile enable/disable flags remain.Add create/update examples, lifecycle and configuration documentation, Pending release notes, focused delegation/discovery/error/argument-alias tests, and a live-only fresh-install lifecycle scenario. Re-raise logged create/update/delete/show/list failures so authorization or installation failures do not appear successful; this error-propagation correction also applies to existing supported extension types.
Fresh-create testing exposed a reserved-name restriction: names containing
aks-managedare restricted to authorized service clients. The direct-install examples and tests now use the customer-managed nameagent-sandbox.Prerequisites and ownership
k8s-extensionCLI dependency.k8s-extensionversion/history changes have moved to #10528 - [k8s-extension] Propagate non-404 delete lookup failures. This PR changes onlyaks-preview.k8s-extension1.8.0. Correct error propagation when deletion's initial lookup fails with a non-404 error requires the corrected package to be separately published and installed (1.9.5proposed in [k8s-extension] Propagate non-404 delete lookup failures #10528). Updatingaks-previewalone does not update the dependency; no minimum-version gate is added here.Microsoft.ContainerService/AgentSandboxPreviewAFEC validation. Direct-install eligibility remains a service registration concern.agentSandboxProfile. Disabling the profile requests deletion, not an ownership handoff; existing installations need a separately coordinated migration.--configor--config-file/--config-settings-file. Kata node pools and PSR are not provisioned by this wrapper.Validation
Live lifecycle run - October 27, 2026
Passed: fresh create -> show/list -> configuration update -> delete, using the actual installed delegated implementation and Azure service, not mocks.
westcentralus; fresh, dedicated development AKS cluster; Kubernetes 1.36; one Standard_D4s_v6 node; managed identity and OIDC enabled.az aks extension create --extension-type Microsoft.AgentSandbox --config replicaCount=1SucceededshowandlistreplicaCount=1update --config replicaCount=2 --yes, thenshowSucceeded; configuration persisted as2delete --yes, thenlistagentSandboxProfileandpodSnapshotProfileremained nullagent-sandbox-systemSanitized runner log excerpt (local live execution, not an ADO pipeline run; machine paths and unrelated Python deprecation warnings omitted):
The registered cleanup repeats deletion after the scenario's explicit delete/list assertion, exercising idempotent deletion of an already-absent instance. Its "nothing to delete" warning is expected; it is not the evidence for successful primary deletion.
The first attempt, using
aks-managed-agent-sandbox, was blocked, not validated:The corrected customer-managed name passed the full lifecycle above. This validates installation/configuration/removal, not Sandbox workload execution, snapshot/restore E2E, protected-settings updates, upgrades, or long-term configuration durability.
Local checks for the lifecycle changes
azdev style aks-previewand repo-awareazdev linter aks-preview --min-severity mediumpassed.Branch synchronization and CI
main; no generated-index edits.Earlier direct-update validation - October 26, 2026
westcentralususing--config replicaCount=1 --yes.Succeeded; configuration persisted in the resource and Helm values; Helm revision advanced from 4 to 5.General guidelines
azdev style aks-preview.aks-previewversion retained with Pending release notes. Shared dependency release changes are isolated in [k8s-extension] Propagate non-404 delete lookup failures #10528.