Getting Cannot find field error while adding ssl in envoy

Viewed 34

I have running couple of microservices with grpc protocol in k8s, it is connecting outside thought networking loadbalancer , right now i am using a envoy system in front of NLB

(Envoy > NLB > grpc service).

Application API es are working fine using envoy ip and port number , right now i need to use ssl for Envoy , I have trying to add ssl conf in envoy configuration file but getting error like below, butit is working fine without ssl conf.

ubuntu 18

envoy version 1.18.2

[2022-09-06 08:55:06.945][126177][critical][main] [external/envoy/source/server/server.cc:113] error initializing configuration 'envoy-ssl.yaml': Protobuf message (type envoy.config.bootstrap.v3.Bootstrap reason INVALID_ARGUMENT:(static_resources.listeners[0].filter_chains[0].transport_socket) common_tls_context: Cannot find field.) has unknown fields

below added Envoy configuration file

  access_log_path: /dev/stdout
  address:
    socket_address: { address: 0.0.0.0, port_value: 8888 }
static_resources:
  # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/config/listener/v3/listener.proto#config-listener-v3-listener
  listeners:
    - name: listener_0
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 9999
      filter_chains:
        - filters:
            - name: envoy.filters.network.http_connection_manager
              typed_config:
                # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#extensions-filters-network-http-connection-manager-v3-httpconnectionmanager
                "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                stat_prefix: ingress_http
                access_log:
                  # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/access_loggers/file/v3/file.proto
                  #
                  # You can also configure this extension with the qualified
                  # name envoy.access_loggers.http_grpc
                  # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/access_loggers/grpc/v3/als.proto
                  - name: envoy.access_loggers.file
                    typed_config:
                      # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/access_loggers/file/v3/file.proto#extensions-access-loggers-file-v3-fileaccesslog
                      "@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
                      # Console output
                      path: /dev/stdout
                route_config:
                  name: local_route
                  virtual_hosts:
                    - name: local_service
                      domains:
                        - "*"
                      routes:
                        - match:
                            prefix: /
                            grpc:
                          route:
                            timeout: 180s
                            cluster: microservice
                      cors:
                        allow_origin_string_match:
                          - prefix: "*"
                        allow_methods: GET, PUT, DELETE, POST, OPTIONS
                        # custom-header-1 is just an example. the grpc-web
                        # repository was missing grpc-status-details-bin header
                        # which used in a richer error model.
                        # https://grpc.io/docs/guides/error/#richer-error-model
                        allow_headers: accept-language,accept-encoding,user-agent,referer,sec-fetch-mode,origin,access-control-request-headers,access-control-request-method,accept,cache-control,pragma,connection,host,name,x-grpc-web,x-user-agent,grpc-timeout,content-type,channel,api-key,lang,currency,country,auth-key
                        expose_headers: grpc-status-details-bin,grpc-status,grpc-message,authorization
                        max_age: "1728000"
                http_filters:
                  - name: envoy.filters.http.grpc_web
                    # This line is optional, but adds clarity to the configuration.
                    typed_config:
                      # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/filters/http/grpc_web/v3/grpc_web.proto
                      "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
                  - name: envoy.filters.http.cors
                    typed_config:
                      # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/filters/http/cors/v3/cors.proto
                      "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
                  - name: envoy.filters.http.grpc_json_transcoder
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
                      proto_descriptor: "/home/ubuntu/envoy/sync.pb"
                      ignore_unknown_query_parameters: true
                      services:
                        - "com.tk.system.sync.Mailer"
                        - "com.tk.system.sync.Synchronizer"
                      print_options:
                        add_whitespace: true
                        always_print_primitive_fields: true
                        always_print_enums_as_ints: true
                        preserve_proto_field_names: true
                  - name: envoy.filters.http.router
                    typed_config:
                      # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/extensions/filters/http/router/v3/router.proto
                      "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
          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_certificates:
                 - certificate_chain:
                     inline_string: |
                       -----BEGIN CERTIFICATE-----
                       MIIEHjhfhHFGhhhfhfhHGTTguggjgjSGDGDGouiuiuiu7867bjbjjDJHvcNAQEL
                       gdhfgfgfhfhieururumnvnDHdyfhDJFHFHkdjfhfhfhdlueueueGGSDSJkddkdn
                       FoG+gfhfh64556gfggrtGKJKJL(7878DSDS6565hfhfhfhskwieieieiekekkyeZ/
                       RQ==
                       -----END CERTIFICATE-----
                   private_key:
                     inline_string: |
                       -----BEGIN PRIVATE KEY-----
                       MIIEHjhfhHFGhhhfhfhHGTTguggjgjSGDGDGouiuiuiu7867bjbjjDJHvcNAQEL
                       gdhfgfgfhfhieururumnvnDHdyfhDJFHFHkdjfhfhfhdlueueueGGSDSJkddkdn
                       FoG+gfhfh64556gfggrtGKJKJL(7878DSDS6565hfhfhfhskwieieieiekekkyeZ/
                       RQ==
                       -----END PRIVATE KEY-----
  clusters:
    # https://www.envoyproxy.io/docs/envoy/v1.15.0/api-v3/config/cluster/v3/cluster.proto#config-cluster-v3-cluster
    - name: tkmicro
      type: LOGICAL_DNS
      connect_timeout: 180s
      lb_policy: round_robin
      load_assignment:
        cluster_name: microservice
        endpoints:
          - lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: k8s-hdkfh-nlb-sample-usrl-16.elb.eu-west-1.amazonaws.com
                      port_value: 80
      http2_protocol_options: {} # Force HTTP/2
      health_checks:
      - timeout: 1s
        interval: 10s
        interval_jitter: 1s
        unhealthy_threshold: 6
        healthy_threshold: 1
        http_health_check:
          path: "/health" ````
0 Answers
Related