Add load balancer health checks

This guide shows you how to add and remove health checks from a load balancer's backend services using the evroc CLI.

Adding a new health check unsets any existing health check on the backend service.

Add a TCP health check

Create a TCP health check by referencing the existing backend service you wish to add a health check to:

evroc loadbalancer backendservice sethealthchecktcp mybackendservice

TCP health check additional CLI parameters

  • --target-port - Backend endpoint port to check. Defaults to the backend service port.
  • --interval - Duration between health check attempts. Defaults to 5s.
  • --timeout - Duration allowed for a single health check attempt. Defaults to 2s.
  • --healthy-threshold - Number of consecutive successful checks required before marking an endpoint healthy. Defaults to 1.
  • --unhealthy-threshold - Number of consecutive failed checks required before marking an endpoint unhealthy. Defaults to 2.
  • --send - Text payload to send after connecting.
  • --receive - Text expected in the response.

Add an HTTP health check

Create an HTTP health check by referencing the existing backend service you wish to add a health check to:

evroc loadbalancer backendservice sethealthcheckhttp mybackendservice \
  --path=/healthcheck-path

HTTP health check additional CLI parameters

  • --target-port - Backend endpoint port to check. Defaults to the backend service port.
  • --interval - Duration between health check attempts. Defaults to 5s.
  • --timeout - Duration allowed for a single health check attempt. Defaults to 2s.
  • --healthy-threshold - Number of consecutive successful checks required before marking an endpoint healthy. Defaults to 1.
  • --unhealthy-threshold - Number of consecutive failed checks required before marking an endpoint unhealthy. Defaults to 2.
  • --host - Value for the HTTP Host header.
  • --method - HTTP method to use: GET or HEAD. Defaults to GET.
  • --expected-statuses - Comma-separated HTTP response status codes to treat as healthy. Defaults to 200.

Remove a health check

Remove a health check (TCP or HTTP) as follows:

evroc loadbalancer backendservice clearhealthcheck mybackendservice