From d8d390155b515cdd94555478bbcdf5682460c52e Mon Sep 17 00:00:00 2001 From: Cody Baker Date: Mon, 6 May 2024 17:12:35 -0400 Subject: [PATCH] APPS-8711: container termination controls (#873) * APPS-8711: container termination controls * remove specification/resources/apps/apps_get_database_connection_details.yml --- .../models/app_component_instance_base.yml | 2 +- .../resources/apps/models/app_job_spec.yml | 3 ++- .../apps/models/app_job_spec_termination.yml | 10 ++++++++++ .../apps/models/app_service_spec.yml | 3 +++ .../models/app_service_spec_termination.yml | 20 +++++++++++++++++++ .../resources/apps/models/app_worker_spec.yml | 6 +++++- .../models/app_worker_spec_termination.yml | 10 ++++++++++ 7 files changed, 51 insertions(+), 3 deletions(-) create mode 100755 specification/resources/apps/models/app_job_spec_termination.yml create mode 100755 specification/resources/apps/models/app_service_spec_termination.yml create mode 100755 specification/resources/apps/models/app_worker_spec_termination.yml diff --git a/specification/resources/apps/models/app_component_instance_base.yml b/specification/resources/apps/models/app_component_instance_base.yml index 6779982bf..568aac559 100644 --- a/specification/resources/apps/models/app_component_instance_base.yml +++ b/specification/resources/apps/models/app_component_instance_base.yml @@ -57,4 +57,4 @@ properties: minimum: 1 maximum: 100 default: 80 - example: 75 + example: 75 \ No newline at end of file diff --git a/specification/resources/apps/models/app_job_spec.yml b/specification/resources/apps/models/app_job_spec.yml index 223e0866c..c47ad17f4 100755 --- a/specification/resources/apps/models/app_job_spec.yml +++ b/specification/resources/apps/models/app_job_spec.yml @@ -18,6 +18,7 @@ allOf: - FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy. default: UNSPECIFIED example: PRE_DEPLOY - + termination: + $ref: app_job_spec_termination.yml required: - name diff --git a/specification/resources/apps/models/app_job_spec_termination.yml b/specification/resources/apps/models/app_job_spec_termination.yml new file mode 100755 index 000000000..446e247b1 --- /dev/null +++ b/specification/resources/apps/models/app_job_spec_termination.yml @@ -0,0 +1,10 @@ +type: object +properties: + grace_period_seconds: + type: integer + format: int32 + description: The number of seconds to wait between sending a TERM signal to a container and issuing + a KILL which causes immediate shutdown. (Default 120) + example: 120 + maximum: 600 + minimum: 1 \ No newline at end of file diff --git a/specification/resources/apps/models/app_service_spec.yml b/specification/resources/apps/models/app_service_spec.yml index 500560967..73bb70b73 100755 --- a/specification/resources/apps/models/app_service_spec.yml +++ b/specification/resources/apps/models/app_service_spec.yml @@ -40,5 +40,8 @@ allOf: items: $ref: app_route_spec.yml + termination: + $ref: app_service_spec_termination.yml + required: - name diff --git a/specification/resources/apps/models/app_service_spec_termination.yml b/specification/resources/apps/models/app_service_spec_termination.yml new file mode 100755 index 000000000..fa4a10fe9 --- /dev/null +++ b/specification/resources/apps/models/app_service_spec_termination.yml @@ -0,0 +1,20 @@ +type: object +properties: + drain_seconds: + type: integer + format: int32 + description: The number of seconds to wait between selecting a container instance + for termination and issuing the TERM signal. Selecting a container instance for + termination begins an asynchronous drain of new requests on upstream load-balancers. (Default 15) + example: 15 + maximum: 110 + minimum: 1 + + grace_period_seconds: + type: integer + format: int32 + description: The number of seconds to wait between sending a TERM signal to a container and issuing + a KILL which causes immediate shutdown. (Default 120) + example: 120 + maximum: 600 + minimum: 1 \ No newline at end of file diff --git a/specification/resources/apps/models/app_worker_spec.yml b/specification/resources/apps/models/app_worker_spec.yml index 80ef6e566..d1e554d61 100755 --- a/specification/resources/apps/models/app_worker_spec.yml +++ b/specification/resources/apps/models/app_worker_spec.yml @@ -1,6 +1,10 @@ allOf: - $ref: app_component_base.yml - $ref: app_component_instance_base.yml - +- type: object + properties: + termination: + $ref: app_worker_spec_termination.yml required: - name + diff --git a/specification/resources/apps/models/app_worker_spec_termination.yml b/specification/resources/apps/models/app_worker_spec_termination.yml new file mode 100755 index 000000000..446e247b1 --- /dev/null +++ b/specification/resources/apps/models/app_worker_spec_termination.yml @@ -0,0 +1,10 @@ +type: object +properties: + grace_period_seconds: + type: integer + format: int32 + description: The number of seconds to wait between sending a TERM signal to a container and issuing + a KILL which causes immediate shutdown. (Default 120) + example: 120 + maximum: 600 + minimum: 1 \ No newline at end of file