diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 1905e80504e..9bd1151b265 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -2,6 +2,10 @@ Release History =============== +0.3.2 ++++++ +* Add support of customizing node resource group + 0.3.1 +++++ * Add support of pod security policy. diff --git a/src/aks-preview/azext_aks_preview/__init__.py b/src/aks-preview/azext_aks_preview/__init__.py index 66df31bab6c..b5b5fc04388 100644 --- a/src/aks-preview/azext_aks_preview/__init__.py +++ b/src/aks-preview/azext_aks_preview/__init__.py @@ -31,7 +31,12 @@ def load_command_table(self, args): return self.command_table def load_arguments(self, command): - super(ContainerServiceCommandsLoader, self).load_arguments(command) + from sys import version_info + if version_info[0] < 3: + super(ContainerServiceCommandsLoader, self).load_arguments(command) + else: + super().load_arguments(command) + from ._params import load_arguments load_arguments(self, command) diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index e5d2615a23a..2dd2107eb56 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -151,6 +151,9 @@ - name: --enable-pod-security-policy type: bool short-summary: (PREVIEW) Enable pod security policy. + - name: --node-resource-group + type: string + short-summary: The node resource group is the resource group where all customer's resources will be created in, such as virtual machines. examples: - name: Create a Kubernetes cluster with an existing SSH public key. text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index c83fe296369..57496172bb8 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -70,6 +70,7 @@ def load_arguments(self, _): c.argument('enable_vmss', action='store_true') c.argument('node_zones', zones_type, options_list='--node-zones', help='(PREVIEW) Space-separated list of availability zones where agent nodes will be placed.') c.argument('enable_pod_security_policy', action='store_true') + c.argument('node_resource_group') with self.argument_context('aks update') as c: c.argument('enable_cluster_autoscaler', options_list=["--enable-cluster-autoscaler", "-e"], action='store_true') diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index b5dd5beb73c..dc5ce738003 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -385,6 +385,7 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint: node_zones=None, generate_ssh_keys=False, # pylint: disable=unused-argument enable_pod_security_policy=False, + node_resource_group=None, no_wait=False): if not no_ssh_key: try: @@ -515,6 +516,9 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint: aad_profile=aad_profile, enable_pod_security_policy=bool(enable_pod_security_policy)) + if node_resource_group: + mc.node_resource_group = node_resource_group + # Due to SPN replication latency, we do a few retries here max_retry = 30 retry_exception = Exception(None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py index f797c8f6b5c..3a61ead3dde 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py @@ -89,7 +89,6 @@ class ManagedCluster(Resource): 'provisioning_state': {'readonly': True}, 'max_agent_pools': {'readonly': True}, 'fqdn': {'readonly': True}, - 'node_resource_group': {'readonly': True}, } _attribute_map = { @@ -128,7 +127,7 @@ def __init__(self, **kwargs): self.windows_profile = kwargs.get('windows_profile', None) self.service_principal_profile = kwargs.get('service_principal_profile', None) self.addon_profiles = kwargs.get('addon_profiles', None) - self.node_resource_group = None + self.node_resource_group = kwargs.get('node_resource_group', None) self.enable_rbac = kwargs.get('enable_rbac', None) self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) self.network_profile = kwargs.get('network_profile', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py index 0a8dd5286d1..829d3b1c9ad 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py @@ -89,7 +89,6 @@ class ManagedCluster(Resource): 'provisioning_state': {'readonly': True}, 'max_agent_pools': {'readonly': True}, 'fqdn': {'readonly': True}, - 'node_resource_group': {'readonly': True}, } _attribute_map = { @@ -116,7 +115,7 @@ class ManagedCluster(Resource): 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, node_resource_group: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, **kwargs) -> None: super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.max_agent_pools = None @@ -128,7 +127,7 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.windows_profile = windows_profile self.service_principal_profile = service_principal_profile self.addon_profiles = addon_profiles - self.node_resource_group = None + self.node_resource_group = node_resource_group self.enable_rbac = enable_rbac self.enable_pod_security_policy = enable_pod_security_policy self.network_profile = network_profile diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 7b71fc1c639..6269579b7fa 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -8,7 +8,7 @@ from codecs import open as open1 from setuptools import setup, find_packages -VERSION = "0.3.1" +VERSION = "0.3.2" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/index.json b/src/index.json index 2601d56f061..be65b7de469 100644 --- a/src/index.json +++ b/src/index.json @@ -48,8 +48,8 @@ ], "aks-preview": [ { - "downloadUrl": "https://azurecliaks.blob.core.windows.net/azure-cli-extension/aks_preview-0.2.3-py2.py3-none-any.whl", - "filename": "aks_preview-0.2.3-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliaks.blob.core.windows.net/azure-cli-extension/aks_preview-0.3.2-py2.py3-none-any.whl", + "filename": "aks_preview-0.3.2-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.49", @@ -88,9 +88,9 @@ "metadata_version": "2.0", "name": "aks-preview", "summary": "Provides a preview for upcoming AKS features", - "version": "0.2.3" + "version": "0.3.2" }, - "sha256Digest": "455d3c5a99627ae8b5870897852c09b41056d42d4a46719134cb4852754fc9d2" + "sha256Digest": "5839622f96bd4e42c4542eefb55a22c589f0d858924be790e1d5818e95912881" }, { "downloadUrl": "https://azurecliaks.blob.core.windows.net/azure-cli-extension/aks_preview-0.3.0-py2.py3-none-any.whl",