Skip to content

Commit efc7771

Browse files
authored
{AKS} Add support for control plane scaling profile (#9670)
1 parent 9cd8a8b commit efc7771

7 files changed

Lines changed: 1935 additions & 987 deletions

File tree

src/aks-preview/HISTORY.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
* `az aks create`: Add `--control-plane-scaling-size` parameter to configure control plane scaling profile with available sizes 'H2', 'H4', and 'H8'.
1415

1516
20.0.0b4
1617
+++++++
@@ -48,7 +49,7 @@ Pending
4849
19.0.0b28
4950
+++++++
5051
* Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK.
51-
+ `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region.
52+
* `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region.
5253
* `az aks create/update`: Add `--enable-service-account-image-pull`, `--disable-service-account-image-pull`, and `--service-account-image-pull-default-managed-identity-id` parameters to manage service account based image pull settings.
5354
* `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region.
5455
* Add managed GPU enablement option to node pool property in `az aks nodepool add` and `az aks nodepool update`.

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,13 @@
715715
- name: --enable-hosted-system
716716
type: bool
717717
short-summary: Create a cluster with fully hosted system components. This applies only when creating a new automatic cluster.
718+
- name: --control-plane-scaling-size --cp-scaling-size
719+
type: string
720+
short-summary: (PREVIEW) The control plane scaling size for the cluster.
721+
long-summary: |
722+
Provides scaled and performance-guaranteed control plane capacity for AKS clusters.
723+
Enables customers to select a control plane scaling size that delivers higher API server throughput,
724+
increased etcd capacity, and faster pod scheduling rates. Available values are 'H2', 'H4', and 'H8'.
718725
examples:
719726
- name: Create a Kubernetes cluster with an existing SSH public key.
720727
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
@@ -806,6 +813,8 @@
806813
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-managed-system-pool
807814
- name: Create a kubernetes cluster with a managed installation of Gateway API CRDs from the standard release channel.
808815
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-gateway-api
816+
- name: Create a kubernetes cluster with control plane scaling size H4.
817+
text: az aks create -g MyResourceGroup -n MyManagedCluster --control-plane-scaling-size H4
809818
- name: Create an automatic cluster with hosted system components enabled.
810819
text: az aks create -g MyResourceGroup -n MyManagedCluster --sku automatic --enable-hosted-system
811820

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,14 @@ def load_arguments(self, _):
12611261
help="Enable Gateway API based ingress on App Routing via Istio"
12621262
)
12631263
c.argument("enable_hosted_system", action="store_true", is_preview=True)
1264+
c.argument(
1265+
"control_plane_scaling_size",
1266+
options_list=["--control-plane-scaling-size", "--cp-scaling-size"],
1267+
arg_type=get_enum_type(["H2", "H4", "H8"]),
1268+
is_preview=True,
1269+
help="The control plane scaling size. Provides scaled and performance-guaranteed control plane capacity. "
1270+
"Available values are 'H2', 'H4', and 'H8'.",
1271+
)
12641272
c.argument(
12651273
"enable_continuous_control_plane_and_addon_monitor",
12661274
action="store_true",

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ def aks_create(
11801180
# app routing istio
11811181
enable_app_routing_istio=False,
11821182
enable_hosted_system=False,
1183+
control_plane_scaling_size=None,
11831184
# health monitor
11841185
enable_continuous_control_plane_and_addon_monitor=False,
11851186
):

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3970,6 +3970,13 @@ def get_enable_hosted_system(self) -> bool:
39703970
raise RequiredArgumentMissingError('"--enable-hosted-system" requires "--sku automatic".')
39713971
return enable_hosted_system
39723972

3973+
def get_control_plane_scaling_size(self) -> Union[str, None]:
3974+
"""Obtain the value of control_plane_scaling_size.
3975+
3976+
:return: str or None
3977+
"""
3978+
return self.raw_param.get("control_plane_scaling_size")
3979+
39733980
def get_enable_continuous_control_plane_and_addon_monitor(self) -> bool:
39743981
"""Obtain the value of enable_continuous_control_plane_and_addon_monitor.
39753982
@@ -5069,6 +5076,23 @@ def set_up_bootstrap_profile(self, mc: ManagedCluster) -> ManagedCluster:
50695076

50705077
return mc
50715078

5079+
def set_up_control_plane_scaling_profile(self, mc: ManagedCluster) -> ManagedCluster:
5080+
"""Set up the control plane scaling profile for the ManagedCluster object.
5081+
5082+
:return: the ManagedCluster object
5083+
"""
5084+
self._ensure_mc(mc)
5085+
5086+
control_plane_scaling_size = self.context.get_control_plane_scaling_size()
5087+
if control_plane_scaling_size is not None:
5088+
mc.control_plane_scaling_profile = (
5089+
self.models.ManagedClusterControlPlaneScalingProfile( # pylint: disable=no-member
5090+
scaling_size=control_plane_scaling_size,
5091+
)
5092+
)
5093+
5094+
return mc
5095+
50725096
def set_up_health_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:
50735097
"""Set up health monitor profile for the ManagedCluster object.
50745098
@@ -5211,6 +5235,8 @@ def construct_mc_profile_preview(self, bypass_restore_defaults: bool = False) ->
52115235
mc = self.set_up_agentpool_profile_ssh_access(mc)
52125236
# set up bootstrap profile
52135237
mc = self.set_up_bootstrap_profile(mc)
5238+
# set up control plane scaling profile
5239+
mc = self.set_up_control_plane_scaling_profile(mc)
52145240
# set up static egress gateway profile
52155241
mc = self.set_up_static_egress_gateway(mc)
52165242
# set up health monitor profile

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9959,6 +9959,53 @@ def test_aks_create_with_windows_gmsa(
99599959
checks=[self.is_empty()],
99609960
)
99619961

9962+
@live_only()
9963+
@AllowLargeResponse()
9964+
@AKSCustomResourceGroupPreparer(
9965+
random_name_length=17,
9966+
name_prefix="clitest",
9967+
location="centraluseuap",
9968+
)
9969+
def test_aks_create_with_control_plane_scaling_profile(
9970+
self, resource_group, resource_group_location
9971+
):
9972+
# reset the count so in replay mode the random names will start with 0
9973+
self.test_resources_count = 0
9974+
# kwargs for string formatting
9975+
aks_name = self.create_random_name("cliakstest", 16)
9976+
self.kwargs.update(
9977+
{
9978+
"resource_group": resource_group,
9979+
"name": aks_name,
9980+
"location": resource_group_location,
9981+
"resource_type": "Microsoft.ContainerService/ManagedClusters",
9982+
"ssh_key_value": self.generate_ssh_keys(),
9983+
}
9984+
)
9985+
9986+
# create with control plane scaling size H4
9987+
create_cmd = (
9988+
"aks create --resource-group={resource_group} --name={name} --location={location} "
9989+
"--network-plugin azure --network-plugin-mode overlay --pod-cidr 10.244.0.0/16 "
9990+
"--ssh-key-value={ssh_key_value} --node-count 1 "
9991+
"--control-plane-scaling-size H4"
9992+
)
9993+
self.cmd(
9994+
create_cmd,
9995+
checks=[
9996+
self.check("provisioningState", "Succeeded"),
9997+
self.check("networkProfile.networkPlugin", "azure"),
9998+
self.check("networkProfile.networkPluginMode", "overlay"),
9999+
self.check("controlPlaneScalingProfile.scalingSize", "H4"),
10000+
],
10001+
)
10002+
10003+
# delete
10004+
self.cmd(
10005+
"aks delete -g {resource_group} -n {name} --yes --no-wait",
10006+
checks=[self.is_empty()],
10007+
)
10008+
996210009
@AllowLargeResponse()
996310010
@AKSCustomResourceGroupPreparer(
996410011
random_name_length=17,

0 commit comments

Comments
 (0)