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
38 changes: 36 additions & 2 deletions src/azure-cli/azure/cli/command_modules/acs/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,28 @@
short-summary: User account to create on node VMs for SSH access.
- name: --windows-admin-username
type: string
short-summary: Username to create on Windows node VMs.
short-summary: User account to create on windows node VMs.
long-summary: |-
Rules for windows-admin-username:
- restriction: Cannot end in "."
- Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
- Minimum-length: 1 character
- Max-length: 20 characters
Reference: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.virtualmachinescalesetosprofile.adminusername?view=azure-dotnet
- name: --windows-admin-password
type: string
short-summary: Password to create on Windows node VMs.
short-summary: User account password to use on windows node VMs.
long-summary: |-
Rules for windows-admin-password:
- Minimum-length: 14 characters
- Max-length: 123 characters
- Complexity requirements: 3 out of 4 conditions below need to be fulfilled
* Has lower characters
* Has upper characters
* Has a digit
* Has a special character (Regex match [\\W_])
- Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"
Reference: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.virtualmachinescalesetosprofile.adminpassword?view=azure-dotnet
- name: --enable-ahub
type: bool
short-summary: Enable Azure Hybrid User Benefits (AHUB) for Windows VMs.
Expand Down Expand Up @@ -527,6 +545,20 @@
- name: --disable-ahub
type: bool
short-summary: Disable Azure Hybrid User Benefits (AHUB) feature for cluster.
- name: --windows-admin-password
type: string
short-summary: User account password to use on windows node VMs.
long-summary: |-
Rules for windows-admin-password:
- Minimum-length: 14 characters
- Max-length: 123 characters
- Complexity requirements: 3 out of 4 conditions below need to be fulfilled
* Has lower characters
* Has upper characters
* Has a digit
* Has a special character (Regex match [\\W_])
- Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"
Reference: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.compute.models.virtualmachinescalesetosprofile.adminpassword?view=azure-dotnet
examples:
- name: Update a kubernetes cluster with standard SKU load balancer to use two AKS created IPs for the load balancer outbound connection usage.
text: az aks update -g MyResourceGroup -n MyManagedCluster --load-balancer-managed-outbound-ip-count 2
Expand All @@ -552,6 +584,8 @@
text: az aks update -g MyResourceGroup -n MyManagedCluster --enable-ahub
- name: Disable Azure Hybrid User Benefits featture for a kubernetes cluster.
text: az aks update -g MyResourceGroup -n MyManagedCluster --disable-ahub
- name: Update Windows password of a kubernetes cluster
text: az aks update -g MyResourceGroup -n MyManagedCLuster --windows-admin-password "Repl@cePassw0rd12345678"
"""

helps['aks delete'] = """
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def load_arguments(self, _):
c.argument('api_server_authorized_ip_ranges', type=str, validator=validate_ip_ranges)
c.argument('enable_ahub', options_list=['--enable-ahub'])
c.argument('disable_ahub', options_list=['--disable-ahub'])
c.argument('windows_admin_password', options_list=['--windows-admin-password'])

with self.argument_context('aks disable-addons') as c:
c.argument('addons', options_list=['--addons', '-a'])
Expand Down
10 changes: 8 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 @@ -2485,6 +2485,7 @@ def aks_update(cmd, client, resource_group_name, name,
aad_admin_group_object_ids=None,
enable_ahub=False,
disable_ahub=False,
windows_admin_password=None,
no_wait=False):
update_autoscaler = enable_cluster_autoscaler + disable_cluster_autoscaler + update_cluster_autoscaler
update_lb_profile = is_load_balancer_profile_provided(load_balancer_managed_outbound_ip_count,
Expand All @@ -2504,7 +2505,8 @@ def aks_update(cmd, client, resource_group_name, name,
not enable_aad and
not update_aad_profile and
not enable_ahub and
not disable_ahub):
not disable_ahub and
not windows_admin_password):
raise CLIError('Please specify one or more of "--enable-cluster-autoscaler" or '
'"--disable-cluster-autoscaler" or '
'"--update-cluster-autoscaler" or '
Expand All @@ -2522,7 +2524,8 @@ def aks_update(cmd, client, resource_group_name, name,
'"--aad-tenant-id" or '
'"--aad-admin-group-object-ids" or '
'"--enable-ahub" or '
'"--disable-ahub"')
'"--disable-ahub" or '
'"--windows-admin-password"')

instance = client.get(resource_group_name, name)
# For multi-agent pool, use the az aks nodepool command
Expand Down Expand Up @@ -2649,6 +2652,9 @@ def aks_update(cmd, client, resource_group_name, name,
if disable_ahub:
instance.windows_profile.license_type = 'None'

if windows_admin_password:
instance.windows_profile.admin_password = windows_admin_password

return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance)


Expand Down
Loading