Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@
- name: --vnet-subnet-id
type: string
short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster.
- name: --ppg
type: string
short-summary: The ID of a PPG.
- name: --enable-node-public-ip
type: bool
short-summary: Enable VMSS node public IP.
Expand Down Expand Up @@ -631,6 +634,9 @@
- name: --vnet-subnet-id
type: string
short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster.
- name: --ppg
type: string
short-summary: The ID of a PPG.
- name: --os-type
type: string
short-summary: The OS Type. Linux or Windows.
Expand Down
4 changes: 3 additions & 1 deletion src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
validate_nodepool_name, validate_vm_set_type, validate_load_balancer_sku, validate_load_balancer_outbound_ips,
validate_priority, validate_eviction_policy, validate_spot_max_price,
validate_load_balancer_outbound_ip_prefixes, validate_taints, validate_ip_ranges, validate_acr, validate_nodepool_tags,
validate_load_balancer_outbound_ports, validate_load_balancer_idle_timeout, validate_vnet_subnet_id, validate_nodepool_labels)
validate_load_balancer_outbound_ports, validate_load_balancer_idle_timeout, validate_vnet_subnet_id, validate_nodepool_labels, validate_ppg)
from ._consts import CONST_OUTBOUND_TYPE_LOAD_BALANCER, CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING, \
CONST_SCALE_SET_PRIORITY_REGULAR, CONST_SCALE_SET_PRIORITY_SPOT, \
CONST_SPOT_EVICTION_POLICY_DELETE, CONST_SPOT_EVICTION_POLICY_DEALLOCATE
Expand Down Expand Up @@ -198,6 +198,7 @@ def load_arguments(self, _):
c.argument('no_ssh_key', options_list=['--no-ssh-key', '-x'])
c.argument('pod_cidr')
c.argument('service_cidr')
c.argument('ppg', type=str, validator=validate_ppg)
c.argument('vnet_subnet_id', type=str, validator=validate_vnet_subnet_id)
c.argument('workspace_resource_id')
c.argument('skip_subnet_role_assignment', action='store_true')
Expand Down Expand Up @@ -295,6 +296,7 @@ def load_arguments(self, _):
c.argument('labels', nargs='*', validator=validate_nodepool_labels)
c.argument('mode', get_enum_type(nodepool_mode_type))
c.argument('enable_node_public_ip', action='store_true', is_preview=True)
c.argument('ppg', type=str, validator=validate_ppg)

for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
with self.argument_context(scope) as c:
Expand Down
9 changes: 9 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,15 @@ def validate_vnet_subnet_id(namespace):
raise CLIError("--vnet-subnet-id is not a valid Azure resource ID.")


def validate_ppg(namespace):
if namespace.ppg is not None:
if namespace.ppg == '':
return
from msrestazure.tools import is_valid_resource_id
if not is_valid_resource_id(namespace.ppg):
raise CLIError("--ppg is not a valid Azure resource ID.")


def validate_nodepool_labels(namespace):
"""Validates that provided node labels is a valid format"""

Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
enable_addons=None,
workspace_resource_id=None,
vnet_subnet_id=None,
ppg=None,
max_pods=0,
min_count=None,
max_count=None,
Expand Down Expand Up @@ -1667,6 +1668,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
os_type="Linux",
storage_profile=ContainerServiceStorageProfileTypes.managed_disks,
vnet_subnet_id=vnet_subnet_id,
proximity_placement_group_id=ppg,
availability_zones=zones,
enable_node_public_ip=enable_node_public_ip,
max_pods=int(max_pods) if max_pods else None,
Expand Down Expand Up @@ -2900,6 +2902,7 @@ def aks_agentpool_add(cmd, client, resource_group_name, cluster_name, nodepool_n
node_osdisk_size=0,
node_count=3,
vnet_subnet_id=None,
ppg=None,
max_pods=0,
os_type="Linux",
min_count=None,
Expand Down Expand Up @@ -2944,6 +2947,7 @@ def aks_agentpool_add(cmd, client, resource_group_name, cluster_name, nodepool_n
os_type=os_type,
storage_profile=ContainerServiceStorageProfileTypes.managed_disks,
vnet_subnet_id=vnet_subnet_id,
proximity_placement_group_id=ppg,
agent_pool_type="VirtualMachineScaleSets",
max_pods=int(max_pods) if max_pods else None,
orchestrator_version=kubernetes_version,
Expand Down
Loading