Skip to main content

Health Check Config Resource Reference

The health check config resource specifies configuration options for resource endpoint health checks.

Currently, health checks can only be configured for database endpoints.

kind: health_check_config
version: v1
metadata:
  name: example
  description: Example healthcheck configuration
spec:
  # interval is the time between each health check. Default 30s.
  interval: 30s
  # timeout is the health check connection establishment timeout. Default 5s.
  timeout: 5s
  # healthy_threshold is the number of consecutive passing health checks
  # after which a target's health status becomes "healthy". Default 2.
  healthy_threshold: 2
  # unhealthy_threshold is the number of consecutive failing health checks
  # after which a target's health status becomes "unhealthy". Default 1.
  unhealthy_threshold: 1
  # match is used to select resources that these settings apply to.
  # Resources are matched by label selectors and at least one label selector
  # must be set.
  # If multiple `health_check_config` resources match the same resource, then
  # the matching health check configs are sorted by name and only the first
  # config applies.
  match:
    # db_labels matches database labels. An empty value is ignored.
    # If db_labels_expression is also set, then the match result is the logical
    # AND of both.
    db_labels:
      - name: env
        values:
          - dev
          - staging
    # db_labels_expression is a label predicate expression to match databases.
    # An empty value is ignored.
    # If db_labels is also set, then the match result is the logical AND of both.
    db_labels_expression: 'labels["owner"] == "database-team"'

See predicate language label expressions for more info about using predicate language to match resource labels.