Skip to content

Commit 7baa393

Browse files
committed
add support for outbound type none
1 parent 7dcaa84 commit 7baa393

8 files changed

+1504
-5
lines changed

src/aks-preview/HISTORY.rst

+4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
15+
4.0.0b2
16+
+++++++
1417
* Improve Windows OutboundNat test case by removing Windows OSSKU limitation
18+
* `az aks create/update`: add support for new outbound type none
1519

1620
4.0.0b1
1721
+++++++

src/aks-preview/azext_aks_preview/_consts.py

+2
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,5 @@
316316

317317
CONST_ARTIFACT_SOURCE_DIRECT = "Direct"
318318
CONST_ARTIFACT_SOURCE_CACHE = "Cache"
319+
320+
CONST_OUTBOUND_TYPE_NONE = "none"

src/aks-preview/azext_aks_preview/_params.py

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
CONST_CLUSTER_SERVICE_HEALTH_PROBE_MODE_SHARED,
122122
CONST_ARTIFACT_SOURCE_DIRECT,
123123
CONST_ARTIFACT_SOURCE_CACHE,
124+
CONST_OUTBOUND_TYPE_NONE,
124125
)
125126
from azext_aks_preview._validators import (
126127
validate_acr,
@@ -268,6 +269,7 @@
268269
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
269270
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
270271
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
272+
CONST_OUTBOUND_TYPE_NONE,
271273
]
272274
auto_upgrade_channels = [
273275
CONST_RAPID_UPGRADE_CHANNEL,

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
CONST_PRIVATE_DNS_ZONE_CONTRIBUTOR_ROLE,
3636
CONST_DNS_ZONE_CONTRIBUTOR_ROLE,
3737
CONST_ARTIFACT_SOURCE_CACHE,
38+
CONST_OUTBOUND_TYPE_NONE,
3839
)
3940
from azext_aks_preview._helpers import (
4041
check_is_apiserver_vnet_integration_cluster,
@@ -418,9 +419,11 @@ def _get_outbound_type(
418419
if (
419420
self.decorator_mode == DecoratorMode.CREATE and
420421
not read_from_mc and
421-
outbound_type != CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY and
422-
outbound_type != CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY and
423-
outbound_type != CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING
422+
outbound_type not in [
423+
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
424+
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
425+
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
426+
CONST_OUTBOUND_TYPE_NONE]
424427
):
425428
outbound_type = CONST_OUTBOUND_TYPE_LOAD_BALANCER
426429
skuName = self.get_sku_name()

src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_with_loadbalancer_and_update_to_none_outbound.yaml

+1,447
Large diffs are not rendered by default.

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

+42
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,48 @@ def test_aks_create_and_update_with_managed_nat_gateway_outbound(
193193
],
194194
)
195195

196+
@AllowLargeResponse()
197+
@AKSCustomResourceGroupPreparer(
198+
random_name_length=17, name_prefix="clitest", location="eastus"
199+
)
200+
def test_aks_create_with_loadbalancer_and_update_to_none_outbound(
201+
self, resource_group, resource_group_location
202+
):
203+
aks_name = self.create_random_name("cliakstest", 16)
204+
self.kwargs.update(
205+
{
206+
"resource_group": resource_group,
207+
"name": aks_name,
208+
"ssh_key_value": self.generate_ssh_keys(),
209+
}
210+
)
211+
212+
create_cmd = (
213+
"aks create --resource-group={resource_group} --name={name} "
214+
"--vm-set-type VirtualMachineScaleSets -c 1 "
215+
"--ssh-key-value={ssh_key_value}"
216+
)
217+
self.cmd(
218+
create_cmd,
219+
checks=[
220+
self.check("provisioningState", "Succeeded"),
221+
self.check("networkProfile.outboundType", "loadBalancer"),
222+
],
223+
)
224+
225+
update_cmd = (
226+
"aks update --resource-group={resource_group} --name={name} "
227+
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/EnableOutboundTypeNoneAndBlock "
228+
"--outbound-type none "
229+
)
230+
self.cmd(
231+
update_cmd,
232+
checks=[
233+
self.check("provisioningState", "Succeeded"),
234+
self.check("networkProfile.outboundType", "none"),
235+
],
236+
)
237+
196238
@AllowLargeResponse()
197239
@AKSCustomResourceGroupPreparer(
198240
random_name_length=17, name_prefix="clitest", location="eastus"

src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
DecoratorMode,
9797
)
9898

99-
10099
class AKSPreviewManagedClusterModelsTestCase(unittest.TestCase):
101100
def setUp(self):
102101
# manually register CUSTOM_MGMT_AKS_PREVIEW

src/aks-preview/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import setup, find_packages
1111

12-
VERSION = "4.0.0b1"
12+
VERSION = "4.0.0b2"
1313

1414
CLASSIFIERS = [
1515
"Development Status :: 4 - Beta",

0 commit comments

Comments
 (0)