From ae10825bbc3a7dcf5296f06904509781bb1fbb0f Mon Sep 17 00:00:00 2001 From: David Hageman Date: Tue, 30 Aug 2022 10:25:18 -0500 Subject: [PATCH 1/2] Add ability to upgrade nodepool kubernetes version --- plugins/modules/azure_rm_aks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/modules/azure_rm_aks.py b/plugins/modules/azure_rm_aks.py index 929d27da2..fc9e5e3c6 100644 --- a/plugins/modules/azure_rm_aks.py +++ b/plugins/modules/azure_rm_aks.py @@ -109,6 +109,10 @@ - 'System' - 'User' type: str + orchestrator_version: + description: + - Version of kubernetes running on the node pool. + type: str node_labels: description: - Agent pool node labels to be persisted across all nodes in agent pool. @@ -549,6 +553,7 @@ def create_agent_pool_profiles_dict(agentpoolprofiles): os_type=profile.os_type, type=profile.type, mode=profile.mode, + orchestrator_version=profile.orchestrator_version, enable_auto_scaling=profile.enable_auto_scaling, max_count=profile.max_count, node_labels=profile.node_labels, @@ -605,8 +610,9 @@ def create_addon_profiles_spec(): vnet_subnet_id=dict(type='str'), availability_zones=dict(type='list', elements='int', choices=[1, 2, 3]), os_type=dict(type='str', choices=['Linux', 'Windows']), + orchestrator_version=dict(type='str', required=False), type=dict(type='str', choice=['VirtualMachineScaleSets', 'AvailabilitySet']), - mode=dict(type='str', choice=['System', 'User'], requried=True), + mode=dict(type='str', choice=['System', 'User'], required=True), enable_auto_scaling=dict(type='bool'), max_count=dict(type='int'), node_labels=dict(type='dict'), @@ -852,6 +858,7 @@ def compare_addon(origin, patch, config): os_disk_size_gb = profile_self.get('os_disk_size_gb') or profile_result['os_disk_size_gb'] vnet_subnet_id = profile_self.get('vnet_subnet_id', profile_result['vnet_subnet_id']) count = profile_self['count'] + orchestrator_version = profile_self['orchestrator_version'] vm_size = profile_self['vm_size'] availability_zones = profile_self['availability_zones'] enable_auto_scaling = profile_self['enable_auto_scaling'] @@ -1023,6 +1030,7 @@ def create_update_agentpool(self, to_update_name_list): max_count=profile["max_count"], node_labels=profile["node_labels"], min_count=profile["min_count"], + orchestrator_version=profile["orchestrator_version"], max_pods=profile["max_pods"], enable_auto_scaling=profile["enable_auto_scaling"], agent_pool_type=profile["type"], From 1cf9eb901784a981bda26b9e42ca3e09c8aff923 Mon Sep 17 00:00:00 2001 From: David Hageman Date: Wed, 31 Aug 2022 08:17:08 -0500 Subject: [PATCH 2/2] Remove unneeded required enforcement Co-authored-by: Fred-sun <37327967+Fred-sun@users.noreply.github.com> --- plugins/modules/azure_rm_aks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/azure_rm_aks.py b/plugins/modules/azure_rm_aks.py index fc9e5e3c6..56e4fae2d 100644 --- a/plugins/modules/azure_rm_aks.py +++ b/plugins/modules/azure_rm_aks.py @@ -612,7 +612,7 @@ def create_addon_profiles_spec(): os_type=dict(type='str', choices=['Linux', 'Windows']), orchestrator_version=dict(type='str', required=False), type=dict(type='str', choice=['VirtualMachineScaleSets', 'AvailabilitySet']), - mode=dict(type='str', choice=['System', 'User'], required=True), + mode=dict(type='str', choice=['System', 'User']), enable_auto_scaling=dict(type='bool'), max_count=dict(type='int'), node_labels=dict(type='dict'),