budibase/hosting/kubernetes/envoy/envoy.yaml

134 lines
3.8 KiB
YAML
Raw Normal View History

2021-08-16 12:42:21 +02:00
static_resources:
listeners:
- name: main_listener
address:
socket_address: { address: 0.0.0.0, port_value: 10000 }
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
codec_type: auto
route_config:
name: local_route
virtual_hosts:
- name: local_services
domains: ["*"]
routes:
- match: { prefix: "/app/" }
route:
cluster: app-service
prefix_rewrite: "/"
- match: { prefix: "/builder/" }
route:
cluster: app-service
- match: { prefix: "/builder" }
route:
cluster: app-service
2021-09-16 22:15:09 +02:00
2021-08-16 12:42:21 +02:00
- match: { prefix: "/app_" }
route:
cluster: app-service
2021-09-16 22:15:09 +02:00
# special cases for worker admin (deprecated), global and system API
- match: { prefix: "/api/global/" }
route:
cluster: worker-service
2021-08-16 12:42:21 +02:00
- match: { prefix: "/api/admin/" }
route:
cluster: worker-service
2021-09-16 22:15:09 +02:00
- match: { prefix: "/api/system/" }
route:
cluster: worker-service
2021-08-16 12:42:21 +02:00
- match: { path: "/" }
route:
cluster: app-service
2021-09-16 22:15:09 +02:00
# special case for when API requests are made, can just forward, not to minio
2021-08-16 12:42:21 +02:00
- match: { prefix: "/api/" }
route:
cluster: app-service
- match: { prefix: "/worker/" }
2021-09-16 22:15:09 +02:00
route:
2021-08-16 12:42:21 +02:00
cluster: worker-service
prefix_rewrite: "/"
- match: { prefix: "/db/" }
route:
cluster: couchdb-service
prefix_rewrite: "/"
# minio is on the default route because this works
# best, minio + AWS SDK doesn't handle path proxy
- match: { prefix: "/" }
route:
cluster: minio-service
http_filters:
- name: envoy.filters.http.router
clusters:
- name: app-service
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: app-service
endpoints:
- lb_endpoints:
- endpoint:
address:
2021-09-16 22:15:09 +02:00
socket_address:
2021-08-16 12:42:21 +02:00
address: app-service.budibase.svc.cluster.local
port_value: 4002
- name: minio-service
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: minio-service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: minio-service.budibase.svc.cluster.local
port_value: 9000
- name: worker-service
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: worker-service
endpoints:
- lb_endpoints:
- endpoint:
address:
2021-09-16 22:15:09 +02:00
socket_address:
2021-08-16 12:42:21 +02:00
address: worker-service.budibase.svc.cluster.local
port_value: 4001
- name: couchdb-service
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: couchdb-service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: couchdb-service.budibase.svc.cluster.local
port_value: 5984