【问题标题】:Envoy as a reverse proxy and load balancer for unix socketsEnvoy 作为 unix 套接字的反向代理和负载均衡器
【发布时间】:2020-02-21 09:40:26
【问题描述】:

我有以下问题:envoy 应该对许多 unix 套接字进行反向代理,例如:

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

等等。 我试过的配置都没有工作,特使甚至没有启动。有人能解释一下如何反向代理甚至是单个 unix 套接字吗?

已解决:

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

【问题讨论】:

  • 你解决了这个问题吗?

标签: envoyproxy


【解决方案1】:

示例:Envoy 负载平衡 Unix 套接字和端口

  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

【讨论】:

    猜你喜欢
    • 2020-10-06
    • 2013-05-01
    • 2013-10-09
    • 2022-01-03
    • 2020-05-04
    • 1970-01-01
    • 2016-11-08
    • 2021-01-04
    • 1970-01-01
    相关资源
    最近更新 更多