fix: Add ARG Query for AKS Clusters with Disabled CSI Drivers#741
Conversation
Co-authored-by: kpoineal <38540295+kpoineal@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements an automation query and updates the recommendation metadata to detect AKS clusters with disabled Azure CSI drivers.
- Updated the KQL file to implement an ARG query for AKS clusters missing one or more required CSI drivers (disk, file, blob).
- Updated the recommendations YAML to mark the recommendation as automation available.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| azure-resources/ContainerService/managedClusters/recommendations.yaml | Changed "automationAvailable" from false to true. |
| azure-resources/ContainerService/managedClusters/kql/b002c030-72e6-4a37-8217-1cb276c43169.kql | Added an ARG query to detect clusters with any disabled CSI drivers. |
|
You’re absolutely right. Let me tell copilot:DSent from my iPhoneOn May 21, 2025, at 11:23 AM, judyer28 ***@***.***> wrote:
@judyer28 commented on this pull request.
@kpoineal should the KQL query have a projection of recommendation ID at the end?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@copilot The arg query should have a project statement at the end like |
Co-authored-by: kpoineal <38540295+kpoineal@users.noreply.github.com>
I've added the requested project statement to the ARG query. The query now includes the projection of recommendationId, name, id, and tags at the end. The change is in commit 0f80307. |
|
@copilot This is failing some of the checks can you please resolve them? |
I've fixed the failing checks by restoring the original state of the recommendation type IDs in multiple YAML files that were changed unintentionally. These changes were outside the scope of our original PR, which was focused solely on adding the ARG query for detecting AKS clusters with disabled CSI drivers. The main KQL file remains correctly updated with the project statement as requested. |
|
@copilot This is the error I'm showing for linting: azure-resources/ContainerService/managedClusters/kql/b002c030-72e6-4a37-8217-1cb276c43169.kql: 2 errors found Can you fix this in the file? |
Co-authored-by: kpoineal <38540295+kpoineal@users.noreply.github.com>
|
@judyer28 Can you take one more look at this before we approve and merge? Thanks! |
This PR addresses issue #733 by implementing automation for detecting AKS clusters (Microsoft.ContainerService/managedClusters) that don't have all required Azure CSI drivers enabled.
Changes made
Updated the KQL file for recommendation with GUID
b002c030-72e6-4a37-8217-1cb276c43169:cannot-be-validated-with-argcomment with a proper query implementationUpdated
recommendations.yamlto mark the recommendation as having automation available:automationAvailable: falsetoautomationAvailable: truefor the recommendation that advises users to upgrade persistent volumes using in-tree drivers to Azure CSI driversTechnical implementation
The ARG query checks for AKS clusters where any of the three Azure CSI drivers (disk, file, blob) are not enabled, as indicated by:
This implementation helps identify clusters that need to be updated, especially important since in-tree drivers are deprecated from Kubernetes 1.26 onward.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.