Skip to content

Commit 92e8976

Browse files
committed
Depricate ingress scale settings
1 parent e9d4551 commit 92e8976

File tree

8 files changed

+3523
-4048
lines changed

8 files changed

+3523
-4048
lines changed

src/containerapp/HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Release History
44
===============
55
upcoming
66
++++++
7+
* 'az containerapp env premium-ingress': deprecate `--min-replicas` and `--max-replicas` parameters, use workload profile scale instead.
78

89
1.2.0b3
910
++++++

src/containerapp/azext_containerapp/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,7 +2384,7 @@
23842384
examples:
23852385
- name: Enable premium ingress for the environment.
23862386
text: |
2387-
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName --min-replicas 2 --max-replicas 10
2387+
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName
23882388
"""
23892389

23902390
helps['containerapp env premium-ingress add'] = """
@@ -2395,7 +2395,7 @@
23952395
examples:
23962396
- name: Add the premium ingress settings for the environment.
23972397
text: |
2398-
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName --min-replicas 2 --max-replicas 10
2398+
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName
23992399
"""
24002400

24012401
helps['containerapp env premium-ingress update'] = """

src/containerapp/azext_containerapp/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ def load_arguments(self, _):
515515
c.argument('resource_group_name', arg_type=resource_group_name_type, id_part=None)
516516
c.argument('name', options_list=['--name', '-n'], help="The name of the managed environment.")
517517
c.argument('workload_profile_name', options_list=['--workload-profile-name', '-w'], help="The workload profile to run ingress replicas on. This profile must not be shared with any container app or job.")
518-
c.argument('min_replicas', options_list=['--min-replicas'], type=int, help="Minimum number of replicas to run. Default 2, minimum 2.")
519-
c.argument('max_replicas', options_list=['--max-replicas'], type=int, help="Maximum number of replicas to run. Default 10. The upper limit is the maximum cores available in the workload profile.")
518+
c.argument('min_replicas', options_list=['--min-replicas'], type=int, deprecate_info=c.deprecate(), help="The workload profile minimum instances is used instead.")
519+
c.argument('max_replicas', options_list=['--max-replicas'], type=int, deprecate_info=c.deprecate(), help="The workload profile maximum instances is used instead.")
520520
c.argument('termination_grace_period', options_list=['--termination-grace-period', '-t'], type=int, help="Time in seconds to drain requests during ingress shutdown. Default 500, minimum 0, maximum 3600.")
521521
c.argument('request_idle_timeout', options_list=['--request-idle-timeout'], type=int, help="Timeout in minutes for idle requests. Default 4, minimum 1.")
522522
c.argument('header_count_limit', options_list=['--header-count-limit'], type=int, help="Limit of http headers per request. Default 100, minimum 1.")

src/containerapp/azext_containerapp/custom.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3844,21 +3844,17 @@ def show_environment_premium_ingress(cmd, name, resource_group_name):
38443844
handle_raw_exception(e)
38453845

38463846

3847-
def add_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name, min_replicas, max_replicas, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
3847+
def add_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name, min_replicas=None, max_replicas=None, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
38483848
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
38493849

38503850
try:
38513851
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
38523852
env_patch = {}
38533853
ingress_config = {}
38543854
safe_set(env_patch, "properties", "ingressConfiguration", value=ingress_config)
3855-
scale = {}
3856-
ingress_config["scale"] = scale
38573855

38583856
# Required
38593857
ingress_config["workloadProfileName"] = workload_profile_name
3860-
scale["minReplicas"] = min_replicas
3861-
scale["maxReplicas"] = max_replicas
38623858
# Optional, remove if None
38633859
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
38643860
ingress_config["requestIdleTimeout"] = request_idle_timeout
@@ -3885,16 +3881,9 @@ def update_environment_premium_ingress(cmd, name, resource_group_name, workload_
38853881
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
38863882
env_patch = {}
38873883
ingress_config = {}
3888-
scale = {}
38893884

38903885
if workload_profile_name is not None:
38913886
ingress_config["workloadProfileName"] = workload_profile_name
3892-
if min_replicas is not None:
3893-
ingress_config["scale"] = scale
3894-
scale["minReplicas"] = min_replicas
3895-
if max_replicas is not None:
3896-
ingress_config["scale"] = scale
3897-
scale["maxReplicas"] = max_replicas
38983887
if termination_grace_period is not None:
38993888
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
39003889
if request_idle_timeout is not None:

0 commit comments

Comments
 (0)