Skip to content

Commit 33765bf

Browse files
authored
Revert "Remove ingress scale settings (#8928)" (#9023)
* Revert "Remove ingress scale settings (#8928)" This reverts commit 1dca2de. * fix test
1 parent 5dad7e3 commit 33765bf

File tree

8 files changed

+4049
-3522
lines changed

8 files changed

+4049
-3522
lines changed

src/containerapp/HISTORY.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Release History
44
===============
55
upcoming
66
++++++
7-
* 'az containerapp env premium-ingress': remove `--min-replicas` and `--max-replicas` parameters, use workload profile scale instead.
87
* 'az containerapp session code-interpreter execute': Extend maximum supported value of `--timeout-in-seconds` from 60 to 220.
98
* 'az containerapp job create': Fix message with `--help`
109
* 'az containerapp arc': Enable setup custom core dns for Openshift on Arc

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
2387+
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName --min-replicas 2 --max-replicas 10
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
2398+
az containerapp env premium-ingress add -g MyResourceGroup -n MyEnvironment -w WorkloadProfileName --min-replicas 2 --max-replicas 10
23992399
"""
24002400

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

src/containerapp/azext_containerapp/_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +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.")
518520
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.")
519521
c.argument('request_idle_timeout', options_list=['--request-idle-timeout'], type=int, help="Timeout in minutes for idle requests. Default 4, minimum 1.")
520522
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: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3844,17 +3844,21 @@ 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, 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, max_replicas, 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
38553857

38563858
# Required
38573859
ingress_config["workloadProfileName"] = workload_profile_name
3860+
scale["minReplicas"] = min_replicas
3861+
scale["maxReplicas"] = max_replicas
38583862
# Optional, remove if None
38593863
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
38603864
ingress_config["requestIdleTimeout"] = request_idle_timeout
@@ -3874,16 +3878,23 @@ def add_environment_premium_ingress(cmd, name, resource_group_name, workload_pro
38743878
handle_raw_exception(e)
38753879

38763880

3877-
def update_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name=None, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
3881+
def update_environment_premium_ingress(cmd, name, resource_group_name, workload_profile_name=None, min_replicas=None, max_replicas=None, termination_grace_period=None, request_idle_timeout=None, header_count_limit=None, no_wait=False):
38783882
_validate_subscription_registered(cmd, CONTAINER_APPS_RP)
38793883

38803884
try:
38813885
ManagedEnvironmentPreviewClient.show(cmd, resource_group_name, name)
38823886
env_patch = {}
38833887
ingress_config = {}
3888+
scale = {}
38843889

38853890
if workload_profile_name is not None:
38863891
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
38873898
if termination_grace_period is not None:
38883899
ingress_config["terminationGracePeriodSeconds"] = termination_grace_period
38893900
if request_idle_timeout is not None:

0 commit comments

Comments
 (0)