meta | content | tags | dates | categories | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
serverless Containers troubleshooting issue error 502 |
|
|
502 errors can sometimes occur on Serverless Containers during the autoscaling process when new container instances are being created.
When a new instance is created, the Serverless health check verification is performed by default on the HTTP port. Once the port is opened, the resource is considered ready, and traffic starts being forwarded to it.
This issue typically occurs when traffic is sent too early to the newly created container before it is fully deployed.
To ensure the Serverless Container is completely ready, both in terms of the HTTP port and the software scope, it is recommended to use custom health checks.
Custom health checks can be configured via the API; in this case, it's recommended to implement a custom HTTP route on the Container that returns its readiness status.
- API Documentation for custom health checks - Refer to the
health_check
parameter.
Example (incomplete) settings:
health_check: {
http: {
path: "/"
}
}