|
5 | 5 | # -------------------------------------------------------------------------------------------- |
6 | 6 |
|
7 | 7 | # pylint: disable=too-many-lines |
8 | | - |
9 | 8 | from knack.help_files import helps |
10 | 9 |
|
11 | 10 | helps[ |
12 | 11 | "aks agent" |
13 | 12 | ] = """ |
14 | 13 | type: command |
15 | | - short-summary: Run AI assistant to analyze and troubleshoot Kubernetes clusters. |
| 14 | + short-summary: Run AI assistant to analyze and troubleshoot Azure Kubernetes Service (AKS) clusters. |
16 | 15 | long-summary: |- |
17 | 16 | This command allows you to ask questions about your Azure Kubernetes cluster and get answers using AI models. |
18 | | - No need to manually set environment variables! All model and credential information can be configured interactively using `az aks agent-init` or via a config file. |
19 | 17 | parameters: |
20 | 18 | - name: --name -n |
21 | 19 | type: string |
|
33 | 31 | Each provider may require different environment variables and model naming conventions. |
34 | 32 | For a full list of supported providers, model patterns, and required environment variables, see https://docs.litellm.ai/docs/providers. |
35 | 33 | Note: For Azure OpenAI, it is recommended to set the deployment name as the model name until https://github.com/BerriAI/litellm/issues/13950 is resolved. |
36 | | - - name: --api-key |
37 | | - type: string |
38 | | - short-summary: API key to use for the LLM (if not given, uses environment variables AZURE_API_KEY, OPENAI_API_KEY). (Deprecated) |
39 | | - - name: --config-file |
40 | | - type: string |
41 | | - short-summary: Path to configuration file. |
42 | 34 | - name: --max-steps |
43 | 35 | type: int |
44 | 36 | short-summary: Maximum number of steps the LLM can take to investigate the issue. |
|
56 | 48 | short-summary: Refresh the toolsets status. |
57 | 49 | - name: --status |
58 | 50 | type: bool |
59 | | - short-summary: Show AKS agent configuration and status information. |
60 | | - - name: --aks-mcp |
61 | | - type: bool |
62 | | - short-summary: Enable AKS MCP integration for enhanced capabilities. Traditional mode is the default. |
63 | | -
|
| 51 | + short-summary: Show AKS agent deployment status including helm release, deployments, and pod information. |
64 | 52 | examples: |
| 53 | + - name: Ask about pod issues in the cluster with OpenAI |
| 54 | + text: |- |
| 55 | + az aks agent "Why are my pods not starting?" --model gpt-4o --resource-group myResourceGroup --name myAKSCluster |
65 | 56 | - name: Ask about pod issues in the cluster with last configured model |
66 | 57 | text: |- |
67 | | - az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup |
68 | | - - name: Ask about pod issues in the cluster with Azure OpenAI |
| 58 | + az aks agent "Why are my pods not starting?" --resource-group myResourceGroup --name myAKSCluster |
| 59 | + - name: Check AKS agent deployment status |
69 | 60 | text: |- |
70 | | - az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup --model azure/gpt-4.1 |
71 | | - - name: Ask about pod issues in the cluster with OpenAI |
| 61 | + az aks agent --status --resource-group myResourceGroup --name myAKSCluster |
| 62 | + - name: Ask about pod issues in the cluster with Azure OpenAI |
72 | 63 | text: |- |
73 | | - az aks agent "Why are my pods not starting?" --name MyManagedCluster --resource-group MyResourceGroup --model gpt-4o |
74 | | - - name: Run agent with config file |
75 | | - text: | |
76 | | - az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --name MyManagedCluster --resource-group MyResourceGroup |
77 | | - Here is an example of config file: |
78 | | - ```json |
79 | | - llms: |
80 | | - - provider: azure |
81 | | - MODEL_NAME: gpt-4.1 |
82 | | - AZURE_API_KEY: ******* |
83 | | - AZURE_API_BASE: https://{azure-openai-service-name}.openai.azure.com/ |
84 | | - AZURE_API_VERSION: 2025-04-01-preview |
85 | | - # define a list of mcp servers, mcp server can be defined |
86 | | - mcp_servers: |
87 | | - aks_mcp: |
88 | | - description: "The AKS-MCP is a Model Context Protocol (MCP) server that enables AI assistants to interact with Azure Kubernetes Service (AKS) clusters" |
89 | | - url: "http://localhost:8003/sse" |
90 | | -
|
91 | | - # try adding your own tools or toggle the built-in toolsets here |
92 | | - # e.g. query company-specific data, fetch logs from your existing observability tools, etc |
93 | | - # To check how to add a customized toolset, please refer to https://docs.robusta.dev/master/configuration/holmesgpt/custom_toolsets.html#custom-toolsets |
94 | | - # To find all built-in toolsets, please refer to https://docs.robusta.dev/master/configuration/holmesgpt/builtin_toolsets.html |
95 | | - toolsets: |
96 | | - # add a new json processor toolset |
97 | | - json_processor: |
98 | | - description: "A toolset for processing JSON data using jq" |
99 | | - prerequisites: |
100 | | - - command: "jq --version" # Ensure jq is installed |
101 | | - tools: |
102 | | - - name: "process_json" |
103 | | - description: "A tool that uses jq to process JSON input" |
104 | | - command: "echo '{{ json_input }}' | jq '.'" # Example jq command to format JSON |
105 | | - # disable a built-in toolsets |
106 | | - aks/core: |
107 | | - enabled: false |
108 | | - ``` |
| 64 | + az aks agent "Why are my pods not starting?" --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
109 | 65 | - name: Run in interactive mode without a question |
110 | | - text: az aks agent "Check the pod status in my cluster" --name MyManagedCluster --resource-group MyResourceGroup --model azure/gpt-4.1 --api-key "sk-xxx" |
111 | | - - name: Run in non-interactive batch mode |
112 | | - text: az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/gpt-4.1 |
113 | | - - name: Show detailed tool output during analysis |
114 | | - text: az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/gpt-4.1 |
115 | | - - name: Use custom configuration file |
116 | | - text: az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --model azure/gpt-4.1 |
117 | | - - name: Run agent with no echo of the original question |
118 | | - text: az aks agent "What is the status of my cluster?" --no-echo-request --model azure/gpt-4.1 |
119 | | - - name: Refresh toolsets to get the latest available tools |
120 | | - text: az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/gpt-4.1 |
121 | | - - name: Show agent status (MCP readiness) |
122 | | - text: az aks agent --status |
123 | | - - name: Run in interactive mode without a question |
124 | | - text: az aks agent "Check the pod status in my cluster" --name MyManagedCluster --resource-group MyResourceGroup --model azure/my-gpt4.1-deployment --api-key "sk-xxx" |
| 66 | + text: |- |
| 67 | + az aks agent "Check the pod status in my cluster" --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
125 | 68 | - name: Run in non-interactive batch mode |
126 | | - text: az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/my-gpt4.1-deployment |
| 69 | + text: |- |
| 70 | + az aks agent "Diagnose networking issues" --no-interactive --max-steps 15 --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
127 | 71 | - name: Show detailed tool output during analysis |
128 | | - text: az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/my-gpt4.1-deployment |
129 | | - - name: Use custom configuration file |
130 | | - text: az aks agent "Check kubernetes pod resource usage" --config-file /path/to/custom.yaml --model azure/my-gpt4.1-deployment |
| 72 | + text: |- |
| 73 | + az aks agent "Why is my service workload unavailable in namespace workload-ns?" --show-tool-output --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
131 | 74 | - name: Run agent with no echo of the original question |
132 | | - text: az aks agent "What is the status of my cluster?" --no-echo-request --model azure/my-gpt4.1-deployment |
| 75 | + text: |- |
| 76 | + az aks agent "What is the status of my cluster?" --no-echo-request --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
133 | 77 | - name: Refresh toolsets to get the latest available tools |
134 | | - text: az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/my-gpt4.1-deployment |
| 78 | + text: |- |
| 79 | + az aks agent "What is the status of my cluster?" --refresh-toolsets --model azure/gpt-4.1 --resource-group myResourceGroup --name myAKSCluster |
135 | 80 | """ |
136 | 81 |
|
137 | 82 | helps[ |
|
142 | 87 | long-summary: |- |
143 | 88 | This command interactively guides you to select an LLM provider and model, validates the connection, and saves the configuration for later use. |
144 | 89 | You can run this command multiple times to add or update different model configurations. |
| 90 | + parameters: |
| 91 | + - name: --name -n |
| 92 | + type: string |
| 93 | + short-summary: Name of the managed cluster. |
| 94 | + - name: --resource-group -g |
| 95 | + type: string |
| 96 | + short-summary: Name of the resource group. |
| 97 | + examples: |
| 98 | + - name: Initialize and deploy AKS agent to a cluster |
| 99 | + text: |- |
| 100 | + az aks agent-init --resource-group myResourceGroup --name myAKSCluster |
| 101 | +""" |
| 102 | + |
| 103 | +helps[ |
| 104 | + "aks agent-cleanup" |
| 105 | +] = """ |
| 106 | + type: command |
| 107 | + short-summary: Cleanup and uninstall AKS agent from the cluster. |
| 108 | + long-summary: |- |
| 109 | + This command removes the AKS agent and deletes all associated resources from the cluster. |
| 110 | + parameters: |
| 111 | + - name: --name -n |
| 112 | + type: string |
| 113 | + short-summary: Name of the managed cluster. |
| 114 | + - name: --resource-group -g |
| 115 | + type: string |
| 116 | + short-summary: Name of the resource group. |
145 | 117 | examples: |
146 | | - - name: Initialize configuration for Azure OpenAI, OpenAI or other llms |
147 | | - text: az aks agent-init |
| 118 | + - name: Cleanup and uninstall AKS agent from the cluster |
| 119 | + text: az aks agent-cleanup --resource-group myResourceGroup --name myAKSCluster |
148 | 120 | """ |
0 commit comments