Skip to content

Commit

Permalink
AKS-Preview CLI extension default to SLB+VMSS (Azure#906)
Browse files Browse the repository at this point in the history
* Vendor in 2019_08_01 SDK

* CLI extension for SLB/VMSS

* Update index

* Update index.json

* Fix style check error

* Fix style check

* Fix check style

* Fix check style

* Fix checkstyle

* Fix check style

* Fix check style

* Remove unused import

* Upgrade pylint to address distutils.versions importing issue

* Disable lint error

* Update index.json

* Fix codestyle

* Fix load command issue

* Update index

* Rename agent-pool-availability-type to vm-set-type

* Update helper message

* Update index.json

* Update helper doc

* Update index.json

* Bump version to 0.4.11

* Update index.json

* Update helper doc

* Update index.json
  • Loading branch information
Tony Xu authored and ManuInNZ committed Apr 11, 2020
1 parent e8bbdca commit 59834e3
Show file tree
Hide file tree
Showing 26 changed files with 6,012 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ language: python
services:
- docker
install:
- pip install pylint==1.9.2 flake8==3.5.0 requests wheel==0.30.0 -q
- pip install pylint==1.9.5 flake8==3.5.0 requests wheel==0.30.0 -q
jobs:
include:
- stage: precheck
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/test_static.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

pip install pylint==1.9.2 flake8
pip install pylint==1.9.5 flake8

proc_number=`python -c 'import multiprocessing; print(multiprocessing.cpu_count())'`

Expand Down
6 changes: 6 additions & 0 deletions src/aks-preview/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Release History
===============
0.4.11
+++++
* Add support for load-balancer-profile
* Set default availability type to VMSS
* Set default load balancer SKU to Standard

0.4.10
+++++
* Add support for `az aks update --disable-acr --acr <name-or-id>`
Expand Down
17 changes: 13 additions & 4 deletions src/aks-preview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,31 @@ az aks update \
--api-server-authorized-ip-ranges ""
```

#### Enable VMSS for new cluster
#### Use VMAS for new cluster
*Examples:*
```
az aks create \
-g MyResourceGroup \
-n MyManagedCluster \
--enable-VMSS \
--vm-set-type AvailabilitySet \
```

#### Enable VMSS for new cluster with availability zone feature
#### Use VMSS for new cluster(default)
*Examples:*
```
az aks create \
-g MyResourceGroup \
-n MyManagedCluster \
--enable-VMSS \
--vm-set-type VirtualMachineScaleSets \
```

#### Use VMSS for new cluster with availability zone feature
*Examples:*
```
az aks create \
-g MyResourceGroup \
-n MyManagedCluster \
--vm-set-type VirtualMachineScaleSets \
--node-zones 1 2 3
```

Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ContainerServiceCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2019-04-01')
register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2019-08-01')

acs_custom = CliCommandType(operations_tmpl='azext_aks_preview.custom#{}')
super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx,
Expand Down
54 changes: 48 additions & 6 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
type: string
short-summary: Azure Load Balancer SKU selection for your cluster. Basic or Standard.
long-summary: Select between Basic or Standard Azure Load Balancer SKU for your AKS cluster.
- name: --load-balancer-managed-outbound-ip-count
type: int
short-summary: Load balancer managed outbound IP count.
long-summary: Desired number of managed outbound IPs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --load-balancer-outbound-ips
type: string
short-summary: Load balancer outbound IP resource IDs.
long-summary: Comma-separated public IP resource IDs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --load-balancer-outbound-ip-prefixes
type: string
short-summary: Load balancer outbound IP prefix resource IDs.
long-summary: Comma-separated public IP prefix resource IDs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --enable-addons -a
type: string
short-summary: Enable the Kubernetes addons in a comma-separated list.
Expand Down Expand Up @@ -151,9 +163,9 @@
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100].
- name: --enable-vmss
type: bool
short-summary: (PREVIEW) Enable VMSS agent type.
- name: --vm-set-type
type: string
short-summary: Agent pool vm set type. VirtualMachineScaleSets or AvailabilitySet.
- name: --enable-pod-security-policy
type: bool
short-summary: (PREVIEW) Enable pod security policy.
Expand All @@ -170,11 +182,23 @@
- 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
- name: Create a Kubernetes cluster with a specific version.
text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.11.2
text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.13.9
- name: Create a Kubernetes cluster with a larger node pool.
text: az aks create -g MyResourceGroup -n MyManagedCluster --node-count 7
- name: Create a kubernetes cluster with preview api version and cluster autosclaler enabled.
text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.11.2 --node-count 3 --enable-cluster-autoscaler --min-count 1 --max-count 5 --enable-vmss
- name: Create a kubernetes cluster with cluster autosclaler enabled.
text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.13.9 --node-count 3 --enable-cluster-autoscaler --min-count 1 --max-count 5
- name: Create a kubernetes cluster with k8s 1.13.9 but use vmas.
text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.13.9 --vm-set-type AvailabilitySet
- name: Create a kubernetes cluster with default kubernetes vesrion, default SKU load balancer(standard) and default vm set type(VirtualMachineScaleSets).
text: az aks create -g MyResourceGroup -n MyManagedCluster
- name: Create a kubernetes cluster with standard SKU load balancer and two AKS created IPs for the load balancer outbound connection usage.
text: az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-managed-outbound-ip-count 2
- name: Create a kubernetes cluster with standard SKU load balancer and use the provided public IPs for the load balancer outbound connection usage.
text: az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-outbound-ips <ip-resource-id-1,ip-resource-id-2>
- name: Create a kubernetes cluster with standard SKU load balancer and use the provided public IP prefixes for the load balancer outbound connection usage.
text: az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-outbound-ip-prefixes <ip-prefix-resource-id-1,ip-prefix-resource-id-2>
- name: Create a kubernetes cluster with basic SKU load balancer and AvailabilitySet vm set type.
text: az aks create -g MyResourceGroup -n MyManagedCluster --load-balancer-sku basic --vm-set-type AvailabilitySet
""".format(sp_cache=AKS_SERVICE_PRINCIPAL_CACHE)

Expand Down Expand Up @@ -221,6 +245,18 @@
- name: --api-server-authorized-ip-ranges
type: str
short-summary: List of authorized IP ranges (separated by comma) for apiserver. Set to "" for disabling it.
- name: --load-balancer-managed-outbound-ip-count
type: int
short-summary: Load balancer managed outbound IP count.
long-summary: Desired number of managed outbound IPs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --load-balancer-outbound-ips
type: string
short-summary: Load balancer outbound IP resource IDs.
long-summary: Comma-separated public IP resource IDs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --load-balancer-outbound-ip-prefixes
type: string
short-summary: Load balancer outbound IP prefix resource IDs.
long-summary: Comma-separated public IP prefix resource IDs for load balancer outbound connection. Valid for Standard SKU load balancer cluster only.
- name: --enable-pod-security-policy
type: bool
short-summary: (PREVIEW) Enable pod security policy.
Expand Down Expand Up @@ -249,6 +285,12 @@
text: az aks update --enable-pod-security-policy -g MyResourceGroup -n MyManagedCluster
- name: Disable pod security policy.
text: az aks update --disable-pod-security-policy -g MyResourceGroup -n MyManagedCluster
- 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
- name: Update a kubernetes cluster with standard SKU load balancer to use the provided public IPs for the load balancer outbound connection usage.
text: az aks update -g MyResourceGroup -n MyManagedCluster --load-balancer-outbound-ips <ip-resource-id-1,ip-resource-id-2>
- name: Update a kubernetes cluster with standard SKU load balancer to use the provided public IP prefixes for the load balancer outbound connection usage.
text: az aks update -g MyResourceGroup -n MyManagedCluster --load-balancer-outbound-ip-prefixes <ip-prefix-resource-id-1,ip-prefix-resource-id-2>
"""

helps['aks nodepool'] = """
Expand Down
8 changes: 7 additions & 1 deletion src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def load_arguments(self, _):
c.argument('dns_service_ip')
c.argument('docker_bridge_address')
c.argument('load_balancer_sku')
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_outbound_ips')
c.argument('load_balancer_outbound_ip_prefixes')
c.argument('enable_addons', options_list=['--enable-addons', '-a'])
c.argument('disable_rbac', action='store_true')
c.argument('enable_rbac', action='store_true', options_list=['--enable-rbac', '-r'],
Expand All @@ -68,7 +71,7 @@ def load_arguments(self, _):
c.argument('enable_cluster_autoscaler', action='store_true')
c.argument('min_count', type=int, validator=validate_nodes_count)
c.argument('max_count', type=int, validator=validate_nodes_count)
c.argument('enable_vmss', action='store_true')
c.argument('vm_set_type')
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')
Expand All @@ -81,6 +84,9 @@ def load_arguments(self, _):
c.argument('update_cluster_autoscaler', options_list=["--update-cluster-autoscaler", "-u"], action='store_true')
c.argument('min_count', type=int, validator=validate_nodes_count)
c.argument('max_count', type=int, validator=validate_nodes_count)
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_outbound_ips')
c.argument('load_balancer_outbound_ip_prefixes')
c.argument('api_server_authorized_ip_ranges', type=str, validator=validate_ip_ranges)
c.argument('enable_pod_security_policy', action='store_true')
c.argument('disable_pod_security_policy', action='store_true')
Expand Down
4 changes: 2 additions & 2 deletions src/aks-preview/azext_aks_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def load_command_table(self, _):

managed_clusters_sdk = CliCommandType(
operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.'
'operations.managed_clusters_operations#ManagedClustersOperations.{}',
'operations._managed_clusters_operations#ManagedClustersOperations.{}',
client_factory=cf_managed_clusters
)

Expand All @@ -31,7 +31,7 @@ def load_command_table(self, _):

agent_pools_sdk = CliCommandType(
operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.'
'operations.agent_pools_operations#AgentPoolsOperations.{}',
'operations._agent_pools_operations#AgentPoolsOperations.{}',
client_factory=cf_managed_clusters
)

Expand Down
Loading

0 comments on commit 59834e3

Please sign in to comment.