Advertisement
A_God

envoy

Sep 7th, 2021
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.27 KB | None | 0 0
  1. static_resources:
  2.   listeners:
  3.   - name: main_listener
  4.     address:
  5.       socket_address: { address: 0.0.0.0, port_value: 10000 }
  6.     filter_chains:
  7.     - filters:
  8.       - name: envoy.filters.network.http_connection_manager
  9.         typed_config:
  10.           "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
  11.           stat_prefix: ingress
  12.           codec_type: auto
  13.           route_config:
  14.             name: local_route
  15.             virtual_hosts:
  16.             - name: local_services
  17.               domains: ["*"]
  18.               routes:
  19.               - match: { prefix: "/app/" }
  20.                 route:
  21.                   cluster: app-service
  22.                   prefix_rewrite: "/"
  23.  
  24.               - match: { path: "/v1/update" }
  25.                 route:
  26.                   cluster: watchtower-service
  27.  
  28.               - match: { prefix: "/builder/" }
  29.                 route:
  30.                   cluster: app-service
  31.  
  32.               - match: { prefix: "/builder" }
  33.                 route:
  34.                   cluster: app-service
  35.  
  36.               - match: { prefix: "/app_" }
  37.                 route:
  38.                   cluster: app-service
  39.  
  40.               # special cases for worker admin (deprecated), global and system API
  41.               - match: { prefix: "/api/global/" }
  42.                 route:
  43.                   cluster: worker-service
  44.  
  45.               - match: { prefix: "/api/admin/" }
  46.                 route:
  47.                   cluster: worker-service
  48.  
  49.               - match: { prefix: "/api/system/" }
  50.                 route:
  51.                   cluster: worker-service
  52.  
  53.               - match: { path: "/" }
  54.                 route:
  55.                   cluster: app-service
  56.  
  57.               # special case for when API requests are made, can just forward, not to minio
  58.               - match: { prefix: "/api/" }
  59.                 route:
  60.                   cluster: app-service
  61.  
  62.               - match: { prefix: "/worker/" }
  63.                 route:
  64.                   cluster: worker-service
  65.                   prefix_rewrite: "/"
  66.  
  67.               - match: { prefix: "/db/" }
  68.                 route:
  69.                   cluster: couchdb-service
  70.                   prefix_rewrite: "/"
  71.  
  72.               # minio is on the default route because this works
  73.               # best, minio + AWS SDK doesn't handle path proxy
  74.               - match: { prefix: "/" }
  75.                 route:
  76.                   cluster: minio-service
  77.  
  78.           http_filters:
  79.           - name: envoy.filters.http.router
  80.  
  81.   clusters:
  82.   - name: app-service
  83.     connect_timeout: 0.25s
  84.     type: strict_dns
  85.     lb_policy: round_robin
  86.     load_assignment:
  87.       cluster_name: app-service
  88.       endpoints:
  89.       - lb_endpoints:
  90.         - endpoint:
  91.             address:
  92.               socket_address:
  93.                 address: app-service
  94.                 port_value: 9080
  95.  
  96.   - name: minio-service
  97.     connect_timeout: 0.25s
  98.     type: strict_dns
  99.     lb_policy: round_robin
  100.     load_assignment:
  101.       cluster_name: minio-service
  102.       endpoints:
  103.       - lb_endpoints:
  104.         - endpoint:
  105.             address:
  106.               socket_address:
  107.                 address: minio-service
  108.                 port_value: 9092
  109.  
  110.   - name: worker-service
  111.     connect_timeout: 0.25s
  112.     type: strict_dns
  113.     lb_policy: round_robin
  114.     load_assignment:
  115.       cluster_name: worker-service
  116.       endpoints:
  117.       - lb_endpoints:
  118.         - endpoint:
  119.             address:
  120.               socket_address:
  121.                 address: worker-service
  122.                 port_value: 9091
  123.  
  124.   - name: couchdb-service
  125.     connect_timeout: 0.25s
  126.     type: strict_dns
  127.     lb_policy: round_robin
  128.     load_assignment:
  129.       cluster_name: couchdb-service
  130.       endpoints:
  131.       - lb_endpoints:
  132.         - endpoint:
  133.             address:
  134.               socket_address:
  135.                 address: couchdb-service
  136.                 port_value: 9094
  137.  
  138.   - name: watchtower-service
  139.     connect_timeout: 0.25s
  140.     type: strict_dns
  141.     lb_policy: round_robin
  142.     load_assignment:
  143.       cluster_name: watchtower-service
  144.       endpoints:
  145.       - lb_endpoints:
  146.         - endpoint:
  147.             address:
  148.               socket_address:
  149.                 address: watchtower-service
  150.                 port_value: 9096
  151.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement