Skip to content

Conversation

@mainred
Copy link
Member

@mainred mainred commented Dec 1, 2025


This checklist is used to make sure that common guidelines for a pull request are followed.

Architecture:
image

And the demo:

containerized AKS agent - asciinema.org

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 1, 2025

❌Azure CLI Extensions Breaking Change Test
❌aks-agent
rule cmd_name rule_message suggest_message
1007 - ParaRemove aks agent cmd aks agent removed parameter api_key please add back parameter api_key for cmd aks agent
1007 - ParaRemove aks agent cmd aks agent removed parameter config_file please add back parameter config_file for cmd aks agent
1007 - ParaRemove aks agent cmd aks agent removed parameter use_aks_mcp please add back parameter use_aks_mcp for cmd aks agent
1008 - ParaPropAdd aks agent cmd aks agent update parameter name: added property required=True please remove property required=True for parameter name of cmd aks agent
1008 - ParaPropAdd aks agent cmd aks agent update parameter resource_group_name: added property required=True please remove property required=True for parameter resource_group_name of cmd aks agent
1006 - ParaAdd aks agent-init cmd aks agent-init added parameter cluster_name please remove parameter cluster_name for cmd aks agent-init
1006 - ParaAdd aks agent-init cmd aks agent-init added parameter resource_group_name please remove parameter resource_group_name for cmd aks agent-init
⚠️ 1010 - ParaPropUpdate aks agent cmd aks agent update parameter name: updated property name from name to cluster_name
⚠️ 1001 - CmdAdd aks agent-cleanup cmd aks agent-cleanup added

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 1, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

@mainred mainred force-pushed the containerized-aks-agent branch 3 times, most recently from 7463aa5 to 6a1187e Compare December 6, 2025 17:38
@mainred mainred force-pushed the containerized-aks-agent branch from 6a1187e to de30ba8 Compare December 7, 2025 12:32
@mainred mainred marked this pull request as ready for review December 7, 2025 15:28
Copilot AI review requested due to automatic review settings December 7, 2025 15:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes test evaluation fixtures and mock data for the aks-agent extension, which are being deleted as part of containerizing the aks-agent functionality. The changes primarily involve the deletion of test case fixtures, mock responses, Kubernetes manifests, and supporting test infrastructure.

Key Changes

  • Removal of 50+ test case directories containing evaluation fixtures for various AKS agent scenarios
  • Deletion of mock responses, test manifests, and supporting scripts used for testing
  • Elimination of test infrastructure including shell scripts for test orchestration

Reviewed changes

Copilot reviewed 295 out of 464 changed files in this pull request and generated no comments.

File Description
Multiple test fixture directories (59, 58, 57, etc.) Removed complete test case directories including YAML configs, manifests, and mock data
Various .txt mock files Deleted mock kubectl command outputs and tool responses
Python log generation scripts Removed test helper scripts for generating synthetic log data
Shell scripts Deleted test orchestration and validation scripts


logger = get_logger(__name__)

# NOTE(mainred): we can use get_default_cli().invoke() to trigger `az aks get-credentials` to fetch the kubeconfig,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every time we run the agent, we'll get the credential locally, to avoid redundant warning log from get_default_cli().invoke(), I switched to aks sdk instead. It makes sense in two parts.

  1. we dont have much code change but get-credential part, vendored sdk maintenance should not be a problem, as its dependency are mainly from system library. These code wont be touched normally.
  2. as a AKS extension, vendorring AKS sdk might not be a burden, in our command we requires the AKS cluster name and resource group

)
console = get_console()

console.print(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the UI consistent in all aks-agent, we use prompkit console to the interactive input.

help="Show AKS agent configuration and status information.",
)

with self.argument_context("aks agent-init") as c:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides az aks agent-init, we also introduced az aks agent-cleanup to make sure az aks agent accepts a prompt from the user to do the investigation instead of using flags like --cleanup to miss the az aks agent up.

@mainred mainred force-pushed the containerized-aks-agent branch from 001dd68 to 889b7a8 Compare December 8, 2025 05:21
@mainred mainred force-pushed the containerized-aks-agent branch from 889b7a8 to c12deac Compare December 8, 2025 06:11
zhoxing-ms
zhoxing-ms previously approved these changes Dec 8, 2025
Copy link
Member

@gossion gossion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mainred
Copy link
Member Author

mainred commented Dec 9, 2025

This PR introduces breaking changes to aks-agent as planned.

These breaking changes remove the holmesgpt dependency, in which a lot of third-party packages are imported, leading the installation slowness, and dynamic python package issues caused by version mismatch. Int this change, we removed the holmesgpt dependency.
Also, the tools before this change are maintained locally on the user local env, whose functionality cannot be promised. This change provides containerized aks-agent, which manages the tools in the pod.
Finally, the old design does not leverage RBAC or workload identity to control the access to the AKS cluster, and use whatever the cluster's local identity to the cluster, which brings security concern.

We have few customers using the extensions as announced the extension in less than on month, and breaking change must be taken regarding to the above considerations.

@zhoxing-ms zhoxing-ms merged commit d08119a into Azure:main Dec 9, 2025
24 checks passed
@azclibot
Copy link
Collaborator

azclibot commented Dec 9, 2025

[Release] Update index.json for extension [ aks-agent-1.0.0b12 ] : https://dev.azure.com/msazure/One/_build/results?buildId=146028638&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants