diff --git a/docs/content/reference/routing-configuration/tcp/service.md b/docs/content/reference/routing-configuration/tcp/service.md index e719ddf42..24db4102e 100644 --- a/docs/content/reference/routing-configuration/tcp/service.md +++ b/docs/content/reference/routing-configuration/tcp/service.md @@ -73,6 +73,44 @@ labels: } ``` +#### HTTP Health Check Configuration Example + +You can also configure health checks using HTTP mode: + +```yaml tab="Structured (YAML)" +tcp: + services: + my-service: + loadBalancer: + servers: + - address: "xx.xx.xx.xx:8080" + healthCheck: + mode: "HTTP" + httpHealthCheck: + path: "/health" + method: "GET" + status: 200 + interval: "10s" + timeout: "3s" +``` + +```toml tab="Structured (TOML)" +[tcp.services] + [tcp.services.my-service.loadBalancer] + [[tcp.services.my-service.loadBalancer.servers]] + address = "xx.xx.xx.xx:8080" + + [tcp.services.my-service.loadBalancer.healthCheck] + mode = "HTTP" + interval = "10s" + timeout = "3s" + + [tcp.services.my-service.loadBalancer.healthCheck.httpHealthCheck] + path = "/health" + method = "GET" + status = 200 +``` + ### Configuration Options | Field | Description | Default | @@ -101,6 +139,19 @@ Below are the available options for the health check mechanism: | `interval` | Defines the frequency of the health check calls for healthy targets. | 30s | No | | `unhealthyInterval` | Defines the frequency of the health check calls for unhealthy targets. When not defined, it defaults to the `interval` value. | 30s | No | | `timeout` | Defines the maximum duration Traefik will wait for a health check connection before considering the server unhealthy. | 5s | No | +| `mode` | Defines the health check mode. Can be `TCP` (default) for TCP payload exchange, or `HTTP` for HTTP health checks. | TCP | No | + +#### HTTP Mode + +When the health check `mode` is set to `HTTP`, you can configure HTTP-specific parameters using the `httpHealthCheck` field: + +| Field | Description | Default | Required | +|-------|-------------|---------|----------| +| `httpHealthCheck` | Configures HTTP health check options. Required when mode is set to `http`. | | No | +| `httpHealthCheck.path` | Defines the HTTP request path for the health check. | / | No | +| `httpHealthCheck.port` | Overrides the server address port for the HTTP health check endpoint. | | No | +| `httpHealthCheck.method` | Defines the HTTP method used for the health check request. | GET | No | +| `httpHealthCheck.status` | Defines the expected HTTP status code for a successful health check. | 200 | No | ## Weighted Round Robin