forked from mtusi2026/mtusi2026lab7
173 lines
5.9 KiB
JSON
173 lines
5.9 KiB
JSON
{
|
|
"static_resources": {
|
|
"listeners": [
|
|
{
|
|
"name": "query",
|
|
"address": {
|
|
"socket_address": {
|
|
"address": "0.0.0.0",
|
|
"port_value": 9443
|
|
}
|
|
},
|
|
"filter_chains": [
|
|
{
|
|
"transport_socket": {
|
|
"name": "envoy.transport_sockets.tls",
|
|
"typed_config": {
|
|
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
|
|
"require_client_certificate": true,
|
|
"common_tls_context": {
|
|
"tls_params": {
|
|
"tls_minimum_protocol_version": "TLSv1_2"
|
|
},
|
|
"tls_certificates": [
|
|
{
|
|
"certificate_chain": {
|
|
"filename": "/run/identity/tls.crt"
|
|
},
|
|
"private_key": {
|
|
"filename": "/run/identity/tls.key"
|
|
}
|
|
}
|
|
],
|
|
"validation_context": {
|
|
"trusted_ca": {
|
|
"filename": "/run/identity/ca.crt"
|
|
},
|
|
"crl": {
|
|
"filename": "/run/identity/ca.crl"
|
|
},
|
|
"match_typed_subject_alt_names": [
|
|
{
|
|
"san_type": "DNS",
|
|
"matcher": {
|
|
"exact": "grafana"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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": "query",
|
|
"codec_type": "AUTO",
|
|
"route_config": {
|
|
"name": "routes",
|
|
"virtual_hosts": [
|
|
{
|
|
"name": "local",
|
|
"domains": [
|
|
"*"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": {
|
|
"prefix": "/"
|
|
},
|
|
"route": {
|
|
"cluster": "query",
|
|
"timeout": "125s"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"http_filters": [
|
|
{
|
|
"name": "envoy.filters.http.rbac",
|
|
"typed_config": {
|
|
"@type": "type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC",
|
|
"rules": {
|
|
"action": "ALLOW",
|
|
"policies": {
|
|
"grafana": {
|
|
"principals": [
|
|
{
|
|
"authenticated": {
|
|
"principal_name": {
|
|
"exact": "grafana"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"permissions": [
|
|
{
|
|
"and_rules": {
|
|
"rules": [
|
|
{
|
|
"header": {
|
|
"name": ":method",
|
|
"string_match": {
|
|
"safe_regex": {
|
|
"regex": "^(GET|POST)$"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"url_path": {
|
|
"path": {
|
|
"safe_regex": {
|
|
"regex": "^/(api/v1/(query|query_range|labels|label/[^/]+/values|series|metadata|status/buildinfo)|-/ready).*"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "envoy.filters.http.router",
|
|
"typed_config": {
|
|
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"clusters": [
|
|
{
|
|
"name": "query",
|
|
"connect_timeout": "1s",
|
|
"type": "STATIC",
|
|
"load_assignment": {
|
|
"cluster_name": "query",
|
|
"endpoints": [
|
|
{
|
|
"lb_endpoints": [
|
|
{
|
|
"endpoint": {
|
|
"address": {
|
|
"socket_address": {
|
|
"address": "127.0.0.1",
|
|
"port_value": 9090
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|