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
Section titled “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 mybackendserviceTCP health check additional CLI parameters
Section titled “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 to5s.--timeout- Duration allowed for a single health check attempt. Defaults to2s.--healthy-threshold- Number of consecutive successful checks required before marking an endpoint healthy. Defaults to1.--unhealthy-threshold- Number of consecutive failed checks required before marking an endpoint unhealthy. Defaults to2.--send- Text payload to send after connecting.--receive- Text expected in the response.
Add an HTTP health check
Section titled “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-pathHTTP health check additional CLI parameters
Section titled “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 to5s.--timeout- Duration allowed for a single health check attempt. Defaults to2s.--healthy-threshold- Number of consecutive successful checks required before marking an endpoint healthy. Defaults to1.--unhealthy-threshold- Number of consecutive failed checks required before marking an endpoint unhealthy. Defaults to2.--host- Value for the HTTPHostheader.--method- HTTP method to use:GETorHEAD. Defaults toGET.--expected-statuses- Comma-separated HTTP response status codes to treat as healthy. Defaults to200.
Remove a health check
Section titled “Remove a health check”Remove a health check (TCP or HTTP) as follows:
evroc loadbalancer backendservice clearhealthcheck mybackendservice