Subset Lb

Filters endpoints by metadata labels and applies an inner strategy within the matching subset

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

Category: Practical
Task: Filters endpoints by metadata labels and applies an inner strategy within the matching subset

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

Run it: Use ghcr.io/praxis-proxy/praxis:0.7.2 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.

# Subset Load Balancing
#
# Filters endpoints by metadata labels and applies an inner strategy
# within the matching subset. Useful for canary deployments, GPU-type
# routing, or version-based traffic splitting.
#
# In this example, only endpoints labeled version=canary receive traffic.
# If no endpoints match, the fallback_policy determines behavior:
#   - any_endpoint: use all endpoints regardless of metadata
#   - no_endpoint: return 503
#
listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains:
      - main

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

      - filter: load_balancer
        clusters:
          - name: backend
            load_balancer_strategy:
              subset:
                selector:
                  version: "canary"
                inner_strategy: round_robin
                fallback_policy: any_endpoint
            endpoints:
              - address: "127.0.0.1:3001"
                metadata:
                  version: "stable"
              - address: "127.0.0.1:3002"
                metadata:
                  version: "canary"
              - address: "127.0.0.1:3003"
                metadata:
                  version: "canary"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends