Container health checks verify a container's status by sending it requests over the public network. If a container becomes unhealthy, you can analyze its access logs to find the root cause. This topic describes how to set up container health checks.
Limitations
You can configure health checks only for containers that respond to public network requests.
Procedure
-
Go to the Simple Container Service page in the Simple Application Server console.
-
On the card for the desired container service, click its instance ID.
If you have many container services, you can enter the instance ID in the search box to filter the list.
-
Click the Container Information tab. Find the container you want to modify, and in its Actions column, click Modify Deployment.
-
For the target container, click Edit.
This step focuses on configuring health checks. For information about other parameters, see Deploy a container.
-
Configure the port.
Configure the port and then click Save.
Turn on the Port switch, enter a port number (for example,
80), and select a protocol (for example, HTTP). To add more ports, click Add Port. -
Click Next. After selecting the container and port, configure the health check parameters.
Parameter
Description
Health Check Path
The path to check. The default value is /.
Timeout Period for Health Checks (Seconds)
The maximum time for a health check to complete. If a check exceeds this time, it fails. The default is 2 seconds. Valid values are integers from 1 to 60.
Interval of Health Checks (Seconds)
The interval between two consecutive health checks. The default value is 5 seconds. Valid values are integers from 5 to 30.
Code for Passing Health Check
The container is healthy if it returns a status code in the specified range. Otherwise, it is unhealthy. By default, the http_2xx, http_3xx, and http_4xx check boxes are selected.
Healthy Threshold
The number of consecutive successful health checks required before the container is marked as healthy. The default value is 1. Valid values are integers from 1 to 10.
Unhealthy Threshold
The number of consecutive failed health checks required before the container is marked as unhealthy. The default value is 2. Valid values are integers from 1 to 10.
-
-
Click Commit.
After setting up container health checks, you can view their status in the container's details. For more information, see View container details.