3

I have the following issue: envoy should do reverse proxy to numerous unix sockets such as:

/var/run/node1.sock
/var/run/node2.sock
...

and so on. None of configuration i tried work, envoy even not start. Can someone explain how to reverse proxy even to single unix socket ?

SOLVED:

     - lb_endpoints:
        - endpoint:
            address:
              pipe:
                path: /var/run/node1.sock
        - endpoint:
            address:
              pipe:
                path: /var/run/node2.sock

1 Answers1

0

Example: Envoy load balance Unix Sockets and Port

  admin:
    address:
      socket_address: { address: 0.0.0.0, port_value: 9901 }

  static_resources:
    listeners:
    - name: listener_0
      address:
        socket_address: { address: 0.0.0.0, port_value: 81 }
      filter_chains:
      - filters:
        - name: envoy.filters.network.http_connection_manager
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
            stat_prefix: ingress_http
            codec_type: AUTO
            route_config:
              name: local_route
              virtual_hosts:
              - name: local_service
                domains: ["*"]
                routes:
                - match: { prefix: "/" }
                  route: { cluster: some_service }
            http_filters:
            - name: envoy.filters.http.router
    clusters:
    - name: some_service
      connect_timeout: 0.25s
      type: STATIC
      lb_policy: ROUND_ROBIN
      load_assignment:
        cluster_name: some_service
        endpoints:
        - lb_endpoints:
          - endpoint:
              address:
                pipe:
                  path: /var/run/node1.sock
          - endpoint:
              address:
                pipe:
                  path: /var/run/node2.sock
          - endpoint:
              address:
                socket_address:
                  address: 127.0.0.1
                  port_value: 3000
Garvit Jain
  • 1,862
  • 2
  • 19
  • 27