[AKS] Add --enable-control-plane-metrics and --disable-control-plane-metrics for Managed Prometheus#3
Open
[AKS] Add --enable-control-plane-metrics and --disable-control-plane-metrics for Managed Prometheus#3
Conversation
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
…metrics for Managed Prometheus Add CLI support for the ManagedClusterAzureMonitorProfileMetricsControlPlane feature, which enables collection of control plane component metrics (kube-apiserver, etcd, etc.) via the Azure Managed Prometheus addon. Changes: - Add --enable-control-plane-metrics param for aks create and update - Add --disable-control-plane-metrics param for aks create and update - Add getter/validator methods with mutual exclusivity checks - Add validation: control plane metrics flags require --enable-azure-monitor-metrics or that Azure Monitor Metrics is already enabled on the cluster - Wire control_plane into set_up/update_azure_monitor_profile decorators - Add help text for all new parameters Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f98d968 to
b88da59
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add CLI support for the new Control Plane Metrics feature in the Azure Managed Prometheus addon. This enables collection of operational runtime metrics from managed control plane components (kube-apiserver, etcd, etc.) via the
ManagedClusterAzureMonitorProfileMetricsControlPlanemodel.Background
2026-02-02-previewThis is part of the CCP Metrics GA plan. The feature transitions from a preview feature-flag-based enablement to an explicit opt-in via a new
controlPlaneproperty on theManagedClusterAzureMonitorProfileMetricsmodel.New CLI Parameters
--enable-control-plane-metricsaz aks create--enable-azure-monitor-metrics--disable-control-plane-metricsaz aks create--enable-control-plane-metricsaz aks update--disable-control-plane-metricsaz aks updateCLI Usage Examples
Enable on new cluster:
Enable on existing cluster (metrics already enabled):
Enable both monitor metrics and control plane on existing cluster:
Disable control plane metrics:
Validation Rules
Cannot use standalone:
--enable-control-plane-metricscannot be used without--enable-azure-monitor-metricson create, or without Azure Monitor Metrics already being enabled on the cluster for update. Error:Mutual exclusivity:
--enable-control-plane-metricsand--disable-control-plane-metricscannot be specified together.Disable requires metrics:
--disable-control-plane-metricsrequires Azure Monitor Metrics to be enabled on the cluster.ARM Model Shape
{ "azureMonitorProfile": { "metrics": { "enabled": true, "controlPlane": { "enabled": true }, "kubeStateMetrics": { } } } }Files Changed
_params.pyenable_control_plane_metricsanddisable_control_plane_metricsto both create and update command groupscustom.pyaks_create()andaks_update()function signaturesmanaged_cluster_decorator.pyset_up_azure_monitor_profile(create) andupdate_azure_monitor_profile(update) to setcontrol_planeon the metrics object_help.pyCustomer Scenarios Covered
az aks create --enable-azure-monitor-metrics --enable-control-plane-metricsenables API Server and ETCD metricsaz aks update --enable-control-plane-metrics(if monitor metrics already enabled)controlPlane.enabled=trueset automaticallyaz aks create --enable-control-plane-metricsalone gives error with guidance to enable monitor metrics firstaz aks update --disable-control-plane-metricsstops collection while keeping monitor metrics enabledKnown Blockers
TODO (post SDK availability)
azure-mgmt-containerserviceversion insetup.pytest_managed_cluster_decorator.pyRelated