Code Monkey home page Code Monkey logo

Comments (3)

phlax avatar phlax commented on June 27, 2024

i think the answer is no, but probably it would be useful if we did

from envoy.

RyanTheOptimist avatar RyanTheOptimist commented on June 27, 2024

cc: @alyssawilk @mattklein123

from envoy.

mousimin avatar mousimin commented on June 27, 2024

I tried the following steps to test the behavior:

  1. Configure envoy using two virtual_hosts(s1.example.com/s2.example.com) and two clusters(cluster_1/cluster_2), each cluster contains 6 endpoints(cluster_1->e1/e2/e3/e4/e5/e6, cluster_2->e1/e2/e3/e4/e5/e6), the endpoints have different zone settings, s1.example.com maps to cluster_1 and s2.example.com maps to cluster_2
  2. Run the programs. The program behind cluster_1/cluster_2 is very simple, program1(cluster_1) presents a /query API which will call program2(cluster_2)'s / API, and get the zone setting of the node it's running on and the node program2(cluster_2) is running on, so we can see the request will go cross zone or not.
  3. call https://s1.example.com/query, unfortunately I see the request goes cross the zone
    the output will be gic-seli->gic-seli or gic-sero->gic-seli, but never gic-sero->gic-sero or gic-seli->gic-sero

Anything I missed?
The config files I used(Only essential parts are listed)
#########envoy.yaml#########

cluster_manager:
  local_cluster_name: "cluster_1"
static_resources:
  listeners:
    - name: listener_tcp_443
      address:
        socket_address:
          address: "::"
          ipv4_compat: true
          port_value: 443
      filter_chains:
        - filter_chain_match:
            server_names:
              - "*.example.com"
          filters:
            - name: envoy.filters.network.http_connection_manager
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                route_config:
                  name: local_route
                  virtual_hosts:
                    - name: vhost_1
                      require_tls: ALL
                      domains:
                        - "s1.example.com"
                        - "s1.example.com:443"
                      routes:
                        - match:
                            prefix: "/"
                          route:
                            auto_host_rewrite: true
                            cluster: cluster_1
                    - name: vhost_2
                      require_tls: ALL
                      domains:
                        - "s2.example.com"
                        - "s2.example.com:443"
                      routes:
                        - match:
                            prefix: "/"
                          route:
                            auto_host_rewrite: true
                            cluster: cluster_2
                stat_prefix: ingress_https
  clusters:
    - name: cluster_1
      lb_policy: round_robin
      common_lb_config:
        zone_aware_lb_config:
          min_cluster_size: 6
      eds_cluster_config:
        eds_config:
          path_config_source:
            path: '/local/envoy/conf/eds_c1.yaml'
      type: EDS
    - name: cluster_2
      lb_policy: round_robin
      common_lb_config:
        zone_aware_lb_config:
          min_cluster_size: 6
      eds_cluster_config:
        eds_config:
          path_config_source:
            path: '/local/envoy/conf/eds_c2.yaml'
      type: EDS

#########eds_c1.yaml#########

version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
  cluster_name: cluster_1
  endpoints:
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.1
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-seli
        zone: "11"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.2
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-seli
        zone: "12"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.3
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-seli
        zone: "13"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.4
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-sero
        zone: "21"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.5
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-sero
        zone: "22"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.6
                port_value: 30001
            health_check_config:
              port_value: 30001
      locality:
        region: gic-sero
        zone: "23"

#########eds_c2.yaml#########

version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
  cluster_name: cluster_2
  endpoints:
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.1
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-seli
        zone: "11"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.2
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-seli
        zone: "12"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.3
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-seli
        zone: "13"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.4
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-sero
        zone: "21"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.5
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-sero
        zone: "22"
    - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 100.76.120.6
                port_value: 30000
            health_check_config:
              port_value: 30000
      locality:
        region: gic-sero
        zone: "23"

from envoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.