Copilot-cli: Support HealthCheckGracePeriodSeconds for Load Balanced Web Services

Created on 23 Jun 2021  路  5Comments  路  Source: aws/copilot-cli

In my manifest I have defined image.healthcheck.start_period with a value of 120. But when I look in my ECS service in the details tab it shows this

image

Is this the same setting, or maybe it's just not working?

good first issue sizS typfeature typrequest

All 5 comments

Hi @mikelhamer ! Can you try with 120s as an input? (adding the unit at the end)

Hey @efekarakus thanks for the suggestion! Unfortunately this didn't seem to have any effect.

Hi @mikelhamer, I think this is happening due to a confusion around which healthcheck we are talking about 馃槃

What's happening now?

The image healthcheck field configures the container healthcheck. For example:

image:
  build: frontend/Dockerfile
  healthcheck:
    command: ["CMD-SHELL", "curl -f http://localhost:8080 || exit 1"]
    start_period: 120s
  port: 8080

And I can see the container healtcheck being configured accordingly:
Screen Shot 2021-06-23 at 12 42 26 PM
From navigating to the task definition:
Screen Shot 2021-06-23 at 12 44 46 PM

What do we want?

I believe what you are looking for is configuring HealthCheckGracePeriodSeconds in the ECS service which we don't surface at the moment 馃檱

This would be a feature request for us where we add a start_period field under the http section where the default is 60s.

http:
  healthcheck:
     start_period: 120s # new field

One way of mitigating this concern I think for now until we surface this field is modifying the application code to have two healthcheck handlers:

  1. For the target group healthcheck that always just responds OK
  2. For container healthchecks that has the current logic with a start_period of 120s.

Then once this field is supported, the healthchecks can be combined and the container healthcheck can be removed

Thanks as always for the great explanation and possible solution!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kohidave picture kohidave  路  3Comments

iamhopaul123 picture iamhopaul123  路  3Comments

kohidave picture kohidave  路  4Comments

fullstackdev-online picture fullstackdev-online  路  3Comments

shrasool picture shrasool  路  4Comments