Skip to content

Commit

Permalink
add support for outbound type none
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinForReal committed May 14, 2024
1 parent 7dcaa84 commit 7baa393
Show file tree
Hide file tree
Showing 8 changed files with 1,504 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ To release a new version, please select a new version number (usually plus 1 to

Pending
+++++++

4.0.0b2
+++++++
* Improve Windows OutboundNat test case by removing Windows OSSKU limitation
* `az aks create/update`: add support for new outbound type none

4.0.0b1
+++++++
Expand Down
2 changes: 2 additions & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,5 @@

CONST_ARTIFACT_SOURCE_DIRECT = "Direct"
CONST_ARTIFACT_SOURCE_CACHE = "Cache"

CONST_OUTBOUND_TYPE_NONE = "none"
2 changes: 2 additions & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
CONST_CLUSTER_SERVICE_HEALTH_PROBE_MODE_SHARED,
CONST_ARTIFACT_SOURCE_DIRECT,
CONST_ARTIFACT_SOURCE_CACHE,
CONST_OUTBOUND_TYPE_NONE,
)
from azext_aks_preview._validators import (
validate_acr,
Expand Down Expand Up @@ -268,6 +269,7 @@
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
CONST_OUTBOUND_TYPE_NONE,
]
auto_upgrade_channels = [
CONST_RAPID_UPGRADE_CHANNEL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
CONST_PRIVATE_DNS_ZONE_CONTRIBUTOR_ROLE,
CONST_DNS_ZONE_CONTRIBUTOR_ROLE,
CONST_ARTIFACT_SOURCE_CACHE,
CONST_OUTBOUND_TYPE_NONE,
)
from azext_aks_preview._helpers import (
check_is_apiserver_vnet_integration_cluster,
Expand Down Expand Up @@ -418,9 +419,11 @@ def _get_outbound_type(
if (
self.decorator_mode == DecoratorMode.CREATE and
not read_from_mc and
outbound_type != CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY and
outbound_type != CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY and
outbound_type != CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING
outbound_type not in [
CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY,
CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY,
CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING,
CONST_OUTBOUND_TYPE_NONE]
):
outbound_type = CONST_OUTBOUND_TYPE_LOAD_BALANCER
skuName = self.get_sku_name()
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,48 @@ def test_aks_create_and_update_with_managed_nat_gateway_outbound(
],
)

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(
random_name_length=17, name_prefix="clitest", location="eastus"
)
def test_aks_create_with_loadbalancer_and_update_to_none_outbound(
self, resource_group, resource_group_location
):
aks_name = self.create_random_name("cliakstest", 16)
self.kwargs.update(
{
"resource_group": resource_group,
"name": aks_name,
"ssh_key_value": self.generate_ssh_keys(),
}
)

create_cmd = (
"aks create --resource-group={resource_group} --name={name} "
"--vm-set-type VirtualMachineScaleSets -c 1 "
"--ssh-key-value={ssh_key_value}"
)
self.cmd(
create_cmd,
checks=[
self.check("provisioningState", "Succeeded"),
self.check("networkProfile.outboundType", "loadBalancer"),
],
)

update_cmd = (
"aks update --resource-group={resource_group} --name={name} "
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/EnableOutboundTypeNoneAndBlock "
"--outbound-type none "
)
self.cmd(
update_cmd,
checks=[
self.check("provisioningState", "Succeeded"),
self.check("networkProfile.outboundType", "none"),
],
)

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(
random_name_length=17, name_prefix="clitest", location="eastus"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
DecoratorMode,
)


class AKSPreviewManagedClusterModelsTestCase(unittest.TestCase):
def setUp(self):
# manually register CUSTOM_MGMT_AKS_PREVIEW
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from setuptools import setup, find_packages

VERSION = "4.0.0b1"
VERSION = "4.0.0b2"

CLASSIFIERS = [
"Development Status :: 4 - Beta",
Expand Down

0 comments on commit 7baa393

Please sign in to comment.