Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log level present in extra args using envoy-extra-args annotation : NET-2190 #133

Conversation

absolutelightning
Copy link
Contributor

@absolutelightning absolutelightning commented Jun 1, 2023

PR fixes - hashicorp/consul-k8s#1846

Short description of Issue - The consul.hashicorp.com/envoy-extra-args annotation is not compatible with Consul DataPlane. When we pass extra loglevel in consul.hashicorp.com/envoy-extra-args pod shows that the consul-dataplane container already has log-level explicitly set to INFO and service errors out.

Solution -
Discussed and agreed upon solution is to override the log level in case extra args also has log level given.

Tested this PR by creating a docker image for consul dataplane, pushing it hub and using the image in this tutorial
I have tested by using my image in tutorial -

imageConsulDataplane: "absolutelightning/consul-dataplane:latest"

Here are the tests results -

➜  eks git:(main) ✗ kubectl describe pod counting-797cfb8f4
     Container ID:   containerd://058a5bbcd47dabb2801b97ea74d0dfe63f1672dce1dba2bb31dc842496aad478
      Image:          hashicorp/counting-service:0.0.2
      Image ID:       docker.io/hashicorp/counting-service@sha256:ba4ec6f77f4cdbf6abbc1259ae8d9616155e54625e814e6da949bce82adb00e9
      Port:           9001/TCP
      Host Port:      0/TCP
      State:          Running
        Started:      Fri, 02 Jun 2023 09:35:19 +0530
      Ready:          True
      Restart Count:  0
      Environment:    <none>
      Mounts:
        /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-nk8ws (ro)
    consul-dataplane:
      Container ID:  containerd://b514c6624160986b97ae47e95989cdd83cadd61b1c8a93bbd43872b44a80a38d
      Image:         absolutelightning/consul-dataplane:latest
      Image ID:      docker.io/absolutelightning/consul-dataplane@sha256:4fc1725456d29f93c2ba076347bb3a76fa09300ad4ddbabd845293c96bd4f616
      Port:          <none>
      Host Port:     <none>
      Args:
        -addresses
        consul-server.consul.svc.cluster.local
        -grpc-port=8502
        -proxy-service-id-path=/consul/connect-inject/proxyid
        -log-level=info
        -log-json=false
        -envoy-concurrency=2
        -tls-disabled
        -telemetry-prom-scrape-path=/metrics
        --
        --log-level
        debug
      State:          Running
        Started:      Fri, 02 Jun 2023 09:35:24 +0530
      Ready:          True
      Restart Count:  0
      Readiness:      tcp-socket :20000 delay=1s timeout=1s period=10s #success=1 #failure=3
      Environment:
        TMPDIR:                /consul/connect-inject
        NODE_NAME:              (v1:spec.nodeName)
        DP_SERVICE_NODE_NAME:  $(NODE_NAME)-virtual
      Mounts:
        /consul/connect-inject from consul-connect-inject-data (rw)
        /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-nk8ws (ro)
  Conditions:
   

Logs of consul data plane -

kubectl logs -f counting-797cfb8f4-qcjg2 -c consul-dataplane


2023-06-02T04:18:25.672Z [INFO]  consul-dataplane: started consul-dataplane process
2023-06-02T04:18:25.673Z [INFO]  consul-dataplane.server-connection-manager: trying to connect to a Consul server
2023-06-02T04:18:25.682Z [INFO]  consul-dataplane.server-connection-manager: discovered Consul servers: addresses=[10.0.6.204:8502, 10.0.4.249:8502, 10.0.5.9:8502]
2023-06-02T04:18:25.683Z [INFO]  consul-dataplane.server-connection-manager: current prioritized list of known Consul servers: addresses=[10.0.6.204:8502, 10.0.4.249:8502, 10.0.5.9:8502]
2023-06-02T04:18:25.689Z [INFO]  consul-dataplane.server-connection-manager: connected to Consul server: address=10.0.6.204:8502
2023-06-02T04:18:25.689Z [INFO]  consul-dataplane: connected to Consul server over gRPC: initial_server_address=10.0.6.204:8502
2023-06-02T04:18:25.690Z [INFO]  consul-dataplane: starting envoy xDS server: address=127.0.0.1:33537
2023-06-02T04:18:25.690Z [INFO]  consul-dataplane.server-connection-manager: updated known Consul servers from watch stream: addresses=[10.0.5.9:8502, 10.0.4.249:8502, 10.0.6.204:8502]
2023-06-02T04:18:25.694Z [INFO]  consul-dataplane: dns proxy disabled: configure the Consul DNS port to enable
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15) initializing epoch 0 (base id=0, hot restart version=disabled)
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15) statically linked extensions:
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.resource_monitors: envoy.resource_monitors.fixed_heap, envoy.resource_monitors.injected_resource
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.stateful_session: envoy.http.stateful_session.cookie, envoy.http.stateful_session.header
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.access_loggers.extension_filters: envoy.access_loggers.extension_filters.cel
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.transport_sockets.downstream: envoy.transport_sockets.alts, envoy.transport_sockets.quic, envoy.transport_sockets.raw_buffer, envoy.transport_sockets.starttls, envoy.transport_sockets.tap, envoy.transport_sockets.tcp_stats, envoy.transport_sockets.tls, raw_buffer, starttls, tls
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.quic.server_preferred_address: quic.server_preferred_address.fixed
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.resolvers: envoy.ip
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.dubbo_proxy.filters: envoy.filters.dubbo.router
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.original_ip_detection: envoy.http.original_ip_detection.custom_header, envoy.http.original_ip_detection.xff
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.udp_packet_writer: envoy.udp_packet_writer.default, envoy.udp_packet_writer.gso
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.filters.network: envoy.echo, envoy.ext_authz, envoy.filters.network.connection_limit, envoy.filters.network.direct_response, envoy.filters.network.dubbo_proxy, envoy.filters.network.echo, envoy.filters.network.ext_authz, envoy.filters.network.http_connection_manager, envoy.filters.network.local_ratelimit, envoy.filters.network.mongo_proxy, envoy.filters.network.ratelimit, envoy.filters.network.rbac, envoy.filters.network.redis_proxy, envoy.filters.network.sni_cluster, envoy.filters.network.sni_dynamic_forward_proxy, envoy.filters.network.tcp_proxy, envoy.filters.network.thrift_proxy, envoy.filters.network.wasm, envoy.filters.network.zookeeper_proxy, envoy.http_connection_manager, envoy.mongo_proxy, envoy.ratelimit, envoy.redis_proxy, envoy.tcp_proxy
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.common.key_value: envoy.key_value.file_based
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.matching.http.input: envoy.matching.inputs.destination_ip, envoy.matching.inputs.destination_port, envoy.matching.inputs.direct_source_ip, envoy.matching.inputs.dns_san, envoy.matching.inputs.request_headers, envoy.matching.inputs.request_trailers, envoy.matching.inputs.response_headers, envoy.matching.inputs.response_trailers, envoy.matching.inputs.server_name, envoy.matching.inputs.source_ip, envoy.matching.inputs.source_port, envoy.matching.inputs.source_type, envoy.matching.inputs.status_code_class_input, envoy.matching.inputs.status_code_input, envoy.matching.inputs.subject, envoy.matching.inputs.uri_san, query_params
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.filters.http: envoy.bandwidth_limit, envoy.buffer, envoy.cors, envoy.csrf, envoy.ext_authz, envoy.ext_proc, envoy.fault, envoy.filters.http.adaptive_concurrency, envoy.filters.http.admission_control, envoy.filters.http.alternate_protocols_cache, envoy.filters.http.aws_lambda, envoy.filters.http.aws_request_signing, envoy.filters.http.bandwidth_limit, envoy.filters.http.buffer, envoy.filters.http.cache, envoy.filters.http.cdn_loop, envoy.filters.http.composite, envoy.filters.http.compressor, envoy.filters.http.connect_grpc_bridge, envoy.filters.http.cors, envoy.filters.http.csrf, envoy.filters.http.custom_response, envoy.filters.http.decompressor, envoy.filters.http.dynamic_forward_proxy, envoy.filters.http.ext_authz, envoy.filters.http.ext_proc, envoy.filters.http.fault, envoy.filters.http.file_system_buffer, envoy.filters.http.gcp_authn, envoy.filters.http.grpc_http1_bridge, envoy.filters.http.grpc_http1_reverse_bridge, envoy.filters.http.grpc_json_transcoder, envoy.filters.http.grpc_stats, envoy.filters.http.grpc_web, envoy.filters.http.header_mutation, envoy.filters.http.header_to_metadata, envoy.filters.http.health_check, envoy.filters.http.ip_tagging, envoy.filters.http.jwt_authn, envoy.filters.http.local_ratelimit, envoy.filters.http.lua, envoy.filters.http.match_delegate, envoy.filters.http.oauth2, envoy.filters.http.on_demand, envoy.filters.http.original_src, envoy.filters.http.rate_limit_quota, envoy.filters.http.ratelimit, envoy.filters.http.rbac, envoy.filters.http.router, envoy.filters.http.set_metadata, envoy.filters.http.stateful_session, envoy.filters.http.tap, envoy.filters.http.wasm, envoy.grpc_http1_bridge, envoy.grpc_json_transcoder, envoy.grpc_web, envoy.health_check, envoy.ip_tagging, envoy.local_rate_limit, envoy.lua, envoy.rate_limit, envoy.router
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.route.early_data_policy: envoy.route.early_data_policy.default
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.formatter: envoy.formatter.metadata, envoy.formatter.req_without_query
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.custom_response: envoy.extensions.http.custom_response.local_response_policy, envoy.extensions.http.custom_response.redirect_policy
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.connection_handler: envoy.connection_handler.default
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.rbac.matchers: envoy.rbac.matchers.upstream_ip_port
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.header_validators: envoy.http.header_validators.envoy_default
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.quic.server.crypto_stream: envoy.quic.crypto_stream.server.quiche
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.regex_engines: envoy.regex_engines.google_re2
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.load_balancing_policies: envoy.load_balancing_policies.least_request, envoy.load_balancing_policies.maglev, envoy.load_balancing_policies.random, envoy.load_balancing_policies.ring_hash, envoy.load_balancing_policies.round_robin
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.transport_sockets.upstream: envoy.transport_sockets.alts, envoy.transport_sockets.http_11_proxy, envoy.transport_sockets.internal_upstream, envoy.transport_sockets.quic, envoy.transport_sockets.raw_buffer, envoy.transport_sockets.starttls, envoy.transport_sockets.tap, envoy.transport_sockets.tcp_stats, envoy.transport_sockets.tls, envoy.transport_sockets.upstream_proxy_protocol, raw_buffer, starttls, tls
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.retry_host_predicates: envoy.retry_host_predicates.omit_canary_hosts, envoy.retry_host_predicates.omit_host_metadata, envoy.retry_host_predicates.previous_hosts
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.tls.cert_validator: envoy.tls.cert_validator.default, envoy.tls.cert_validator.spiffe
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.early_header_mutation: envoy.http.early_header_mutation.header_mutation
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.rate_limit_descriptors: envoy.rate_limit_descriptors.expr
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.upstream_options: envoy.extensions.upstreams.http.v3.HttpProtocolOptions, envoy.extensions.upstreams.tcp.v3.TcpProtocolOptions, envoy.upstreams.http.http_protocol_options, envoy.upstreams.tcp.tcp_protocol_options
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.thrift_proxy.filters: envoy.filters.thrift.header_to_metadata, envoy.filters.thrift.payload_to_metadata, envoy.filters.thrift.rate_limit, envoy.filters.thrift.router
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.http.stateful_header_formatters: envoy.http.stateful_header_formatters.preserve_case, preserve_case
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.network.dns_resolver: envoy.network.dns_resolver.cares, envoy.network.dns_resolver.getaddrinfo
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.filters.http.upstream: envoy.buffer, envoy.filters.http.admission_control, envoy.filters.http.buffer, envoy.filters.http.header_mutation, envoy.filters.http.upstream_codec
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.config_subscription: envoy.config_subscription.filesystem, envoy.config_subscription.filesystem_collection, envoy.config_subscription.rest
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.retry_priorities: envoy.retry_priorities.previous_priorities
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.matching.network.input: envoy.matching.inputs.application_protocol, envoy.matching.inputs.destination_ip, envoy.matching.inputs.destination_port, envoy.matching.inputs.direct_source_ip, envoy.matching.inputs.dns_san, envoy.matching.inputs.filter_state, envoy.matching.inputs.server_name, envoy.matching.inputs.source_ip, envoy.matching.inputs.source_port, envoy.matching.inputs.source_type, envoy.matching.inputs.subject, envoy.matching.inputs.transport_protocol, envoy.matching.inputs.uri_san
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.matching.common_inputs: envoy.matching.common_inputs.environment_variable
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.matching.input_matchers: envoy.matching.matchers.consistent_hashing, envoy.matching.matchers.ip
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.config.validators: envoy.config.validators.minimum_clusters, envoy.config.validators.minimum_clusters_validator
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.upstreams: envoy.filters.connection_pools.tcp.generic
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.bootstrap: envoy.bootstrap.internal_listener, envoy.bootstrap.wasm, envoy.extensions.network.socket_interface.default_socket_interface
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.compression.decompressor: envoy.compression.brotli.decompressor, envoy.compression.gzip.decompressor, envoy.compression.zstd.decompressor
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.guarddog_actions: envoy.watchdog.abort_action, envoy.watchdog.profile_action
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.listener_manager_impl: envoy.listener_manager_impl.default, envoy.listener_manager_impl.validation
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.quic.proof_source: envoy.quic.proof_source.filter_chain
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.health_checkers: envoy.health_checkers.grpc, envoy.health_checkers.http, envoy.health_checkers.redis, envoy.health_checkers.tcp, envoy.health_checkers.thrift
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.compression.compressor: envoy.compression.brotli.compressor, envoy.compression.gzip.compressor, envoy.compression.zstd.compressor
2023-06-02T04:18:25.826Z+00:00 [info] envoy.main(15)   envoy.grpc_credentials: envoy.grpc_credentials.aws_iam, envoy.grpc_credentials.default, envoy.grpc_credentials.file_based_metadata
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.matching.action: envoy.matching.actions.format_string, filter-chain-name
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.http.cache: envoy.extensions.http.cache.file_system_http_cache, envoy.extensions.http.cache.simple
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.access_loggers: envoy.access_loggers.file, envoy.access_loggers.http_grpc, envoy.access_loggers.open_telemetry, envoy.access_loggers.stderr, envoy.access_loggers.stdout, envoy.access_loggers.tcp_grpc, envoy.access_loggers.wasm, envoy.file_access_log, envoy.http_grpc_access_log, envoy.open_telemetry_access_log, envoy.stderr_access_log, envoy.stdout_access_log, envoy.tcp_grpc_access_log, envoy.wasm_access_log
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.filters.udp_listener: envoy.filters.udp.dns_filter, envoy.filters.udp_listener.udp_proxy
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.dubbo_proxy.protocols: dubbo
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.wasm.runtime: envoy.wasm.runtime.null, envoy.wasm.runtime.v8
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.dubbo_proxy.serializers: dubbo.hessian2
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.thrift_proxy.transports: auto, framed, header, unframed
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.stats_sinks: envoy.dog_statsd, envoy.graphite_statsd, envoy.metrics_service, envoy.stat_sinks.dog_statsd, envoy.stat_sinks.graphite_statsd, envoy.stat_sinks.hystrix, envoy.stat_sinks.metrics_service, envoy.stat_sinks.statsd, envoy.stat_sinks.wasm, envoy.statsd
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   quic.http_server_connection: quic.http_server_connection.default
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.clusters: envoy.cluster.eds, envoy.cluster.logical_dns, envoy.cluster.original_dst, envoy.cluster.static, envoy.cluster.strict_dns, envoy.clusters.aggregate, envoy.clusters.dynamic_forward_proxy, envoy.clusters.redis
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.request_id: envoy.request_id.uuid
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.filters.listener: envoy.filters.listener.http_inspector, envoy.filters.listener.local_ratelimit, envoy.filters.listener.original_dst, envoy.filters.listener.original_src, envoy.filters.listener.proxy_protocol, envoy.filters.listener.tls_inspector, envoy.listener.http_inspector, envoy.listener.original_dst, envoy.listener.original_src, envoy.listener.proxy_protocol, envoy.listener.tls_inspector
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.path.match: envoy.path.match.uri_template.uri_template_matcher
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.thrift_proxy.protocols: auto, binary, binary/non-strict, compact, twitter
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.tracers: envoy.dynamic.ot, envoy.tracers.datadog, envoy.tracers.dynamic_ot, envoy.tracers.opencensus, envoy.tracers.opentelemetry, envoy.tracers.skywalking, envoy.tracers.xray, envoy.tracers.zipkin, envoy.zipkin
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   network.connection.client: default, envoy_internal
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.internal_redirect_predicates: envoy.internal_redirect_predicates.allow_listed_routes, envoy.internal_redirect_predicates.previous_routes, envoy.internal_redirect_predicates.safe_cross_scheme
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.matching.network.custom_matchers: envoy.matching.custom_matchers.trie_matcher
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.quic.connection_id_generator: envoy.quic.deterministic_connection_id_generator
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.matching.http.custom_matchers: envoy.matching.custom_matchers.trie_matcher
2023-06-02T04:18:25.827Z+00:00 [info] envoy.main(15)   envoy.path.rewrite: envoy.path.rewrite.uri_template.uri_template_rewriter
2023-06-02T04:18:25.835Z+00:00 [warning] envoy.misc(15) Deprecated field: type envoy.config.cluster.v3.Cluster Using deprecated option 'envoy.config.cluster.v3.Cluster.http2_protocol_options' from file cluster.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override.
2023-06-02T04:18:25.835Z+00:00 [warning] envoy.misc(15) Deprecated field: type envoy.config.bootstrap.v3.Admin Using deprecated option 'envoy.config.bootstrap.v3.Admin.access_log_path' from file bootstrap.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override.
2023-06-02T04:18:25.835Z+00:00 [info] envoy.main(15) HTTP header map info:
2023-06-02T04:18:25.838Z+00:00 [info] envoy.main(15)   request header map: 672 bytes: 

@hashicorp-cla
Copy link

hashicorp-cla commented Jun 1, 2023

CLA assistant check
All committers have signed the CLA.

@absolutelightning absolutelightning changed the title fix: log level present in extra args using envoy-extra-args annotation fix: log level present in extra args using envoy-extra-args annotation : NET-2190 Jun 1, 2023
pkg/envoy/proxy.go Outdated Show resolved Hide resolved
pkg/envoy/proxy.go Outdated Show resolved Hide resolved
pkg/envoy/proxy.go Show resolved Hide resolved
pkg/envoy/proxy.go Outdated Show resolved Hide resolved
@absolutelightning absolutelightning marked this pull request as ready for review June 2, 2023 04:25
@absolutelightning absolutelightning requested a review from a team as a code owner June 2, 2023 04:25
@Ganeshrockz Ganeshrockz self-requested a review June 5, 2023 11:51
@Ganeshrockz
Copy link
Contributor

LGTM on a high level. I'd defer the approval to someone who has more context around this

@mikemorris
Copy link
Contributor

@absolutelightning I just merged #115 which refactored the Envoy extraArgs handling and I believe will conflict with this - happy to prioritize reviewing this if you can rebase on top of that!

Copy link
Contributor

@curtbushko curtbushko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. As Mike said in another comment, you will need to rebase off of main and change several things as proxy config changed.

@@ -146,3 +146,129 @@ func testOutputPath() string {
fmt.Sprintf("test-output-%x.json", time.Now().UnixNano()+int64(os.Getpid())),
)
}

func TestProxy_OverridingLoggerAndExtraArgs(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these tests run for you locally? They fail for me with failed to unmarshal output file: invalid character '\r' in string literal

(Also, CI is not running the unit tests)

Copy link
Contributor Author

@absolutelightning absolutelightning Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running fine most of the time. But its intermittently printing the log which you have written above.

Screenshot 2023-06-07 at 4 44 37 PM

Same is the case with TestProxy - both of them has similar code and Test Proxy also fails 1/20 times.
Screenshot 2023-06-07 at 4 48 20 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured out what the problem was for me. I had the brew install base64 instead of the GNU brew install gbase64. This was causing fake-envoy to not run at all....

@curtbushko
Copy link
Contributor

To save you time in the future, most of use Kind for local testing. It runs locally and it is very nice to be able to delete and recreate your cluster very quickly. I barely ever use EKS/GKE/AKS in my testing unless I am specifically testing a feature needed on those Kubernetes versions.

Here is my demo repo and a Makefile that I use for quickly setting things up. Copy and replace with your directories/dockerhub. I sometimes run make delete-cluster create-cluster 100s of times a week. 😄

@absolutelightning absolutelightning force-pushed the asheshvidyut/NET-2190/fix-log-level-present-in-extra-args branch from 711f7f3 to 65ba8a3 Compare June 7, 2023 06:56
@absolutelightning
Copy link
Contributor Author

To save you time in the future, most of use Kind for local testing. It runs locally and it is very nice to be able to delete and recreate your cluster very quickly. I barely ever use EKS/GKE/AKS in my testing unless I am specifically testing a feature needed on those Kubernetes versions.

Here is my demo repo and a Makefile that I use for quickly setting things up. Copy and replace with your directories/dockerhub. I sometimes run make delete-cluster create-cluster 100s of times a week. 😄

Thanks @curtbushko . Really helpful.

@absolutelightning
Copy link
Contributor Author

Also I have rebased my branch.

@curtbushko
Copy link
Contributor

I built my own version of the consul-dataplane image and I am running the acceptance tests against it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.1 Changes are backported to 1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants