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
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/acs/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]
- name: --node-taints
type: string
short-summary: The node taints for the node pool. You can't change the node taints through CLI after the node pool is created.
short-summary: The node taints for the node pool.
- name: --labels
type: string
short-summary: The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.
Expand Down Expand Up @@ -1018,6 +1018,9 @@
- name: --max-surge
type: string
short-summary: Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%
- name: --node-taints
type: string
short-summary: The node taints for the node pool.
- name: --labels
type: string
short-summary: The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.
Expand Down
3 changes: 2 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 @@ -435,7 +435,7 @@ def load_arguments(self, _):
c.argument('os_sku', completer=get_ossku_completion_list)
c.argument('enable_cluster_autoscaler', options_list=[
"--enable-cluster-autoscaler", "-e"], action='store_true')
c.argument('node_taints', type=str, validator=validate_taints)
c.argument('node_taints', validator=validate_taints)
c.argument('priority', arg_type=get_enum_type(node_priorities), validator=validate_priority)
c.argument('eviction_policy', arg_type=get_enum_type(node_eviction_policies), validator=validate_eviction_policy)
c.argument('spot_max_price', type=float,
Expand Down Expand Up @@ -474,6 +474,7 @@ def load_arguments(self, _):
c.argument('mode', get_enum_type(node_mode_types))
c.argument('max_surge', type=str, validator=validate_max_surge)
c.argument('labels', nargs='*', validator=validate_nodepool_labels)
c.argument('node_taints', validator=validate_taints)

with self.argument_context('aks command invoke') as c:
c.argument('command_string', type=str, options_list=[
Expand Down
18 changes: 16 additions & 2 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3360,6 +3360,7 @@ def aks_agentpool_upgrade(cmd, client, resource_group_name, cluster_name,
)


# pylint: disable=too-many-boolean-expressions
def aks_agentpool_update(cmd, client, resource_group_name, cluster_name, nodepool_name,
enable_cluster_autoscaler=False,
disable_cluster_autoscaler=False,
Expand All @@ -3369,6 +3370,7 @@ def aks_agentpool_update(cmd, client, resource_group_name, cluster_name, nodepoo
max_surge=None,
mode=None,
labels=None,
node_taints=None,
no_wait=False,
aks_custom_headers=None):
AgentPoolUpgradeSettings = cmd.get_models('AgentPoolUpgradeSettings',
Expand All @@ -3382,11 +3384,11 @@ def aks_agentpool_update(cmd, client, resource_group_name, cluster_name, nodepoo
'"--disable-cluster-autoscaler" or '
'"--update-cluster-autoscaler"')

if (update_autoscaler == 0 and not tags and not mode and not max_surge and labels is None):
if (update_autoscaler == 0 and not tags and not mode and not max_surge and labels is None and node_taints is None):
raise CLIError('Please specify one or more of "--enable-cluster-autoscaler" or '
'"--disable-cluster-autoscaler" or '
'"--update-cluster-autoscaler" or '
'"--tags" or "--mode" or "--max-surge" or "--labels"')
'"--tags" or "--mode" or "--max-surge" or "--labels"or "--node-taints"')

instance = client.get(resource_group_name, cluster_name, nodepool_name)

Expand Down Expand Up @@ -3434,6 +3436,18 @@ def aks_agentpool_update(cmd, client, resource_group_name, cluster_name, nodepoo
if labels is not None:
instance.node_labels = labels

if node_taints is not None:
taints_array = []
if node_taints != '':
for taint in node_taints.split(','):
try:
taint = taint.strip()
taints_array.append(taint)
except ValueError:
raise InvalidArgumentValueError(
'Taint does not match allowed values. Expect value such as "special=true:NoSchedule".')
instance.node_taints = taints_array

# custom headers
aks_custom_headers = extract_comma_separated_string(
aks_custom_headers,
Expand Down
Loading