Skip to content

[AKS] az aks create: Simplify logic and enable correct recording rule groups for managed prom#31460

Merged
zhoxing-ms merged 5 commits intoAzure:devfrom
bragi92:dev
May 29, 2025
Merged

[AKS] az aks create: Simplify logic and enable correct recording rule groups for managed prom#31460
zhoxing-ms merged 5 commits intoAzure:devfrom
bragi92:dev

Conversation

@bragi92
Copy link
Member

@bragi92 bragi92 commented May 12, 2025

Related command

az aks create -n kaveeshcli22 -g kaveeshcli --location westeurope --enable-azure-monitor-metrics --azure-monitor-workspace-resource-id "{full_id}" --grafana-resource-id "{full_id}" --enable-windows-recording-rules

az aks create -n kaveeshcli22 -g kaveeshcli --disable-azure-monitor-metrics

Description
This PR updates the create_rules function to conditionally enable or disable Windows-specific Prometheus recording rule groups based on a new parameter, enable_windows_recording_rules. It ensures Windows rules are only applied when explicitly enabled, while general and Linux rules remain always enabled. Additionally, the rule group creation logic is streamlined and duplicated calls are handled per rule group index.

Testing Guide

Scenario 1:

  • Use the command with and without the azure-monitor-workspace-resource-id parameter similar to az aks create -n kaveeshcli22 -g kaveeshcli --location westcentralus --enable-azure-monitor-metrics" and it should result in a success. Make sure the recording rules groups are created as expected for managed prometheus.

Scenario 2:

  • Use the disable command and verify that all recording rule groups are getting deleted

History Notes

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

…ged prom (#2)

* fix: simplify logic and enable correct recording rule groups for managed prom

* Update create.py

* Update delete.py
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented May 12, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

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

Hi @bragi92,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

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

azure-client-tools-bot-prd bot commented May 12, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@github-actions
Copy link

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>

@yonzhan
Copy link
Collaborator

yonzhan commented May 12, 2025

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

@FumingZhang
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@FumingZhang
Copy link
Member

FumingZhang commented May 13, 2025

Queued live test to validate the change, test passed!

  • test_aks_create_with_azuremonitormetrics
  • test_aks_update_with_azuremonitormetrics

@zhoxing-ms zhoxing-ms changed the title [AKS] fix: simplify logic and enable correct recording rule groups for managed prom [AKS] az aks create: Simplify logic and enable correct recording rule groups for managed prom May 15, 2025
@zhoxing-ms
Copy link
Contributor

Could you please add some tests for this PR?

@zhoxing-ms
Copy link
Contributor

Could you please resolve these CI issues?

@FumingZhang
Copy link
Member

Hey @bragi92, please resolve the failed CI checks promptly if you still plan to meet the upcoming code complete deadline on May 27th.

@zhoxing-ms
Copy link
Contributor

@bragi92 please note that Azure CLI will have a code freeze on 05/27/2025 07:00 UTC for the upcoming release. Please address these comments ASAP, otherwise it has to be postponed to next sprint (07-01).

@bragi92
Copy link
Member Author

bragi92 commented May 27, 2025

Added unit tests! I'm good with the next milestone release. Please review this PR at your convinence @FumingZhang @zhoxing-ms

@FumingZhang
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@bragi92
Copy link
Member Author

bragi92 commented May 28, 2025

Updated to include missed license header @FumingZhang ! Can you help in running /azp run again?

@FumingZhang
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 485f49f into Azure:dev May 29, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants