Examples

Cluster References

An inline load-balancer cluster that shares its name with a top-level declaration may omit its endpoints: validation fills them in from the declaration, so the routed addresses and the health-checked addresses cannot drift apart

Praxis v0.8.0 2 min read

Category: Practical
Task: An inline load-balancer cluster that shares its name with a top-level declaration may omit its endpoints: validation fills them in from the declaration, so the routed addresses and the health-checked addresses cannot drift apart

Prerequisites: The product runtime and any backend services referenced by this configuration.

Run it: Use ghcr.io/praxis-proxy/praxis:0.8.0 and follow the first reverse-proxy tutorial to mount and start the configuration.

This configuration comes from the selected release. The example has not been run here; external services are not bundled.

Download the source file.

# Cluster References
#
# An inline load-balancer cluster that shares its name with a top-level
# declaration may omit its endpoints: validation fills them in from the
# declaration, so the routed addresses and the health-checked addresses
# cannot drift apart. The inline cluster below carries only its name.
#
listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains:
      - main

admin:
  metrics_address: "127.0.0.1:9902"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends
  allow_private_health_checks: true  # dev only; allows loopback probes

clusters:
  - name: backend
    endpoints:
      - "127.0.0.1:3001"
      - "127.0.0.1:3002"
    health_check:
      type: http
      path: "/healthz"
      expected_status: 200
      interval_ms: 2000
      timeout_ms: 1000
      healthy_threshold: 1
      unhealthy_threshold: 1

filter_chains:
  - name: main
    filters:
      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend

      - filter: load_balancer
        clusters:
          - name: backend