Skip to content

Commit

Permalink
grpc-jexpress-template : Update envoy.yml syntax to envoy1.31-latest (
Browse files Browse the repository at this point in the history
#104)

made envoy.yml compatible to envoy1.31-latest

Co-authored-by: Aravindh Vasu <[email protected]>
  • Loading branch information
TheRookieNerd and Aravindh Vasu authored Aug 22, 2024
1 parent b1e8abb commit 3026af5
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 44 deletions.
102 changes: 59 additions & 43 deletions grpc-jexpress-template/envoy.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
admin:
access_log_path: /tmp/admin-access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9901 }
access_log_path: /tmp/admin-access.log
address:
socket_address:
address: 0.0.0.0
port_value: 9901

static_resources:
listeners:
- name: listener1
address:
socket_address: { address: 0.0.0.0, port_value: 51051 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
stat_prefix: grpc_json
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" , grpc: {}}
route: { cluster: grpc, timeout: { seconds: 60 } }
http_filters:
- name: envoy.grpc_json_transcoder
config:
proto_descriptor: "/tmp/sample_proto_descriptor_set.pb"
services: ["service.UserService"]
print_options:
add_whitespace: true
always_print_primitive_fields: true
always_print_enums_as_ints: false
preserve_proto_field_names: false
- name: envoy.router
listeners:
- name: listener1
address:
socket_address:
address: 0.0.0.0
port_value: 51051
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: grpc_json
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match:
prefix: "/"
route:
cluster: grpc
timeout: { seconds: 60 }
http_filters:
- name: envoy.grpc_json_transcoder
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
proto_descriptor: "/tmp/sample_proto_descriptor_set.pb"
services: ["service.UserService"]
print_options:
add_whitespace: true
always_print_primitive_fields: true
always_print_enums_as_ints: false
preserve_proto_field_names: false
- name: envoy.router
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

clusters:
- name: grpc
connect_timeout: 1.25s
type: logical_dns
lb_policy: round_robin
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
hosts:
- socket_address:
address: docker.for.mac.localhost
port_value: 50051
clusters:
- name: grpc
connect_timeout: 1.25s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
load_assignment:
cluster_name: grpc
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: host.docker.internal
port_value: 50051
Binary file modified grpc-jexpress-template/sample_proto_descriptor_set.pb
Binary file not shown.
3 changes: 2 additions & 1 deletion grpc-jexpress-template/start-envoy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

sudo docker run -it --rm --name envoy -p 51051:51051 -p 9901:9901 -v "$(pwd)/sample_proto_descriptor_set.pb:/tmp/sample_proto_descriptor_set.pb:ro" -v "$(pwd)/envoy.yml:/etc/envoy/envoy.yaml:ro" envoyproxy/envoy
# envoy doesn't support a latest tag anymore, so find the latest version and use it accordingly
sudo docker run -it --rm --name envoy -p 51051:51051 -p 9901:9901 -v "$(pwd)/sample_proto_descriptor_set.pb:/tmp/sample_proto_descriptor_set.pb:ro" -v "$(pwd)/envoy.yml:/etc/envoy/envoy.yaml:ro" envoyproxy/envoy:v1.31-latest

0 comments on commit 3026af5

Please sign in to comment.