Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ aks create:
load_balancer_managed_outbound_ip_count:
rule_exclusions:
- option_length_too_long
load_balancer_managed_outbound_ipv6_count:
rule_exclusions:
- option_length_too_long
load_balancer_outbound_ip_prefixes:
rule_exclusions:
- option_length_too_long
Expand Down Expand Up @@ -300,6 +303,9 @@ aks update:
load_balancer_managed_outbound_ip_count:
rule_exclusions:
- option_length_too_long
load_balancer_managed_outbound_ipv6_count:
rule_exclusions:
- option_length_too_long
load_balancer_outbound_ip_prefixes:
rule_exclusions:
- option_length_too_long
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def default_api_version(self):
ResourceType.MGMT_ARO: '2020-04-30',
ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview',
ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview',
ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2021-07-01', {
ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2021-10-01', {
'container_services': '2017-07-01',
'open_shift_managed_clusters': '2019-09-30-preview'
})
Expand Down
20 changes: 20 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@
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-managed-outbound-ipv6-count
type: int
short-summary: Load balancer managed outbound IPv6 IP count.
long-summary: Desired number of managed outbound IPv6 IPs for load balancer outbound connection. Valid for dual-stack (--ip-families IPv4,IPv6) only.
- name: --load-balancer-outbound-ips
type: string
short-summary: Load balancer outbound IP resource IDs.
Expand Down Expand Up @@ -381,6 +385,18 @@
type: string
short-summary: A CIDR notation IP range from which to assign service cluster IPs.
long-summary: This range must not overlap with any Subnet IP ranges. For example, 10.0.0.0/16.
- name: --service-cidrs
type: string
short-summary: A comma separated list of CIDR notation IP ranges from which to assign service cluster IPs.
long-summary: Each range must not overlap with any Subnet IP ranges. For example, 10.0.0.0/16.
- name: --pod-cidrs
type: string
short-summary: A comma separated list of CIDR notation IP ranges from which to assign pod IPs when kubenet is used.
long-summary: Each range must not overlap with any Subnet IP ranges. For example, 172.244.0.0/16.
- name: --ip-families
type: string
short-summary: A comma separated list of IP versions to use for cluster networking.
long-summary: Each IP version should be in the format IPvN. For example, IPv4.
- name: --vnet-subnet-id
type: string
short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster.
Expand Down Expand Up @@ -562,6 +578,10 @@
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. If updated, it will wipe off the existing setting on Load balancer managed outbound IP count; Load balancer outbound IP resource IDs and Load balancer outbound IP prefix resource IDs.
- name: --load-balancer-managed-outbound-ipv6-count
type: int
short-summary: Load balancer managed outbound IPv6 IP count.
long-summary: Desired number of managed outbound IPv6 IPs for load balancer outbound connection. Valid for dual-stack (--ip-families IPv4,IPv6) only. If updated, it will wipe off the existing setting on Load balancer managed outbound IPv6 count; Load balancer outbound IP resource IDs and Load balancer outbound IP prefix resource IDs.
- name: --load-balancer-outbound-ips
type: string
short-summary: Load balancer outbound IP resource IDs.
Expand Down
51 changes: 33 additions & 18 deletions src/azure-cli/azure/cli/command_modules/acs/_loadbalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,43 @@ def set_load_balancer_sku(sku, kubernetes_version):
return "standard"


def update_load_balancer_profile(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout, profile, models):
def update_load_balancer_profile(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout, profile, models):
"""parse and update an existing load balancer profile"""
if not is_load_balancer_profile_provided(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout):
if not is_load_balancer_profile_provided(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout):
return profile
return configure_load_balancer_profile(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout, profile, models)
return configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout, profile, models)


def create_load_balancer_profile(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout, models):
def create_load_balancer_profile(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout, models):
"""parse and build load balancer profile"""
if not is_load_balancer_profile_provided(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout):
if not is_load_balancer_profile_provided(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout):
return None

ManagedClusterLoadBalancerProfile = models.get("ManagedClusterLoadBalancerProfile")
ManagedClusterLoadBalancerProfile = models.get(
"ManagedClusterLoadBalancerProfile")
profile = ManagedClusterLoadBalancerProfile()
return configure_load_balancer_profile(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes,
outbound_ports, idle_timeout, profile, models)
return configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout, profile, models)


def configure_load_balancer_profile(managed_outbound_ip_count, outbound_ips, outbound_ip_prefixes, outbound_ports,
idle_timeout, profile, models):
def configure_load_balancer_profile(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips,
outbound_ip_prefixes, outbound_ports, idle_timeout, profile, models):
"""configure a load balancer with customer supplied values"""
if not profile:
return profile

outbound_ip_resources = _get_load_balancer_outbound_ips(outbound_ips, models)
outbound_ip_resources = _get_load_balancer_outbound_ips(
outbound_ips, models)
outbound_ip_prefix_resources = _get_load_balancer_outbound_ip_prefixes(
outbound_ip_prefixes, models)

if managed_outbound_ip_count or outbound_ip_resources or outbound_ip_prefix_resources:
if (managed_outbound_ip_count or managed_outbound_ipv6_count or
outbound_ip_resources or outbound_ip_prefix_resources):
# ips -> i_ps due to track 2 naming issue
profile.managed_outbound_i_ps = None
# ips -> i_ps due to track 2 naming issue
Expand All @@ -67,6 +70,17 @@ def configure_load_balancer_profile(managed_outbound_ip_count, outbound_ips, out
profile.managed_outbound_i_ps = ManagedClusterLoadBalancerProfileManagedOutboundIPs(
count=managed_outbound_ip_count
)
if managed_outbound_ipv6_count:
if profile.managed_outbound_i_ps:
profile.managed_outbound_i_ps.count_ipv6 = managed_outbound_ipv6_count
else:
ManagedClusterLoadBalancerProfileManagedOutboundIPs = models.get(
"ManagedClusterLoadBalancerProfileManagedOutboundIPs"
)
# ips -> i_ps due to track 2 naming issue
profile.managed_outbound_i_ps = ManagedClusterLoadBalancerProfileManagedOutboundIPs(
count_ipv6=managed_outbound_ipv6_count
)
if outbound_ip_resources:
ManagedClusterLoadBalancerProfileOutboundIPs = models.get(
"ManagedClusterLoadBalancerProfileOutboundIPs"
Expand All @@ -90,9 +104,10 @@ def configure_load_balancer_profile(managed_outbound_ip_count, outbound_ips, out
return profile


def is_load_balancer_profile_provided(managed_outbound_ip_count, outbound_ips, ip_prefixes,
def is_load_balancer_profile_provided(managed_outbound_ip_count, managed_outbound_ipv6_count, outbound_ips, ip_prefixes,
outbound_ports, idle_timeout):
return any([managed_outbound_ip_count,
managed_outbound_ipv6_count,
outbound_ips,
ip_prefixes,
outbound_ports,
Expand Down
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def load_arguments(self, _):
c.argument('load_balancer_sku', type=str,
validator=validate_load_balancer_sku)
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_managed_outbound_ipv6_count', type=int)
c.argument('load_balancer_outbound_ips', type=str,
validator=validate_load_balancer_outbound_ips)
c.argument('load_balancer_outbound_ip_prefixes', type=str,
Expand Down Expand Up @@ -253,6 +254,9 @@ def load_arguments(self, _):
c.argument('no_ssh_key', options_list=['--no-ssh-key', '-x'])
c.argument('pod_cidr')
c.argument('service_cidr')
c.argument('pod_cidrs', type=str)
c.argument('service_cidrs', type=str)
c.argument('ip_families', type=str)
c.argument('ppg', type=str, validator=validate_ppg)
c.argument('vnet_subnet_id', type=str,
validator=validate_vnet_subnet_id)
Expand Down Expand Up @@ -323,6 +327,7 @@ def load_arguments(self, _):
c.argument('uptime_sla', action='store_true')
c.argument('no_uptime_sla', action='store_true')
c.argument('load_balancer_managed_outbound_ip_count', type=int)
c.argument('load_balancer_managed_outbound_ipv6_count', type=int)
c.argument('load_balancer_outbound_ips', type=str,
validator=validate_load_balancer_outbound_ips)
c.argument('load_balancer_outbound_ip_prefixes', type=str,
Expand Down
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1939,10 +1939,14 @@ def aks_create(cmd, client, resource_group_name, name, ssh_key_value, # pylint:
uptime_sla=False,
pod_cidr=None,
service_cidr=None,
pod_cidrs=None,
service_cidrs=None,
ip_families=None,
dns_service_ip=None,
docker_bridge_address=None,
load_balancer_sku=None,
load_balancer_managed_outbound_ip_count=None,
load_balancer_managed_outbound_ipv6_count=None,
load_balancer_outbound_ips=None,
load_balancer_outbound_ip_prefixes=None,
load_balancer_outbound_ports=None,
Expand Down Expand Up @@ -2252,6 +2256,7 @@ def aks_update(cmd, client, resource_group_name, name,
uptime_sla=False,
no_uptime_sla=False,
load_balancer_managed_outbound_ip_count=None,
load_balancer_managed_outbound_ipv6_count=None,
load_balancer_outbound_ips=None,
load_balancer_outbound_ip_prefixes=None,
load_balancer_outbound_ports=None,
Expand Down
Loading