mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
optimize code
This commit is contained in:
@@ -188,3 +188,76 @@ func makeConfigSource() *core.ConfigSource {
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
// todo consider using redirect instead of route
|
||||
// &route.Route_Redirect{
|
||||
// Redirect: &route.RedirectAction{
|
||||
// HostRedirect: "",
|
||||
// },
|
||||
var _ = `
|
||||
admin:
|
||||
address:
|
||||
socket_address:
|
||||
protocol: TCP
|
||||
address: 127.0.0.1
|
||||
port_value: 9901
|
||||
static_resources:
|
||||
listeners:
|
||||
- name: listener_0
|
||||
address:
|
||||
socket_address:
|
||||
protocol: TCP
|
||||
address: 0.0.0.0
|
||||
port_value: 15006
|
||||
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
|
||||
route_config:
|
||||
name: local_route
|
||||
virtual_hosts:
|
||||
- name: local_service
|
||||
domains: ["*"]
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/"
|
||||
headers:
|
||||
- name: "a"
|
||||
exact_match: "2"
|
||||
route:
|
||||
cluster: dynamic_forward_proxy_cluster
|
||||
typed_per_filter_config:
|
||||
envoy.filters.http.dynamic_forward_proxy:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig
|
||||
host_rewrite_literal: 223.254.254.73:9080
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
cluster: dynamic_forward_proxy_cluster
|
||||
typed_per_filter_config:
|
||||
envoy.filters.http.dynamic_forward_proxy:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig
|
||||
host_rewrite_literal: 127.0.0.1:9080
|
||||
http_filters:
|
||||
- name: envoy.filters.http.dynamic_forward_proxy
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.FilterConfig
|
||||
dns_cache_config:
|
||||
name: dynamic_forward_proxy_cache_config
|
||||
dns_lookup_family: V4_ONLY
|
||||
- name: envoy.filters.http.router
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
|
||||
clusters:
|
||||
- name: dynamic_forward_proxy_cluster
|
||||
lb_policy: CLUSTER_PROVIDED
|
||||
cluster_type:
|
||||
name: envoy.clusters.dynamic_forward_proxy
|
||||
typed_config:
|
||||
"@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig
|
||||
dns_cache_config:
|
||||
name: dynamic_forward_proxy_cache_config
|
||||
dns_lookup_family: V4_ONLY
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user