Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/cors/backend/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
2 changes: 0 additions & 2 deletions examples/cors/backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
volumes:
- ./front-envoy.yaml:/etc/front-envoy.yaml
networks:
- envoymesh
expose:
Expand Down
2 changes: 2 additions & 0 deletions examples/cors/frontend/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
2 changes: 0 additions & 2 deletions examples/cors/frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
volumes:
- ./front-envoy.yaml:/etc/front-envoy.yaml
networks:
- envoymesh
expose:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
4 changes: 1 addition & 3 deletions examples/csrf/crosssite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ services:

front-envoy:
build:
context: ..
context: .
dockerfile: Dockerfile-frontenvoy
volumes:
- ./front-envoy.yaml:/etc/front-envoy.yaml
networks:
- envoymesh
expose:
Expand Down
2 changes: 1 addition & 1 deletion examples/csrf/crosssite/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static_resources:
- name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.config.accesslog.v2.FileAccessLog
path: "/var/log/access.log"
path: "/dev/stdout"
route_config:
name: local_route
virtual_hosts:
Expand Down
7 changes: 7 additions & 0 deletions examples/csrf/samesite/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
4 changes: 1 addition & 3 deletions examples/csrf/samesite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ services:

front-envoy:
build:
context: ..
context: .
dockerfile: Dockerfile-frontenvoy
volumes:
- ./front-envoy.yaml:/etc/front-envoy.yaml
networks:
- envoymesh
expose:
Expand Down
11 changes: 10 additions & 1 deletion examples/csrf/samesite/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static_resources:
- name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.config.accesslog.v2.FileAccessLog
path: "/var/log/access.log"
path: "/dev/stdout"
route_config:
name: local_route
virtual_hosts:
Expand Down Expand Up @@ -114,3 +114,12 @@ admin:
socket_address:
address: 0.0.0.0
port_value: 8001

layered_runtime:
layers:
- name: static_layer
static_layer:
envoy.deprecated_features:envoy.api.v2.route.CorsPolicy.allow_origin: true
envoy.deprecated_features:envoy.api.v2.route.Route.per_filter_config: true
envoy.deprecated_features:envoy.api.v2.route.VirtualHost.per_filter_config: true
envoy.deprecated_features:envoy.type.matcher.StringMatcher.regex: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think these configs are missing from https://github.com/envoyproxy/envoy/blob/master/examples/BUILD. Can we fix the configs? This will have to be updated also https://github.com/envoyproxy/envoy/blob/master/test/config_test/example_configs_test.cc.

Bonus points for figuring out how to automatically make sure new configs get added for testing. This is a consistent problem that we have. Thank you!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mattklein123 i found the problem using this test runner

https://github.com/phlax/envoy-examples

weve been talking about how/if we could land it in envoy repo - i was waiting to land this first before thinking about it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK sounds good. In the interim can you fix the configs and add to the config tests? Thank you.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not sure if it would catch these configs tho

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think these configs are missing from https://github.com/envoyproxy/envoy/blob/master/examples/BUILD. Can we fix the configs?

I updated the BUILD script with all of the configs with yaml suffix.

Not entirely clear if this is correct, but also noticing that there is at least one non-yaml config listed, so there may be more

This will have to be updated also https://github.com/envoyproxy/envoy/blob/master/test/config_test/example_configs_test.cc.

Im afraid its not immediately obvious to me what needs to change here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You need to:

  1. Add the missing configs to the build config
  2. Fix the configs
  3. Update the test to account for the new number of configs (you will see the test will fail).

Thank you!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mattklein123

i have fixed the deprecation issues in the example configs and updated the necessary test files

I wasnt able to include the jaeger-native config as it fails with

2020-08-01T17:22:05.6865108Z test/config_test/config_test.cc:134: Failure
2020-08-01T17:22:05.6865445Z Failed
2020-08-01T17:22:05.6866695Z '/b/f/w/_tmp/163cb06a4250265abc95a57e525238d7/test/config_test/jaeger-native-tracing_service1-envoy-jaeger.yaml' config failed. Error: opentracing: failed to load dynamic library: /usr/local/lib/libjaegertracing_plugin.so: cannot open shared object file: No such file or directory

im not sure how to mock/expect the files absence. Im happy to update if i know how.

i also updated the test runner i have tor the examples to test both the cors and csrf examples more thoroughly, and ensure i wasnt breaking anything.

regarding keeping the BUILD script up-to-date, we could do something like

cd examples
configs="$(find . -name "*.yaml" -o -name "*.lua" | grep -v docker-compose | cut  -d/ -f2-)"
for config in $configs; do
    grep "\"$config\"" BUILD || exit 1
done

it would fail on this PR because the jaeger configs arent included

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome thanks a ton. Agreed we can do something like the script you recommend as a follow up? (Perhaps with an exclusion list for configs we know won't work.)

9 changes: 9 additions & 0 deletions examples/ext_authz/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./config /etc/envoy-config
COPY ./run_envoy.sh /run_envoy.sh
RUN chmod go+r -R /etc/envoy-config \
&& chmod go+rx /run_envoy.sh /etc/envoy-config /etc/envoy-config/*
Comment thread
mattklein123 marked this conversation as resolved.
CMD /run_envoy.sh
8 changes: 4 additions & 4 deletions examples/ext_authz/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ services:

front-envoy:
build:
context: ../
dockerfile: front-proxy/Dockerfile-frontenvoy
volumes:
- ./${FRONT_ENVOY_YAML}:/etc/front-envoy.yaml
context: .
dockerfile: Dockerfile-frontenvoy
environment:
- FRONT_ENVOY_YAML
networks:
- envoymesh
expose:
Expand Down
3 changes: 3 additions & 0 deletions examples/ext_authz/run_envoy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/local/bin/envoy -c "/etc/envoy-${FRONT_ENVOY_YAML}" --service-cluster front-proxy
Comment thread
mattklein123 marked this conversation as resolved.
2 changes: 2 additions & 0 deletions examples/fault-injection/Dockerfile-envoy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get install -y curl tree
COPY ./envoy.yaml /etc/envoy.yaml
RUN chmod go+r /etc/envoy.yaml
COPY enable_delay_fault_injection.sh disable_delay_fault_injection.sh enable_abort_fault_injection.sh disable_abort_fault_injection.sh send_request.sh /
1 change: 0 additions & 1 deletion examples/fault-injection/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ services:
dockerfile: Dockerfile-envoy
command: /usr/local/bin/envoy -c /etc/envoy.yaml
volumes:
- ./envoy.yaml:/etc/envoy.yaml
- ./runtime:/srv/runtime
networks:
- envoymesh
Expand Down
2 changes: 2 additions & 0 deletions examples/front-proxy/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
2 changes: 0 additions & 2 deletions examples/front-proxy/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
volumes:
- ./front-envoy.yaml:/etc/front-envoy.yaml
networks:
- envoymesh
expose:
Expand Down
5 changes: 5 additions & 0 deletions examples/grpc-bridge/Dockerfile-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM envoyproxy/envoy-dev:latest

COPY ./client/envoy-proxy.yaml /etc/client-envoy-proxy.yaml
RUN chmod go+r /etc/client-envoy-proxy.yaml
CMD /usr/local/bin/envoy -c /etc/client-envoy-proxy.yaml
5 changes: 5 additions & 0 deletions examples/grpc-bridge/Dockerfile-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM envoyproxy/envoy-dev:latest

COPY ./server/envoy-proxy.yaml /etc/server-envoy-proxy.yaml
RUN chmod go+r /etc/server-envoy-proxy.yaml
CMD /usr/local/bin/envoy -c /etc/server-envoy-proxy.yaml --service-cluster backend-proxy
14 changes: 6 additions & 8 deletions examples/grpc-bridge/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ services:
- kv-backend-service

grpc-server-proxy:
image: envoyproxy/envoy:latest
command: /usr/local/bin/envoy -c /etc/server-envoy-proxy.yaml --service-cluster backend-proxy
volumes:
- ./server/envoy-proxy.yaml:/etc/server-envoy-proxy.yaml
build:
context: .
dockerfile: Dockerfile-server
networks:
envoymesh:
aliases:
Expand All @@ -45,10 +44,9 @@ services:
- grpc-client

grpc-client-proxy:
image: envoyproxy/envoy:latest
command: /usr/local/bin/envoy -c /etc/client-envoy-proxy.yaml
volumes:
- ./client/envoy-proxy.yaml:/etc/client-envoy-proxy.yaml
build:
context: .
dockerfile: Dockerfile-client
networks:
envoymesh:
aliases:
Expand Down
8 changes: 8 additions & 0 deletions examples/jaeger-native-tracing/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy-jaeger.yaml /etc/front-envoy.yaml
COPY ./libjaegertracing.so.0.4.2 /usr/local/lib/libjaegertracing_plugin.so
Comment thread
phlax marked this conversation as resolved.
Outdated
RUN chmod go+r /etc/front-envoy.yaml /usr/local/lib/libjaegertracing_plugin.so
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
17 changes: 4 additions & 13 deletions examples/jaeger-native-tracing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ services:

front-envoy:
build:
context: ../
dockerfile: front-proxy/Dockerfile-frontenvoy
volumes:
- ./front-envoy-jaeger.yaml:/etc/front-envoy.yaml
- ./install-jaeger-plugin.sh:/install-jaeger-plugin.sh
- ./start-front.sh:/start-front.sh
entrypoint: /start-front.sh
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
expose:
Expand All @@ -28,9 +23,7 @@ services:
dockerfile: Dockerfile-service
volumes:
- ./service1-envoy-jaeger.yaml:/etc/service-envoy.yaml
- ./install-jaeger-plugin.sh:/install-jaeger-plugin.sh
- ./start-service.sh:/start-service.sh
entrypoint: /start-service.sh
- ./libjaegertracing.so.0.4.2:/usr/local/lib/libjaegertracing_plugin.so
networks:
envoymesh:
aliases:
Expand All @@ -49,9 +42,7 @@ services:
dockerfile: Dockerfile-service
volumes:
- ./service2-envoy-jaeger.yaml:/etc/service-envoy.yaml
- ./install-jaeger-plugin.sh:/install-jaeger-plugin.sh
- ./start-service.sh:/start-service.sh
entrypoint: /start-service.sh
- ./libjaegertracing.so.0.4.2:/usr/local/lib/libjaegertracing_plugin.so
networks:
envoymesh:
aliases:
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions examples/jaeger-native-tracing/start-front.sh

This file was deleted.

3 changes: 0 additions & 3 deletions examples/jaeger-native-tracing/start-service.sh

This file was deleted.

7 changes: 7 additions & 0 deletions examples/jaeger-tracing/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy-jaeger.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
6 changes: 2 additions & 4 deletions examples/jaeger-tracing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ services:

front-envoy:
build:
context: ../
dockerfile: front-proxy/Dockerfile-frontenvoy
volumes:
- ./front-envoy-jaeger.yaml:/etc/front-envoy.yaml
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
expose:
Expand Down
2 changes: 2 additions & 0 deletions examples/lua/Dockerfile-proxy
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM envoyproxy/envoy-dev:latest
ADD ./lib/mylibrary.lua /lib/mylibrary.lua
COPY ./envoy.yaml /etc/envoy.yaml
RUN chmod go+r /etc/envoy.yaml /lib/mylibrary.lua
CMD /usr/local/bin/envoy -c /etc/envoy.yaml -l debug --service-cluster proxy
2 changes: 0 additions & 2 deletions examples/lua/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-proxy
volumes:
- ./envoy.yaml:/etc/envoy.yaml
networks:
- envoymesh
expose:
Expand Down
2 changes: 2 additions & 0 deletions examples/mysql/Dockerfile-proxy
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM envoyproxy/envoy-dev:latest

COPY ./envoy.yaml /etc/envoy.yaml
RUN chmod go+r /etc/envoy.yaml
CMD /usr/local/bin/envoy -c /etc/envoy.yaml -l debug
2 changes: 0 additions & 2 deletions examples/mysql/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-proxy
volumes:
- ./envoy.yaml:/etc/envoy.yaml
networks:
envoymesh:
aliases:
Expand Down
7 changes: 7 additions & 0 deletions examples/zipkin-tracing/Dockerfile-frontenvoy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM envoyproxy/envoy-dev:latest

RUN apt-get update && apt-get -q install -y \
curl
COPY ./front-envoy-zipkin.yaml /etc/front-envoy.yaml
RUN chmod go+r /etc/front-envoy.yaml
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy
6 changes: 2 additions & 4 deletions examples/zipkin-tracing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ services:

front-envoy:
build:
context: ../
dockerfile: front-proxy/Dockerfile-frontenvoy
volumes:
- ./front-envoy-zipkin.yaml:/etc/front-envoy.yaml
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
expose:
Expand Down