Files
mtusi2026lab7/infra/envoy/loki.json
T
2026-11-18 11:36:21 +03:00

217 lines
7.7 KiB
JSON

{
"static_resources": {
"listeners": [
{
"name": "loki",
"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": "otel-collector"
}
},
{
"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": "loki",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "loki",
"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": {
"otel-collector": {
"principals": [
{
"authenticated": {
"principal_name": {
"exact": "otel-collector"
}
}
}
],
"permissions": [
{
"and_rules": {
"rules": [
{
"header": {
"name": ":method",
"string_match": {
"safe_regex": {
"regex": "^(POST)$"
}
}
}
},
{
"url_path": {
"path": {
"safe_regex": {
"regex": "^/otlp/v1/logs$"
}
}
}
}
]
}
}
]
},
"grafana": {
"principals": [
{
"authenticated": {
"principal_name": {
"exact": "grafana"
}
}
}
],
"permissions": [
{
"and_rules": {
"rules": [
{
"header": {
"name": ":method",
"string_match": {
"safe_regex": {
"regex": "^(GET)$"
}
}
}
},
{
"url_path": {
"path": {
"safe_regex": {
"regex": "^/(loki/api/v1/.*|ready)$"
}
}
}
}
]
}
}
]
}
}
}
}
},
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "loki",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "loki",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 3100
}
}
}
}
]
}
]
}
}
]
}
}