From e76ea0210edb17b8669f2a8b10062607e8fda9ce Mon Sep 17 00:00:00 2001 From: Kamil Smigielski Date: Thu, 8 Dec 2022 16:48:59 +0100 Subject: [PATCH 1/5] working --- .../servicemesh/envoycontrol/ControlPlane.kt | 2 +- .../resource/clusters/EnvoyClustersFactory.kt | 26 ++-- .../listeners/filters/EnvoyDefaultFilters.kt | 2 - .../filters/HttpConnectionManagerFactory.kt | 10 +- .../routes/EnvoyEgressRoutesFactory.kt | 4 +- .../envoycontrol/EnvoySnapshotFactoryTest.kt | 4 +- .../snapshot/SnapshotUpdaterTest.kt | 6 +- .../src/main/resources/application.yaml | 8 +- tools/docker-compose.yaml | 146 ++++++++---------- tools/envoy/Dockerfile | 18 +-- tools/envoy/envoy-template.yaml | 17 +- tools/envoy/start_envoy.sh | 44 ++++++ tools/tracing/Dockerfile | 2 - tools/tracing/service.py | 56 ++++--- tools/tracing/start_service.sh | 34 +--- 15 files changed, 196 insertions(+), 183 deletions(-) create mode 100644 tools/envoy/start_envoy.sh diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ControlPlane.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ControlPlane.kt index c875ddb42..3daefce63 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ControlPlane.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ControlPlane.kt @@ -160,7 +160,7 @@ class ControlPlane private constructor( val envoySnapshotFactory = EnvoySnapshotFactory( ingressRoutesFactory = EnvoyIngressRoutesFactory(snapshotProperties, envoyHttpFilters), egressRoutesFactory = EnvoyEgressRoutesFactory(snapshotProperties), - clustersFactory = EnvoyClustersFactory(snapshotProperties), + clustersFactory = EnvoyClustersFactory(snapshotProperties, properties.tracing), endpointsFactory = EnvoyEndpointsFactory( snapshotProperties, ServiceTagMetadataGenerator(snapshotProperties.routing.serviceTags) ), diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index 1322fd2ed..686519067 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -32,6 +32,7 @@ import io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.CommonTlsContext import io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig import io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.TlsParameters import io.envoyproxy.envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext +import pl.allegro.tech.servicemesh.envoycontrol.TracingProperties import pl.allegro.tech.servicemesh.envoycontrol.groups.AllServicesGroup import pl.allegro.tech.servicemesh.envoycontrol.groups.CommunicationMode import pl.allegro.tech.servicemesh.envoycontrol.groups.CommunicationMode.ADS @@ -50,7 +51,8 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.Threshold import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.filters.SanUriMatcherFactory class EnvoyClustersFactory( - private val properties: SnapshotProperties + private val properties: SnapshotProperties, + private val tracingProperties: TracingProperties ) { private val httpProtocolOptions: HttpProtocolOptions = HttpProtocolOptions.newBuilder().setIdleTimeout( Durations.fromMillis(properties.egress.commonHttp.connectionIdleTimeout.toMillis()) @@ -75,7 +77,7 @@ class EnvoyClustersFactory( private val clustersForJWT: List = properties.jwt.providers.values.mapNotNull(this::clusterForOAuthProvider) - private val clustersForTracing: List = listOf(clusterForTracing()) + // private val clustersForTracing: List = listOf(clusterForTracing()) companion object { private val logger by logger() @@ -109,13 +111,17 @@ class EnvoyClustersFactory( } fun getClustersForGroup(group: Group, globalSnapshot: GlobalSnapshot): List { - val edsCluster = getEdsClustersForGroup(group, globalSnapshot) + var edsCluster = getEdsClustersForGroup(group, globalSnapshot) val strictDnsClusters = getStrictDnsClustersForGroup(group) val jwtClusters = clustersForJWT - val rateLimitCluster = getRateLimitClusterForGroup(group, globalSnapshot) - val jaegerCluster = listOf(globalSnapshot.clusters.resources()["jaeger"]!!) - - return edsCluster + strictDnsClusters + jwtClusters + rateLimitCluster + jaegerCluster + val rateLimitCluster = getRateLimitClusterForGroup(group, globalSnapshot) + println("ksksks building clusters") + if (properties.tracing && + tracingProperties.services.contains(group.serviceName) && + edsCluster.none { it.name != "jaeger" }) { + edsCluster = edsCluster + edsCluster(ClusterConfiguration("jaeger", false), ADS) + } + return edsCluster + strictDnsClusters + jwtClusters + rateLimitCluster } private fun clusterForOAuthProvider(provider: OAuthProvider): Cluster? { @@ -170,9 +176,9 @@ class EnvoyClustersFactory( } } - private fun clusterForTracing(): Cluster { - return edsCluster(ClusterConfiguration("jaeger", false), ADS) - } + // private fun clusterForTracing(): Cluster { + // return edsCluster(ClusterConfiguration("jaeger", false), ADS) + // } private fun getRateLimitClusterForGroup(group: Group, globalSnapshot: GlobalSnapshot): List { if (group.proxySettings.incoming.rateLimitEndpoints.containsGlobalRateLimits()) { diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/EnvoyDefaultFilters.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/EnvoyDefaultFilters.kt index 8d23493eb..c7e35f666 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/EnvoyDefaultFilters.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/EnvoyDefaultFilters.kt @@ -2,7 +2,6 @@ package pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.fil import com.google.protobuf.Any import io.envoyproxy.envoy.extensions.filters.http.header_to_metadata.v3.Config -import io.envoyproxy.envoy.extensions.filters.http.router.v3.Router import io.envoyproxy.envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter import pl.allegro.tech.servicemesh.envoycontrol.groups.Group import pl.allegro.tech.servicemesh.envoycontrol.snapshot.GlobalSnapshot @@ -141,7 +140,6 @@ class EnvoyDefaultFilters( private fun envoyRouterHttpFilter(): HttpFilter = HttpFilter .newBuilder() .setName("envoy.filters.http.router") - .setTypedConfig(Any.pack(Router.newBuilder().build())) .build() private fun headerToMetadataHttpFilter(headerToMetadataConfig: Config.Builder): HttpFilter { diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt index f2243fe3b..5f41f1c97 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt @@ -64,7 +64,8 @@ class HttpConnectionManagerFactory( .setPreserveExternalRequestId(listenersConfig.preserveExternalRequestId) if (tracingEnabled) { - connectionManagerBuilder.setTracing(prepareTracing()) + println("ksksks adding tracing") + connectionManagerBuilder.setTracing(tracingConfig) } when (direction) { @@ -171,7 +172,9 @@ class HttpConnectionManagerFactory( } } - private fun prepareTracing(): HttpConnectionManager.Tracing.Builder { + private val tracingConfig = prepareTracing() + + private fun prepareTracing(): HttpConnectionManager.Tracing { val jaegerConfig = ZipkinConfig.newBuilder() .setCollectorCluster("jaeger") .setCollectorEndpoint("/api/v2/spans") @@ -185,7 +188,8 @@ class HttpConnectionManagerFactory( val provider = Tracing.Http.newBuilder() .setName("envoy.tracers.zipkin") .setTypedConfig(Any.pack(jaegerConfig)) + .build() - return HttpConnectionManager.Tracing.newBuilder().setProvider(provider) + return HttpConnectionManager.Tracing.newBuilder().setProvider(provider).build() } } diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/routes/EnvoyEgressRoutesFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/routes/EnvoyEgressRoutesFactory.kt index 5f9e8c954..5e8bb2139 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/routes/EnvoyEgressRoutesFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/routes/EnvoyEgressRoutesFactory.kt @@ -1,6 +1,5 @@ package pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes -import com.google.protobuf.Any import com.google.protobuf.BoolValue import com.google.protobuf.UInt32Value import com.google.protobuf.util.Durations @@ -17,7 +16,6 @@ import io.envoyproxy.envoy.config.route.v3.RouteAction import io.envoyproxy.envoy.config.route.v3.RouteConfiguration import io.envoyproxy.envoy.config.route.v3.RouteMatch import io.envoyproxy.envoy.config.route.v3.VirtualHost -import io.envoyproxy.envoy.extensions.retry.host.previous_hosts.v3.PreviousHostsPredicate import io.envoyproxy.envoy.type.matcher.v3.RegexMatcher import pl.allegro.tech.servicemesh.envoycontrol.groups.RateLimitedRetryBackOff import pl.allegro.tech.servicemesh.envoycontrol.groups.RetryBackOff @@ -331,7 +329,7 @@ class RequestPolicyMapper private constructor() { retryPolicyBuilder: RetryPolicy.Builder ) { hostPredicates.map { - RetryPolicy.RetryHostPredicate.newBuilder().setName(it.name).setTypedConfig(Any.pack(PreviousHostsPredicate.newBuilder().build())).build() + RetryPolicy.RetryHostPredicate.newBuilder().setName(it.name).build() }.also { retryPolicyBuilder.addAllRetryHostPredicate(it) } diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt index 057d0ef41..bdf918b6f 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/EnvoySnapshotFactoryTest.kt @@ -324,10 +324,10 @@ class EnvoySnapshotFactoryTest { ) { Metadata.getDefaultInstance() } ) val egressRoutesFactory = EnvoyEgressRoutesFactory(properties) - val clustersFactory = EnvoyClustersFactory(properties) + val clustersFactory = EnvoyClustersFactory(properties, TracingProperties()) val endpointsFactory = EnvoyEndpointsFactory(properties, ServiceTagMetadataGenerator()) val envoyHttpFilters = EnvoyHttpFilters.defaultFilters(properties) - val listenersFactory = EnvoyListenersFactory(properties, envoyHttpFilters) + val listenersFactory = EnvoyListenersFactory(properties, envoyHttpFilters, TracingProperties()) val snapshotsVersions = SnapshotsVersions() val meterRegistry: MeterRegistry = SimpleMeterRegistry() diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt index 752916f3c..22b1c0803 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt @@ -19,6 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource import org.mockito.Mockito +import pl.allegro.tech.servicemesh.envoycontrol.TracingProperties import pl.allegro.tech.servicemesh.envoycontrol.groups.AccessLogFilterSettings import pl.allegro.tech.servicemesh.envoycontrol.groups.AllServicesGroup import pl.allegro.tech.servicemesh.envoycontrol.groups.CommunicationMode @@ -1227,13 +1228,14 @@ class SnapshotUpdaterTest { EnvoySnapshotFactory( ingressRoutesFactory = EnvoyIngressRoutesFactory(snapshotProperties), egressRoutesFactory = EnvoyEgressRoutesFactory(snapshotProperties), - clustersFactory = EnvoyClustersFactory(snapshotProperties), + clustersFactory = EnvoyClustersFactory(snapshotProperties, TracingProperties()), endpointsFactory = EnvoyEndpointsFactory( snapshotProperties, ServiceTagMetadataGenerator(snapshotProperties.routing.serviceTags) ), listenersFactory = EnvoyListenersFactory( snapshotProperties, - EnvoyHttpFilters.emptyFilters + EnvoyHttpFilters.emptyFilters, + TracingProperties() ), // Remember when LDS change we have to send RDS again snapshotsVersions = SnapshotsVersions(), diff --git a/envoy-control-runner/src/main/resources/application.yaml b/envoy-control-runner/src/main/resources/application.yaml index 2b50d9d62..01d8288a8 100644 --- a/envoy-control-runner/src/main/resources/application.yaml +++ b/envoy-control-runner/src/main/resources/application.yaml @@ -6,15 +6,15 @@ application: envoy-control: tracing: services: - - front-proxy - - service1 - - service2 - - service3 + - s1 + - s2 + - s3 source: consul: host: localhost envoy: snapshot: +# tracing: true outgoing-permissions: enabled: true diff --git a/tools/docker-compose.yaml b/tools/docker-compose.yaml index fb4be4cf5..4e9e42080 100644 --- a/tools/docker-compose.yaml +++ b/tools/docker-compose.yaml @@ -3,7 +3,7 @@ version: '3' services: consul: container_name: consul - image: consul:1.5.3 + image: consul:1.10.12 ports: - "18500:8500" - "18300:8300" @@ -12,100 +12,98 @@ services: - ./tmp/_data/consul:/data command: agent -server -data-dir=/data -bind 0.0.0.0 -client 0.0.0.0 -bootstrap-expect=1 -ui - http-echo: - depends_on: - - consul + s1-envoy: build: - context: ./service + context: ./envoy dockerfile: Dockerfile - ports: - - "80:80" - - flask_service: - build: - context: ./flask - image: flask_service:python-3.10-slim-bullseye - restart: "no" - deploy: - replicas: 0 + container_name: s1-envoy + depends_on: + - consul + environment: + - SERVICE_NAME=s1 + - SERVICE_HOST=s1 + - SERVICE_PORT=8070 + - HEALTH_CHECK=/health-check + ports: + - "30000:31000" + - "30001:31001" + - "30002:9999" - tracing: + s1: + container_name: s1 build: context: ./tracing - image: envoyproxy:tracing - restart: "no" - deploy: - replicas: 0 - - flask-service: - build: - context: ./flask - restart: "no" - deploy: - replicas: 0 - - s1: - depends_on: - - consul - image: envoyproxy:tracing + dockerfile: Dockerfile volumes: - ./service1/service1-envoy.yaml:/etc/service-envoy.yaml environment: - - SERVICE_NAME=1 + - SERVICE_NAME=s1 - PORT=8070 - expose: - - 8070 - - 9999 + - ENVOY_HOST=s1-envoy ports: - - "10001:9999" + - "10001:8070" - s2: - depends_on: + s2-envoy: + build: + context: ./envoy + dockerfile: Dockerfile + container_name: s2-envoy + depends_on: - consul - image: envoyproxy:tracing - volumes: - - ./service2/service2-envoy.yaml:/etc/service-envoy.yaml environment: - - SERVICE_NAME=2 - - PORT=8070 - expose: - - 8070 - - 9999 + - SERVICE_NAME=s2 + - SERVICE_HOST=s2 + - SERVICE_PORT=8070 + - HEALTH_CHECK=/health-check ports: - - "10002:9999" - + - "31000:31000" + - "31001:31001" + - "31002:9999" - s3: - depends_on: - - consul - image: envoyproxy:tracing + s2: + container_name: s2 + build: + context: ./tracing + dockerfile: Dockerfile volumes: - - ./service3/service3-envoy.yaml:/etc/service-envoy.yaml + - ./service1/service1-envoy.yaml:/etc/service-envoy.yaml environment: - - SERVICE_NAME=3 + - SERVICE_NAME=s2 - PORT=8070 - expose: - - 8070 - - 9999 + - ENVOY_HOST=s2-envoy ports: - - "10003:9999" + - "11001:8070" - s3-2: + s3-envoy: + build: + context: ./envoy + dockerfile: Dockerfile + container_name: s3-envoy depends_on: - consul - image: envoyproxy:tracing + environment: + - SERVICE_NAME=s3 + - SERVICE_HOST=s3 + - SERVICE_PORT=8070 + - HEALTH_CHECK=/health-check + ports: + - "32000:31000" + - "32001:31001" + - "32002:9999" + + s3: + container_name: s3 + build: + context: ./tracing + dockerfile: Dockerfile volumes: - - ./service3/service3-envoy.yaml:/etc/service-envoy.yaml + - ./service1/service1-envoy.yaml:/etc/service-envoy.yaml environment: - - SERVICE_NAME=3 - - SERVICE_INSTANCE=2 + - SERVICE_NAME=s3 - PORT=8070 - expose: - - 8070 - - 9999 + - ENVOY_HOST=s3-envoy ports: - - "10004:9999" - + - "12001:8070" jaeger: depends_on: @@ -120,16 +118,6 @@ services: - "16686:16686" - "16687:16687" - front-proxy: - build: - context: ./envoy - dockerfile: Dockerfile - ports: - - "9999:9999" - - "31000:31000" - - "31001:31001" - - "8000:8000" - envoy-control: container_name: envoy-control build: diff --git a/tools/envoy/Dockerfile b/tools/envoy/Dockerfile index fd9b8da54..5aff1ae52 100644 --- a/tools/envoy/Dockerfile +++ b/tools/envoy/Dockerfile @@ -1,25 +1,23 @@ FROM envoyproxy/envoy:v1.21.0 -ENV PORT=9999:9999 -ENV PORT=80:80 -ENV ENVOY_NODE_ID=front-proxy-id -ENV ENVOY_NODE_CLUSTER=front-proxy ENV ENVOY_EGRESS_LISTENER_PORT=31000 ENV ENVOY_INGRESS_LISTENER_PORT=31001 ENV ENVOY_ADMIN_PORT=9999 ENV ENVOY_XDS_PORT=50000 ENV ENVOY_XDS_HOST=host.docker.internal +ENV SERVICE_NAME=abc +ENV SERVICE_HOST=abc +ENV SERVICE_PORT=123 + +RUN apt update && apt install curl -y ADD envoy-template.yaml /etc/envoy/envoy.yaml ADD ingress-access.log /home/envoy/ingress-access.log -RUN sed -i "s/{{.EgressListenerPort}}/${ENVOY_EGRESS_LISTENER_PORT}/g" /etc/envoy/envoy.yaml -RUN sed -i "s/{{.IngressListenerPort}}/${ENVOY_INGRESS_LISTENER_PORT}/g" /etc/envoy/envoy.yaml -RUN sed -i "s/{{.XdsHost}}/${ENVOY_XDS_HOST}/g" /etc/envoy/envoy.yaml -RUN sed -i "s/{{.XdsPort}}/${ENVOY_XDS_PORT}/g" /etc/envoy/envoy.yaml -RUN sed -i "s/{{.AdminPort}}/${ENVOY_ADMIN_PORT}/g" /etc/envoy/envoy.yaml EXPOSE 80 443 9999 RUN mkdir envoy -CMD envoy -c /etc/envoy/envoy.yaml --service-cluster $ENVOY_NODE_CLUSTER --service-node $ENVOY_NODE_ID +ADD ./start_envoy.sh /usr/local/bin/start_envoy.sh +RUN chmod u+x /usr/local/bin/start_envoy.sh +ENTRYPOINT ["/usr/local/bin/start_envoy.sh"] diff --git a/tools/envoy/envoy-template.yaml b/tools/envoy/envoy-template.yaml index 396f08c80..f10f01d45 100644 --- a/tools/envoy/envoy-template.yaml +++ b/tools/envoy/envoy-template.yaml @@ -2,7 +2,7 @@ node: metadata: ads: true - service_name: front-proxy + service_name: {{.ServiceName}} ingress_host: "0.0.0.0" ingress_port: {{.IngressListenerPort}} egress_host: "0.0.0.0" @@ -10,7 +10,8 @@ node: proxy_settings: outgoing: dependencies: - - service: "service1" + - service: "*" + generate_request_id: true locality: zone: default-zone @@ -38,6 +39,18 @@ static_resources: seconds: 1 http_protocol_options: allow_absolute_url: true + - name: local_service + type: STRICT_DNS + load_assignment: + cluster_name: local_service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: {{.ServiceHost}} + port_value: {{.ServicePort}} + connect_timeout: 1s - name: this_admin type: STATIC load_assignment: diff --git a/tools/envoy/start_envoy.sh b/tools/envoy/start_envoy.sh new file mode 100644 index 000000000..423841ba0 --- /dev/null +++ b/tools/envoy/start_envoy.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# set -o pipefail +# set -o errexit + +port="${ENVOY_INGRESS_LISTENER_PORT}" +service_name="${SERVICE_NAME}" +instance_id="${service_name}-1" + +echo "Registering instance of ${service_name} in consul" +echo "=============================" +echo +echo + +ip="$(hostname -i)" + +body=' +{ + "ID": "'${instance_id}'", + "Name": "'${service_name}'", + "Tags": [ + "primary" + ], + "Address": "'${ip}'", + "Port": '${port}', + "Check": { + "DeregisterCriticalServiceAfter": "90m", + "http": "http://'${ip}:${port}${HEALTH_CHECK}'", + "Interval": "10s" + } +} +' + +sed -i "s/{{.EgressListenerPort}}/${ENVOY_EGRESS_LISTENER_PORT}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.IngressListenerPort}}/${ENVOY_INGRESS_LISTENER_PORT}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.XdsHost}}/${ENVOY_XDS_HOST}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.XdsPort}}/${ENVOY_XDS_PORT}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.AdminPort}}/${ENVOY_ADMIN_PORT}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.ServiceName}}/${SERVICE_NAME}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.ServiceHost}}/${SERVICE_HOST}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.ServicePort}}/${SERVICE_PORT}/g" /etc/envoy/envoy.yaml + +curl -X PUT --fail --data "${body}" -s consul:8500/v1/agent/service/register + +envoy -c /etc/envoy/envoy.yaml --service-cluster "${service_name}" --service-node "${instance_id}" diff --git a/tools/tracing/Dockerfile b/tools/tracing/Dockerfile index 017d4d5c6..0185f639e 100644 --- a/tools/tracing/Dockerfile +++ b/tools/tracing/Dockerfile @@ -1,7 +1,5 @@ FROM flask_service:python-3.10-slim-bullseye -COPY --from=envoyproxy/envoy-dev:latest /usr/local/bin/envoy /usr/local/bin/envoy - RUN apt-get update && apt-get install curl -y ADD requirements.txt /tmp/requirements.txt diff --git a/tools/tracing/service.py b/tools/tracing/service.py index 9087aade3..5f2c2c9ac 100644 --- a/tools/tracing/service.py +++ b/tools/tracing/service.py @@ -5,8 +5,6 @@ import socket import sys -app = Flask(__name__) - TRACE_HEADERS_TO_PROPAGATE = [ 'X-Ot-Span-Context', 'X-Request-Id', @@ -25,38 +23,36 @@ "sw8" ] -s = int(os.environ['SERVICE_NAME']) - - -@app.route('/service/') -def hello(service_number): - return ( - 'Hello from behind Envoy (service {})! hostname: {} resolved' - 'hostname: {}\n'.format( - os.environ['SERVICE_NAME'], socket.gethostname(), - socket.gethostbyname(socket.gethostname()))) - +app = Flask(__name__) @app.route('/health-check') def health_check(): - return ('', 200) - - -@app.route('/trace') -def trace(): - headers = {} - - if s == 1 or s == 2: - for header in TRACE_HEADERS_TO_PROPAGATE: - if header in request.headers: - headers[header] = request.headers[header] - requests.get("http://localhost:9000/trace", headers=headers) + return (os.environ['SERVICE_NAME'], 200) + + +@app.route('/proxy//') +def proxy2(first, second): + headers = { + 'Host': first + } + for header in TRACE_HEADERS_TO_PROPAGATE: + if header in request.headers: + headers[header] = request.headers[header] + resp = requests.get(f"{os.environ['ENVOY_HOST']}:31000/{second}", headers=headers) + return (resp.text, 200) + + +@app.route('/proxy/') +def proxy(first): + headers = { + 'Host': first + } + for header in TRACE_HEADERS_TO_PROPAGATE: + if header in request.headers: + headers[header] = request.headers[header] + resp = requests.get(f"{os.environ['ENVOY_HOST']}:31000/health-check", headers=headers) + return (resp.text, 200) - return ( - 'Hello from behind Envoy (service {})! hostname: {} resolved' - 'hostname: {}\n'.format( - os.environ['SERVICE_NAME'], socket.gethostname(), - socket.gethostbyname(socket.gethostname()))) if __name__ == "__main__": diff --git a/tools/tracing/start_service.sh b/tools/tracing/start_service.sh index 915b15008..9646b1028 100644 --- a/tools/tracing/start_service.sh +++ b/tools/tracing/start_service.sh @@ -2,36 +2,4 @@ # set -o pipefail # set -o errexit -port="${PORT}" -service_name="service${SERVICE_NAME}" -instance_id="${service_name}-${SERVICE_INSTANCE:-1}" - -echo "Registering instance of ${service_name} in consul" -echo "=============================" -echo -echo - -ip="$(hostname -i)" - -body=' -{ - "ID": "'${instance_id}'", - "Name": "'${service_name}'", - "Tags": [ - "primary" - ], - "Address": "'${ip}'", - "Port": '${port}', - "Check": { - "DeregisterCriticalServiceAfter": "90m", - "http": "http://'${ip}:${port}'/health-check", - "Interval": "10s" - } -} -' - -curl -X PUT --fail --data "${body}" -s consul:8500/v1/agent/service/register - -python3 /code/service.py & -# jak nazwać node'a? -envoy -c /etc/service-envoy.yaml --service-cluster "${service_name}" --service-node "${instance_id}" +python3 /code/service.py From cd0caee9f031def5cfad6fef1c5dd4c5a2cd6dcf Mon Sep 17 00:00:00 2001 From: Kamil Smigielski Date: Thu, 8 Dec 2022 16:58:36 +0100 Subject: [PATCH 2/5] working proxy --- tools/tracing/service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tracing/service.py b/tools/tracing/service.py index 5f2c2c9ac..22c612ade 100644 --- a/tools/tracing/service.py +++ b/tools/tracing/service.py @@ -38,7 +38,7 @@ def proxy2(first, second): for header in TRACE_HEADERS_TO_PROPAGATE: if header in request.headers: headers[header] = request.headers[header] - resp = requests.get(f"{os.environ['ENVOY_HOST']}:31000/{second}", headers=headers) + resp = requests.get(f"http://{os.environ['ENVOY_HOST']}:31000/proxy/{second}", headers=headers) return (resp.text, 200) @@ -50,7 +50,7 @@ def proxy(first): for header in TRACE_HEADERS_TO_PROPAGATE: if header in request.headers: headers[header] = request.headers[header] - resp = requests.get(f"{os.environ['ENVOY_HOST']}:31000/health-check", headers=headers) + resp = requests.get(f"http://{os.environ['ENVOY_HOST']}:31000/health-check", headers=headers) return (resp.text, 200) From 41e2cf20ce52006a526aa25f0cfce84cbdfc49c3 Mon Sep 17 00:00:00 2001 From: Kamil Smigielski Date: Thu, 8 Dec 2022 23:17:37 +0100 Subject: [PATCH 3/5] working proxy --- .../snapshot/EnvoySnapshotFactory.kt | 1 - .../resource/clusters/EnvoyClustersFactory.kt | 9 +++------ .../listeners/EnvoyListenersFactory.kt | 3 +++ .../filters/HttpConnectionManagerFactory.kt | 5 ++--- .../main/resources/application-docker.yaml | 16 ++++++++++++++- .../src/main/resources/application-local.yaml | 20 ++++++++++++++++--- .../src/main/resources/application.yaml | 7 ++++++- tools/envoy-control/Dockerfile | 2 +- tools/envoy/Dockerfile | 1 + tools/envoy/envoy-template.yaml | 2 +- tools/envoy/start_envoy.sh | 2 ++ tools/tracing/service.py | 3 +++ 12 files changed, 54 insertions(+), 17 deletions(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt index 498db7785..a83a3d3bb 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/EnvoySnapshotFactory.kt @@ -149,7 +149,6 @@ class EnvoySnapshotFactory( fun getSnapshotForGroup(group: Group, globalSnapshot: GlobalSnapshot): Snapshot { val groupSample = Timer.start(meterRegistry) - val newSnapshotForGroup = newSnapshotForGroup(group, globalSnapshot) groupSample.stop(meterRegistry.timer("snapshot-factory.get-snapshot-for-group.time")) return newSnapshotForGroup diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index 686519067..72bcb44d5 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -49,6 +49,7 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.OAuthProvider import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties import pl.allegro.tech.servicemesh.envoycontrol.snapshot.Threshold import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.filters.SanUriMatcherFactory +import kotlin.math.log class EnvoyClustersFactory( private val properties: SnapshotProperties, @@ -110,17 +111,13 @@ class EnvoyClustersFactory( } } + val logger by logger() + fun getClustersForGroup(group: Group, globalSnapshot: GlobalSnapshot): List { var edsCluster = getEdsClustersForGroup(group, globalSnapshot) val strictDnsClusters = getStrictDnsClustersForGroup(group) val jwtClusters = clustersForJWT val rateLimitCluster = getRateLimitClusterForGroup(group, globalSnapshot) - println("ksksks building clusters") - if (properties.tracing && - tracingProperties.services.contains(group.serviceName) && - edsCluster.none { it.name != "jaeger" }) { - edsCluster = edsCluster + edsCluster(ClusterConfiguration("jaeger", false), ADS) - } return edsCluster + strictDnsClusters + jwtClusters + rateLimitCluster } diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt index 9dfcf5c56..75536be8b 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt @@ -24,6 +24,7 @@ import pl.allegro.tech.servicemesh.envoycontrol.groups.Dependency import pl.allegro.tech.servicemesh.envoycontrol.groups.DomainDependency import pl.allegro.tech.servicemesh.envoycontrol.groups.Group import pl.allegro.tech.servicemesh.envoycontrol.groups.ListenersConfig +import pl.allegro.tech.servicemesh.envoycontrol.logger import pl.allegro.tech.servicemesh.envoycontrol.snapshot.EnvoySnapshotFactory.Companion.DEFAULT_HTTP_PORT import pl.allegro.tech.servicemesh.envoycontrol.snapshot.GlobalSnapshot import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties @@ -298,6 +299,8 @@ class EnvoyListenersFactory( } } + val logger by logger() + private fun createHttpProxyFilterChainForDomains( group: Group, port: Int, diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt index 5f41f1c97..ece41dc3e 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt @@ -22,6 +22,7 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.HttpFilterFactory import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.config.LocalReplyConfigFactory import com.google.protobuf.Any +import pl.allegro.tech.servicemesh.envoycontrol.logger class HttpConnectionManagerFactory( val snapshotProperties: SnapshotProperties, @@ -43,7 +44,7 @@ class HttpConnectionManagerFactory( private val defaultApiConfigSourceV3: ApiConfigSource = apiConfigSource() private val accessLogFilter = AccessLogFilter(snapshotProperties) - + private val logger by logger() @SuppressWarnings("LongParameterList") fun createFilter( group: Group, @@ -62,9 +63,7 @@ class HttpConnectionManagerFactory( .setRds(setupRds(group.communicationMode, initialFetchTimeout, routeConfigName)) .setGenerateRequestId(BoolValue.newBuilder().setValue(listenersConfig.generateRequestId).build()) .setPreserveExternalRequestId(listenersConfig.preserveExternalRequestId) - if (tracingEnabled) { - println("ksksks adding tracing") connectionManagerBuilder.setTracing(tracingConfig) } diff --git a/envoy-control-runner/src/main/resources/application-docker.yaml b/envoy-control-runner/src/main/resources/application-docker.yaml index 4b6460432..a29ab9787 100644 --- a/envoy-control-runner/src/main/resources/application-docker.yaml +++ b/envoy-control-runner/src/main/resources/application-docker.yaml @@ -3,7 +3,21 @@ envoy-control: consul: host: consul port: 8500 + tracing: + services: + - s1 + - s2 + - s3 + envoy: + snapshot: + tracing: true + outgoing-permissions: + enabled: true + services-allowed-to-use-wildcard: + - s1 + - s2 + - s3 chaos: username: "user" - password: "pass" \ No newline at end of file + password: "pass" diff --git a/envoy-control-runner/src/main/resources/application-local.yaml b/envoy-control-runner/src/main/resources/application-local.yaml index f89a8ada0..a29ab9787 100644 --- a/envoy-control-runner/src/main/resources/application-local.yaml +++ b/envoy-control-runner/src/main/resources/application-local.yaml @@ -1,9 +1,23 @@ envoy-control: source: consul: - host: localhost - port: 18500 + host: consul + port: 8500 + tracing: + services: + - s1 + - s2 + - s3 + envoy: + snapshot: + tracing: true + outgoing-permissions: + enabled: true + services-allowed-to-use-wildcard: + - s1 + - s2 + - s3 chaos: username: "user" - password: "pass" \ No newline at end of file + password: "pass" diff --git a/envoy-control-runner/src/main/resources/application.yaml b/envoy-control-runner/src/main/resources/application.yaml index 01d8288a8..6ed7dcf8c 100644 --- a/envoy-control-runner/src/main/resources/application.yaml +++ b/envoy-control-runner/src/main/resources/application.yaml @@ -14,9 +14,14 @@ envoy-control: host: localhost envoy: snapshot: -# tracing: true + tracing: true outgoing-permissions: enabled: true + services-allowed-to-use-wildcard: + - s1 + - s2 + - s3 + chaos: username: "user" diff --git a/tools/envoy-control/Dockerfile b/tools/envoy-control/Dockerfile index 790daa9f0..f74c2d31e 100644 --- a/tools/envoy-control/Dockerfile +++ b/tools/envoy-control/Dockerfile @@ -1,9 +1,9 @@ FROM gradle:6.6.1-jdk11 AS builder COPY --chown=gradle:gradle settings.gradle build.gradle gradle.properties /home/gradle/src/ -COPY --chown=gradle:gradle envoy-control-core/ /home/gradle/src/envoy-control-core/ COPY --chown=gradle:gradle envoy-control-runner/ /home/gradle/src/envoy-control-runner/ COPY --chown=gradle:gradle envoy-control-services/ /home/gradle/src/envoy-control-services/ COPY --chown=gradle:gradle envoy-control-source-consul/ /home/gradle/src/envoy-control-source-consul/ +COPY --chown=gradle:gradle envoy-control-core/ /home/gradle/src/envoy-control-core/ WORKDIR /home/gradle/src RUN gradle :envoy-control-runner:assemble --parallel --no-daemon diff --git a/tools/envoy/Dockerfile b/tools/envoy/Dockerfile index 5aff1ae52..8692db84a 100644 --- a/tools/envoy/Dockerfile +++ b/tools/envoy/Dockerfile @@ -8,6 +8,7 @@ ENV ENVOY_XDS_HOST=host.docker.internal ENV SERVICE_NAME=abc ENV SERVICE_HOST=abc ENV SERVICE_PORT=123 +ENV DEPENDENCY_SERVICE="*" RUN apt update && apt install curl -y diff --git a/tools/envoy/envoy-template.yaml b/tools/envoy/envoy-template.yaml index f10f01d45..bcda55594 100644 --- a/tools/envoy/envoy-template.yaml +++ b/tools/envoy/envoy-template.yaml @@ -10,7 +10,7 @@ node: proxy_settings: outgoing: dependencies: - - service: "*" + - service: "{{.DependencyService}}" generate_request_id: true locality: zone: default-zone diff --git a/tools/envoy/start_envoy.sh b/tools/envoy/start_envoy.sh index 423841ba0..7d00c81cc 100644 --- a/tools/envoy/start_envoy.sh +++ b/tools/envoy/start_envoy.sh @@ -38,6 +38,8 @@ sed -i "s/{{.AdminPort}}/${ENVOY_ADMIN_PORT}/g" /etc/envoy/envoy.yaml sed -i "s/{{.ServiceName}}/${SERVICE_NAME}/g" /etc/envoy/envoy.yaml sed -i "s/{{.ServiceHost}}/${SERVICE_HOST}/g" /etc/envoy/envoy.yaml sed -i "s/{{.ServicePort}}/${SERVICE_PORT}/g" /etc/envoy/envoy.yaml +sed -i "s/{{.DependencyService}}/${DEPENDENCY_SERVICE}/g" /etc/envoy/envoy.yaml + curl -X PUT --fail --data "${body}" -s consul:8500/v1/agent/service/register diff --git a/tools/tracing/service.py b/tools/tracing/service.py index 22c612ade..e0fa5c119 100644 --- a/tools/tracing/service.py +++ b/tools/tracing/service.py @@ -4,6 +4,7 @@ import requests import socket import sys +import json TRACE_HEADERS_TO_PROPAGATE = [ 'X-Ot-Span-Context', @@ -35,6 +36,7 @@ def proxy2(first, second): headers = { 'Host': first } + print(request.headers, file=sys.stderr) for header in TRACE_HEADERS_TO_PROPAGATE: if header in request.headers: headers[header] = request.headers[header] @@ -47,6 +49,7 @@ def proxy(first): headers = { 'Host': first } + print(request.headers, file=sys.stderr) for header in TRACE_HEADERS_TO_PROPAGATE: if header in request.headers: headers[header] = request.headers[header] From a53096504556a8972210d8791c88061516c481f2 Mon Sep 17 00:00:00 2001 From: Kamil Smigielski Date: Fri, 9 Dec 2022 09:11:22 +0100 Subject: [PATCH 4/5] working tracing --- tools/jaeger/register_and_run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/jaeger/register_and_run.sh b/tools/jaeger/register_and_run.sh index 970c668a6..b8962ad3c 100644 --- a/tools/jaeger/register_and_run.sh +++ b/tools/jaeger/register_and_run.sh @@ -3,7 +3,7 @@ set -o pipefail set -o errexit -port=16686 +port=9411 service_name=jaeger instance_id="${service_name}-1" @@ -25,11 +25,11 @@ body=' "Port": '${port}', "Check": { "DeregisterCriticalServiceAfter": "90m", - "http": "http://'${ip}:${port}'", + "http": "http://'${ip}':14269", "Interval": "10s" } } ' curl -X PUT --fail --data "${body}" -s consul:8500/v1/agent/service/register -/go/bin/all-in-one-linux +/go/bin/all-in-one-linux --collector.zipkin.host-port=9411 From f74aa339dfb3c6b398fab2fd2c5c0bc49d222f0b Mon Sep 17 00:00:00 2001 From: Kamil Smigielski Date: Fri, 9 Dec 2022 09:14:27 +0100 Subject: [PATCH 5/5] working tracing --- .../snapshot/resource/clusters/EnvoyClustersFactory.kt | 5 +---- .../snapshot/resource/listeners/EnvoyListenersFactory.kt | 3 --- .../listeners/filters/HttpConnectionManagerFactory.kt | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index 72bcb44d5..103940155 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -49,7 +49,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.OAuthProvider import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties import pl.allegro.tech.servicemesh.envoycontrol.snapshot.Threshold import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.listeners.filters.SanUriMatcherFactory -import kotlin.math.log class EnvoyClustersFactory( private val properties: SnapshotProperties, @@ -111,10 +110,8 @@ class EnvoyClustersFactory( } } - val logger by logger() - fun getClustersForGroup(group: Group, globalSnapshot: GlobalSnapshot): List { - var edsCluster = getEdsClustersForGroup(group, globalSnapshot) + val edsCluster = getEdsClustersForGroup(group, globalSnapshot) val strictDnsClusters = getStrictDnsClustersForGroup(group) val jwtClusters = clustersForJWT val rateLimitCluster = getRateLimitClusterForGroup(group, globalSnapshot) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt index 75536be8b..9dfcf5c56 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/EnvoyListenersFactory.kt @@ -24,7 +24,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.groups.Dependency import pl.allegro.tech.servicemesh.envoycontrol.groups.DomainDependency import pl.allegro.tech.servicemesh.envoycontrol.groups.Group import pl.allegro.tech.servicemesh.envoycontrol.groups.ListenersConfig -import pl.allegro.tech.servicemesh.envoycontrol.logger import pl.allegro.tech.servicemesh.envoycontrol.snapshot.EnvoySnapshotFactory.Companion.DEFAULT_HTTP_PORT import pl.allegro.tech.servicemesh.envoycontrol.snapshot.GlobalSnapshot import pl.allegro.tech.servicemesh.envoycontrol.snapshot.SnapshotProperties @@ -299,8 +298,6 @@ class EnvoyListenersFactory( } } - val logger by logger() - private fun createHttpProxyFilterChainForDomains( group: Group, port: Int, diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt index ece41dc3e..4833613b9 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/listeners/filters/HttpConnectionManagerFactory.kt @@ -44,7 +44,7 @@ class HttpConnectionManagerFactory( private val defaultApiConfigSourceV3: ApiConfigSource = apiConfigSource() private val accessLogFilter = AccessLogFilter(snapshotProperties) - private val logger by logger() + @SuppressWarnings("LongParameterList") fun createFilter( group: Group,