From 8743468631f286b3082be902bee19e88452d4663 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Wed, 28 Oct 2020 08:06:11 +0000 Subject: [PATCH 01/20] temp remove pipeline dep check Signed-off-by: Ryan Northey --- .azure-pipelines/pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index 8e26b1f61ff2..7e2071702e38 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -167,7 +167,7 @@ stages: AZP_BRANCH: $(Build.SourceBranch) - stage: linux_x64 - dependsOn: ["precheck"] + dependsOn: [] # For post-submit builds, continue even if precheck fails condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true))) jobs: @@ -181,7 +181,7 @@ stages: ciTarget: bazel.release - stage: linux_arm64 - dependsOn: ["precheck"] + dependsOn: [] # For post-submit builds, continue even if precheck fails condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true))) jobs: From d5c815fe1df0e9a4368d4d60193f9ec6fa4c0402 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Tue, 27 Oct 2020 18:28:36 +0000 Subject: [PATCH 02/20] examples: Add filesystem dynamic configuration sandbox example Signed-off-by: Ryan Northey --- .../response-config-active-clusters.json | 32 +++++++ .../dynamic-configuration-filesystem.rst | 90 +++++++++++++++++++ docs/root/start/sandboxes/index.rst | 1 + examples/BUILD | 1 + examples/dynamic-config-fs/Dockerfile-proxy | 5 ++ examples/dynamic-config-fs/README.md | 2 + examples/dynamic-config-fs/configs/cds.yaml | 17 ++++ examples/dynamic-config-fs/configs/lds.yaml | 28 ++++++ .../dynamic-config-fs/docker-compose.yaml | 23 +++++ examples/dynamic-config-fs/envoy.yaml | 16 ++++ examples/dynamic-config-fs/verify.sh | 40 +++++++++ 11 files changed, 255 insertions(+) create mode 100644 docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json create mode 100644 docs/root/start/sandboxes/dynamic-configuration-filesystem.rst create mode 100644 examples/dynamic-config-fs/Dockerfile-proxy create mode 100644 examples/dynamic-config-fs/README.md create mode 100644 examples/dynamic-config-fs/configs/cds.yaml create mode 100644 examples/dynamic-config-fs/configs/lds.yaml create mode 100644 examples/dynamic-config-fs/docker-compose.yaml create mode 100644 examples/dynamic-config-fs/envoy.yaml create mode 100755 examples/dynamic-config-fs/verify.sh diff --git a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json new file mode 100644 index 000000000000..f51d9df5e527 --- /dev/null +++ b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json @@ -0,0 +1,32 @@ +[ + { + "version_info": "1", + "cluster": { + "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster", + "name": "example_proxy_cluster", + "type": "LOGICAL_DNS", + "connect_timeout": "5s", + "dns_lookup_family": "V4_ONLY", + "load_assignment": { + "cluster_name": "example_proxy_cluster", + "endpoints": [ + { + "lb_endpoints": [ + { + "endpoint": { + "address": { + "socket_address": { + "address": "service1", + "port_value": 8080 + } + } + } + } + ] + } + ] + } + }, + "last_updated": "2020-10-25T20:37:05.838Z" + } +] diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst new file mode 100644 index 000000000000..ba60562edbcf --- /dev/null +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -0,0 +1,90 @@ +.. _install_sandboxes_dynamic_config_cp: + +Dynamic configuration (filesystem) +================================== + +This example walks through configuring Envoy using filesystem-based dynamic configuration. + +It demonstrates how configuration provided to Envoy dynamically can be updated without +restarting the server. + +.. include:: _include/docker-env-setup.rst + +Change directory to ``examples/dynamic-config-fs`` in the Envoy repository. + +Step 3: Start the proxy container +********************************* + +.. note:: + + If you are running on a system with strict ``umask`` you will need to ``chmod`` the dynamic config + files which are mounted into the container: + + .. code-block:: console + + $ umask + 027 + $ pwd + envoy/examples/dynamic-config-fs + $ chmod go+r configs/* + $ chmod go+x configs + +First build the containers and start the ``proxy`` container. + +This should also start two backend ``HTTP`` echo servers, ``service1`` and ``service2``. + +.. code-block:: console + + $ pwd + envoy/examples/dynamic-config-fs + $ docker-compose build --pull + $ docker-compose up -d proxy + $ docker-compose ps + + Name Command State Ports + ------------------------------------------------------------------------------------------------------------------------ + dynamic-config-fs_proxy_1 /docker-entrypoint.sh /usr ... Up 0.0.0.0:10000->10000/tcp, 0.0.0.0:19000->19000/tcp + dynamic-config-fs_service1_1 /bin/echo-server Up 8080/tcp + dynamic-config-fs_service2_1 /bin/echo-server Up 8080/tcp + +Step 4: Check initial config and web response +********************************************* + +.. code-block:: console + + $ curl -s http://localhost:10000 + +.. code-block:: console + + $ curl -s http://localhost:19000/config_dump jq -r '.configs[1].dynamic_active_clusters' + +.. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json + :language: json + :emphasize-lines: 3, 11, 19-20 + +Step 5: Edit ``cds.yaml`` file to update upstream cluster +********************************************************* + +.. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml + :language: yaml + :lines: 1, 15 + +Step 6: Check web response again +******************************** + +.. code-block:: console + + $ curl http://localhost:10000 | grep "served by" + Request served by service2 + + +Step 7: Check configs again +*************************** + +.. code-block:: console + + $ curl -s http://localhost:19000/config_dump jq -r '.configs[1].dynamic_active_clusters' + +.. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json + :language: json + :emphasize-lines: 3, 11, 19-20 diff --git a/docs/root/start/sandboxes/index.rst b/docs/root/start/sandboxes/index.rst index 859145972cd4..3271ddd64ff7 100644 --- a/docs/root/start/sandboxes/index.rst +++ b/docs/root/start/sandboxes/index.rst @@ -14,6 +14,7 @@ features. The following sandboxes are available: cache cors csrf + dynamic-configuration-filesystem ext_authz fault_injection front_proxy diff --git a/examples/BUILD b/examples/BUILD index f5fdff5710a4..59d945583b06 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -18,6 +18,7 @@ filegroup( ], exclude = [ "cache/responses.yaml", + "dynamic-config-fs/**/*", "jaeger-native-tracing/*", "**/*docker-compose*.yaml", ], diff --git a/examples/dynamic-config-fs/Dockerfile-proxy b/examples/dynamic-config-fs/Dockerfile-proxy new file mode 100644 index 000000000000..f70f44311461 --- /dev/null +++ b/examples/dynamic-config-fs/Dockerfile-proxy @@ -0,0 +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"] diff --git a/examples/dynamic-config-fs/README.md b/examples/dynamic-config-fs/README.md new file mode 100644 index 000000000000..346b020e98c8 --- /dev/null +++ b/examples/dynamic-config-fs/README.md @@ -0,0 +1,2 @@ +To learn about this sandbox and for instructions on how to run it please head over +to the [Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/postgres.html). diff --git a/examples/dynamic-config-fs/configs/cds.yaml b/examples/dynamic-config-fs/configs/cds.yaml new file mode 100644 index 000000000000..5b58accbc71d --- /dev/null +++ b/examples/dynamic-config-fs/configs/cds.yaml @@ -0,0 +1,17 @@ +version_info: "1" + +resources: +- "@type": type.googleapis.com/envoy.config.cluster.v3.Cluster + name: example_proxy_cluster + connect_timeout: 1s + type: strict_dns + http2_protocol_options: {} + load_assignment: + cluster_name: example_proxy_cluster + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: service1 + port_value: 8080 diff --git a/examples/dynamic-config-fs/configs/lds.yaml b/examples/dynamic-config-fs/configs/lds.yaml new file mode 100644 index 000000000000..7febaca55136 --- /dev/null +++ b/examples/dynamic-config-fs/configs/lds.yaml @@ -0,0 +1,28 @@ +version_info: "1" + +resources: +- "@type": type.googleapis.com/envoy.config.listener.v3.Listener + name: listener_0 + address: + socket_address: + address: 0.0.0.0 + port_value: 10000 + 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: ingress_http + http_filters: + - name: envoy.router + route_config: + name: local_route + virtual_hosts: + - name: local_service + domains: + - "*" + routes: + - match: + prefix: "/" + route: + cluster: example_proxy_cluster diff --git a/examples/dynamic-config-fs/docker-compose.yaml b/examples/dynamic-config-fs/docker-compose.yaml new file mode 100644 index 000000000000..b3aed8c7e8ad --- /dev/null +++ b/examples/dynamic-config-fs/docker-compose.yaml @@ -0,0 +1,23 @@ +version: "3.7" +services: + + proxy: + build: + context: . + dockerfile: Dockerfile-proxy + depends_on: + - service1 + - service2 + ports: + - 10000:10000 + - 19000:19000 + volumes: + - ./configs:/var/lib/envoy + + service1: + image: jmalloc/echo-server + hostname: service1 + + service2: + image: jmalloc/echo-server + hostname: service2 diff --git a/examples/dynamic-config-fs/envoy.yaml b/examples/dynamic-config-fs/envoy.yaml new file mode 100644 index 000000000000..27587e0dbca4 --- /dev/null +++ b/examples/dynamic-config-fs/envoy.yaml @@ -0,0 +1,16 @@ +node: + id: id_1 + cluster: test + +dynamic_resources: + cds_config: + path: /var/lib/envoy/cds.yaml + lds_config: + path: /var/lib/envoy/lds.yaml + +admin: + access_log_path: "/dev/null" + address: + socket_address: + address: 0.0.0.0 + port_value: 19000 diff --git a/examples/dynamic-config-fs/verify.sh b/examples/dynamic-config-fs/verify.sh new file mode 100755 index 000000000000..98b9b8c9b4af --- /dev/null +++ b/examples/dynamic-config-fs/verify.sh @@ -0,0 +1,40 @@ +#!/bin/bash -e + +export NAME=dynamic-config-fs + +chmod go+r configs/* +chmod go+rx configs + +# shellcheck source=examples/verify-common.sh +. "$(dirname "${BASH_SOURCE[0]}")/../verify-common.sh" + +run_log "Check for response comes from service1 upstream" +responds_with \ + "Request served by service1" \ + http://localhost:10000 + +run_log "Check config for active clusters pointing to service1" +curl -s http://localhost:19000/config_dump \ + | jq -r '.configs[1].dynamic_active_clusters' \ + | grep '"version_info": "1"' +curl -s http://localhost:19000/config_dump \ + | jq -r '.configs[1].dynamic_active_clusters' \ + | grep '"address": "service1"' + +run_log "Set upstream to service2" +sed -i s/service1/service2/ configs/cds.yaml +sed -i s/'version_info: "1"'/'version_info: "2"'/ configs/cds.yaml + +run_log "Check for response comes from service2 upstream" +responds_with \ + "Request served by service2" \ + http://localhost:10000 + +run_log "Check config for active clusters pointing to service2" +curl -s http://localhost:19000/config_dump \ + | jq -r '.configs[1].dynamic_active_clusters' \ + | grep '"address": "service2"' + +# curl -s http://localhost:19000/config_dump \ +# | jq -r '.configs[1].dynamic_active_clusters' \ +# | grep '"version_info": "2"' From d54bdc786902968a26c33bf849302bdc9578878c Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Wed, 28 Oct 2020 15:06:06 +0000 Subject: [PATCH 03/20] docs/ Signed-off-by: Ryan Northey --- docs/root/start/sandboxes/dynamic-configuration-filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index ba60562edbcf..6a8f0b002fb8 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -67,7 +67,7 @@ Step 5: Edit ``cds.yaml`` file to update upstream cluster .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml - :lines: 1, 15 + :emphasize-lines: 1, 15 Step 6: Check web response again ******************************** From 4baa502b1dd38353a40cadc26d97c8469c8ab955 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 09:59:56 +0000 Subject: [PATCH 04/20] examples/ Signed-off-by: Ryan Northey --- examples/dynamic-config-fs/verify.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/dynamic-config-fs/verify.sh b/examples/dynamic-config-fs/verify.sh index 98b9b8c9b4af..366096f7789f 100755 --- a/examples/dynamic-config-fs/verify.sh +++ b/examples/dynamic-config-fs/verify.sh @@ -23,7 +23,6 @@ curl -s http://localhost:19000/config_dump \ run_log "Set upstream to service2" sed -i s/service1/service2/ configs/cds.yaml -sed -i s/'version_info: "1"'/'version_info: "2"'/ configs/cds.yaml run_log "Check for response comes from service2 upstream" responds_with \ From 52faf29db618f2880119c71437872f61a07b1742 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 10:00:00 +0000 Subject: [PATCH 05/20] docs/ Signed-off-by: Ryan Northey --- docs/root/start/sandboxes/dynamic-configuration-filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 6a8f0b002fb8..ef678870448f 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -67,7 +67,7 @@ Step 5: Edit ``cds.yaml`` file to update upstream cluster .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml - :emphasize-lines: 1, 15 + :emphasize-lines: 1, 16 Step 6: Check web response again ******************************** From 049b7620bb6d986ca73ed49f2485a2249bee1164 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 10:02:21 +0000 Subject: [PATCH 06/20] docs/ Signed-off-by: Ryan Northey --- .../start/sandboxes/dynamic-configuration-filesystem.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index ef678870448f..afaf0e66f190 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -65,9 +65,13 @@ Step 4: Check initial config and web response Step 5: Edit ``cds.yaml`` file to update upstream cluster ********************************************************* +:download:`cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` + .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml - :emphasize-lines: 1, 16 + :linenos: + :lines: 9-16 + :emphasize-lines: 5 Step 6: Check web response again ******************************** From 6ad65c5e207e5f91176d0eca35ab7753c0f0040c Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 10:36:56 +0000 Subject: [PATCH 07/20] docs/ Signed-off-by: Ryan Northey --- docs/root/start/sandboxes/dynamic-configuration-filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index afaf0e66f190..a55e39de4288 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -1,4 +1,4 @@ -.. _install_sandboxes_dynamic_config_cp: +.. _install_sandboxes_dynamic_config_fs: Dynamic configuration (filesystem) ================================== From 2b507f85f885c474c86f56d685c8d4a48c65284e Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 11:14:41 +0000 Subject: [PATCH 08/20] docs/ Signed-off-by: Ryan Northey --- .../dynamic-configuration-filesystem.rst | 52 ++++++++++++++----- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index a55e39de4288..2170bed4a2bd 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -29,7 +29,7 @@ Step 3: Start the proxy container $ chmod go+r configs/* $ chmod go+x configs -First build the containers and start the ``proxy`` container. +Build and start the containers This should also start two backend ``HTTP`` echo servers, ``service1`` and ``service2``. @@ -38,7 +38,7 @@ This should also start two backend ``HTTP`` echo servers, ``service1`` and ``ser $ pwd envoy/examples/dynamic-config-fs $ docker-compose build --pull - $ docker-compose up -d proxy + $ docker-compose up -d $ docker-compose ps Name Command State Ports @@ -47,12 +47,30 @@ This should also start two backend ``HTTP`` echo servers, ``service1`` and ``ser dynamic-config-fs_service1_1 /bin/echo-server Up 8080/tcp dynamic-config-fs_service2_1 /bin/echo-server Up 8080/tcp -Step 4: Check initial config and web response -********************************************* +Step 4: Check web response +************************** + +You should be able to make a request to port ``10000``, which will be served by ``service1``. .. code-block:: console $ curl -s http://localhost:10000 + Request served by service1 + + HTTP/2.0 GET / + + Host: localhost:10000 + User-Agent: curl/7.72.0 + Accept: */* + X-Forwarded-Proto: http + X-Request-Id: 6672902d-56ca-456c-be6a-992a603cab9a + X-Envoy-Expected-Rq-Timeout-Ms: 15000 + +Step 4: Dump Envoy's ``dynamic_active_clusters`` config +******************************************************* + +If you now dump the proxy’s ``dynamic_active_clusters`` configuration, you should see it is configured with +the ``example_proxy_cluster`` pointing to ``service1``. .. code-block:: console @@ -60,30 +78,38 @@ Step 4: Check initial config and web response .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 3, 11, 19-20 + :emphasize-lines: 11, 19-20 Step 5: Edit ``cds.yaml`` file to update upstream cluster ********************************************************* -:download:`cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` +The example setup provides two dynamic configuration files, +:download:`cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a "Clusters +Discovery Service (CDS)" and :download:`lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` which +provides a "Listeners Discovery Service" (LDS). + +Edit ``configs/cds.yaml`` in the dynamic configuration example folder and change the cluster address +from ``service1`` to ``service2``: .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml :linenos: :lines: 9-16 - :emphasize-lines: 5 + :lineno-start: 9 + :emphasize-lines: 8 -Step 6: Check web response again -******************************** +Step 6: Check Envoy uses updated configuration +********************************************** + +Checking the web response again, you should now see that the request is handled by ``service2``: .. code-block:: console $ curl http://localhost:10000 | grep "served by" Request served by service2 - -Step 7: Check configs again -*************************** +Dumping the ``dynamic_active_clusters`` you should see in the cluster configuration that +``example_proxy_cluster`` is now configured to proxy to ``service2``: .. code-block:: console @@ -91,4 +117,4 @@ Step 7: Check configs again .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 3, 11, 19-20 + :emphasize-lines: 11, 19-20 From 3f3cbb2fa089275cd0ce157f41907bf7eef217c1 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 11:19:44 +0000 Subject: [PATCH 09/20] examples/ Signed-off-by: Ryan Northey --- examples/dynamic-config-fs/verify.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/examples/dynamic-config-fs/verify.sh b/examples/dynamic-config-fs/verify.sh index 366096f7789f..1799bd9575f9 100755 --- a/examples/dynamic-config-fs/verify.sh +++ b/examples/dynamic-config-fs/verify.sh @@ -14,9 +14,6 @@ responds_with \ http://localhost:10000 run_log "Check config for active clusters pointing to service1" -curl -s http://localhost:19000/config_dump \ - | jq -r '.configs[1].dynamic_active_clusters' \ - | grep '"version_info": "1"' curl -s http://localhost:19000/config_dump \ | jq -r '.configs[1].dynamic_active_clusters' \ | grep '"address": "service1"' @@ -33,7 +30,3 @@ run_log "Check config for active clusters pointing to service2" curl -s http://localhost:19000/config_dump \ | jq -r '.configs[1].dynamic_active_clusters' \ | grep '"address": "service2"' - -# curl -s http://localhost:19000/config_dump \ -# | jq -r '.configs[1].dynamic_active_clusters' \ -# | grep '"version_info": "2"' From 323bfc959702cb84575b7ed4057998ea474016c9 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 11:39:25 +0000 Subject: [PATCH 10/20] docs/ Signed-off-by: Ryan Northey --- .../dynamic-configuration-filesystem.rst | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 2170bed4a2bd..b3964f052892 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -74,19 +74,21 @@ the ``example_proxy_cluster`` pointing to ``service1``. .. code-block:: console - $ curl -s http://localhost:19000/config_dump jq -r '.configs[1].dynamic_active_clusters' + $ curl -s http://localhost:19000/config_dump | jq -r '.configs[1].dynamic_active_clusters' .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 11, 19-20 + :emphasize-lines: 11, 19 Step 5: Edit ``cds.yaml`` file to update upstream cluster ********************************************************* -The example setup provides two dynamic configuration files, -:download:`cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a "Clusters -Discovery Service (CDS)" and :download:`lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` which -provides a "Listeners Discovery Service" (LDS). +The example setup provides two dynamic configuration files: + +- :download:`configs/cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a "Clusters + Discovery Service (CDS)" +- :download:`configs/lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` to provide a "Listeners + Discovery Service" (LDS). Edit ``configs/cds.yaml`` in the dynamic configuration example folder and change the cluster address from ``service1`` to ``service2``: @@ -94,22 +96,22 @@ from ``service1`` to ``service2``: .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml :linenos: - :lines: 9-16 + :lines: 9-17 :lineno-start: 9 :emphasize-lines: 8 Step 6: Check Envoy uses updated configuration ********************************************** -Checking the web response again, you should now see that the request is handled by ``service2``: +Checking the web response again, the request should now be handled by ``service2``: .. code-block:: console $ curl http://localhost:10000 | grep "served by" Request served by service2 -Dumping the ``dynamic_active_clusters`` you should see in the cluster configuration that -``example_proxy_cluster`` is now configured to proxy to ``service2``: +Dumping the ``dynamic_active_clusters``, the cluster ``example_proxy_cluster`` should now be +configured to proxy to ``service2``: .. code-block:: console @@ -117,4 +119,4 @@ Dumping the ``dynamic_active_clusters`` you should see in the cluster configurat .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 11, 19-20 + :emphasize-lines: 11, 19 From d5c4cbe25c4e376381c3337712d44d8b1bb88202 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 11:40:15 +0000 Subject: [PATCH 11/20] docs/ Signed-off-by: Ryan Northey --- docs/root/start/sandboxes/dynamic-configuration-filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index b3964f052892..4d283260bc7d 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -29,7 +29,7 @@ Step 3: Start the proxy container $ chmod go+r configs/* $ chmod go+x configs -Build and start the containers +Build and start the containers. This should also start two backend ``HTTP`` echo servers, ``service1`` and ``service2``. From 997541e63fd55bf3509ae5da219e0fc564b5d0f5 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 12:20:49 +0000 Subject: [PATCH 12/20] docs Signed-off-by: Ryan Northey --- ...sponse-config-active-clusters-updated.json | 32 +++++++++++++++++++ .../dynamic-configuration-filesystem.rst | 18 +++++------ 2 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json diff --git a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json new file mode 100644 index 000000000000..9c26dfb083ab --- /dev/null +++ b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json @@ -0,0 +1,32 @@ +[ + { + "version_info": "1", + "cluster": { + "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster", + "name": "example_proxy_cluster", + "type": "LOGICAL_DNS", + "connect_timeout": "5s", + "dns_lookup_family": "V4_ONLY", + "load_assignment": { + "cluster_name": "example_proxy_cluster", + "endpoints": [ + { + "lb_endpoints": [ + { + "endpoint": { + "address": { + "socket_address": { + "address": "service2", + "port_value": 8080 + } + } + } + } + ] + } + ] + } + }, + "last_updated": "2020-10-25T20:37:05.838Z" + } +] diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 4d283260bc7d..393af0166324 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -31,7 +31,7 @@ Step 3: Start the proxy container Build and start the containers. -This should also start two backend ``HTTP`` echo servers, ``service1`` and ``service2``. +This should also start two upstream ``HTTP`` echo servers, ``service1`` and ``service2``. .. code-block:: console @@ -66,7 +66,7 @@ You should be able to make a request to port ``10000``, which will be served by X-Request-Id: 6672902d-56ca-456c-be6a-992a603cab9a X-Envoy-Expected-Rq-Timeout-Ms: 15000 -Step 4: Dump Envoy's ``dynamic_active_clusters`` config +Step 5: Dump Envoy's ``dynamic_active_clusters`` config ******************************************************* If you now dump the proxy’s ``dynamic_active_clusters`` configuration, you should see it is configured with @@ -78,17 +78,17 @@ the ``example_proxy_cluster`` pointing to ``service1``. .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 11, 19 + :emphasize-lines: 11, 19-20 Step 5: Edit ``cds.yaml`` file to update upstream cluster ********************************************************* The example setup provides two dynamic configuration files: -- :download:`configs/cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a "Clusters - Discovery Service (CDS)" -- :download:`configs/lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` to provide a "Listeners - Discovery Service" (LDS). +- :download:`configs/cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a :ref:`Cluster + Discovery Service (CDS) `. +- :download:`configs/lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` to provide a :ref:`Listener + Discovery Service (CDS) `. Edit ``configs/cds.yaml`` in the dynamic configuration example folder and change the cluster address from ``service1`` to ``service2``: @@ -117,6 +117,6 @@ configured to proxy to ``service2``: $ curl -s http://localhost:19000/config_dump jq -r '.configs[1].dynamic_active_clusters' -.. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json +.. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters-updated.json :language: json - :emphasize-lines: 11, 19 + :emphasize-lines: 11, 19-20 From b9807c5735fd2a0040e7a6627281479f1b71866a Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 12:50:14 +0000 Subject: [PATCH 13/20] docs/ Signed-off-by: Ryan Northey --- .../start/sandboxes/dynamic-configuration-filesystem.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 393af0166324..ff65decc1bf7 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -80,15 +80,15 @@ the ``example_proxy_cluster`` pointing to ``service1``. :language: json :emphasize-lines: 11, 19-20 -Step 5: Edit ``cds.yaml`` file to update upstream cluster -********************************************************* +Step 5: Edit ``configs/cds.yaml`` file to update upstream cluster +***************************************************************** The example setup provides two dynamic configuration files: - :download:`configs/cds.yaml <_include/dynamic-config-fs/configs/cds.yaml>` to provide a :ref:`Cluster - Discovery Service (CDS) `. + discovery service (CDS) `. - :download:`configs/lds.yaml <_include/dynamic-config-fs/configs/lds.yaml>` to provide a :ref:`Listener - Discovery Service (CDS) `. + discovery service (CDS) `. Edit ``configs/cds.yaml`` in the dynamic configuration example folder and change the cluster address from ``service1`` to ``service2``: From 614eed050deef943830d4aec92f9f2d4791b5ce5 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:26:57 +0000 Subject: [PATCH 14/20] examples/ Signed-off-by: Ryan Northey --- examples/dynamic-config-fs/configs/cds.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/dynamic-config-fs/configs/cds.yaml b/examples/dynamic-config-fs/configs/cds.yaml index 5b58accbc71d..3f661da7d7ab 100644 --- a/examples/dynamic-config-fs/configs/cds.yaml +++ b/examples/dynamic-config-fs/configs/cds.yaml @@ -1,5 +1,3 @@ -version_info: "1" - resources: - "@type": type.googleapis.com/envoy.config.cluster.v3.Cluster name: example_proxy_cluster From 621bfa8b106b0eec40bf99f73212dd87a3b92f89 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:27:43 +0000 Subject: [PATCH 15/20] examples/ Signed-off-by: Ryan Northey --- examples/dynamic-config-fs/configs/lds.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/dynamic-config-fs/configs/lds.yaml b/examples/dynamic-config-fs/configs/lds.yaml index 7febaca55136..4770f538ac25 100644 --- a/examples/dynamic-config-fs/configs/lds.yaml +++ b/examples/dynamic-config-fs/configs/lds.yaml @@ -1,5 +1,3 @@ -version_info: "1" - resources: - "@type": type.googleapis.com/envoy.config.listener.v3.Listener name: listener_0 From 01424b84f7430a9fb2947324f2131fa704c3663d Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:29:15 +0000 Subject: [PATCH 16/20] examples/ Signed-off-by: Ryan Northey --- examples/dynamic-config-fs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dynamic-config-fs/README.md b/examples/dynamic-config-fs/README.md index 346b020e98c8..3cb1ed49d940 100644 --- a/examples/dynamic-config-fs/README.md +++ b/examples/dynamic-config-fs/README.md @@ -1,2 +1,2 @@ To learn about this sandbox and for instructions on how to run it please head over -to the [Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/postgres.html). +to the [Envoy docs](https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/dynamic-configuration-filesystem.html). From 0ae395068947f602feb43a0f59391dd3654f184d Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:32:20 +0000 Subject: [PATCH 17/20] revert pipeline check Signed-off-by: Ryan Northey --- .azure-pipelines/pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/pipelines.yml b/.azure-pipelines/pipelines.yml index 7e2071702e38..8e26b1f61ff2 100644 --- a/.azure-pipelines/pipelines.yml +++ b/.azure-pipelines/pipelines.yml @@ -167,7 +167,7 @@ stages: AZP_BRANCH: $(Build.SourceBranch) - stage: linux_x64 - dependsOn: [] + dependsOn: ["precheck"] # For post-submit builds, continue even if precheck fails condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true))) jobs: @@ -181,7 +181,7 @@ stages: ciTarget: bazel.release - stage: linux_arm64 - dependsOn: [] + dependsOn: ["precheck"] # For post-submit builds, continue even if precheck fails condition: and(not(canceled()), or(succeeded(), eq(variables['PostSubmit'], true))) jobs: From d20b069714a903de00a951d68aab0185176dedb5 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:33:45 +0000 Subject: [PATCH 18/20] docs/ Signed-off-by: Ryan Northey --- .../root/start/sandboxes/dynamic-configuration-filesystem.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index ff65decc1bf7..6efdd7eb2250 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -96,8 +96,8 @@ from ``service1`` to ``service2``: .. literalinclude:: _include/dynamic-config-fs/configs/cds.yaml :language: yaml :linenos: - :lines: 9-17 - :lineno-start: 9 + :lines: 7-15 + :lineno-start: 7 :emphasize-lines: 8 Step 6: Check Envoy uses updated configuration From 430ef51a5070c26ebd26c0d9e5dbd749b1eb9a40 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:36:37 +0000 Subject: [PATCH 19/20] docs/ Signed-off-by: Ryan Northey --- docs/root/start/sandboxes/dynamic-configuration-filesystem.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 6efdd7eb2250..6b90206034b9 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -110,7 +110,7 @@ Checking the web response again, the request should now be handled by ``service2 $ curl http://localhost:10000 | grep "served by" Request served by service2 -Dumping the ``dynamic_active_clusters``, the cluster ``example_proxy_cluster`` should now be +Dumping the ``dynamic_active_clusters``, the ``example_proxy_cluster`` should now be configured to proxy to ``service2``: .. code-block:: console From eee6cba40ebbbf06a70a8018707dad2c8f4eb9ac Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Thu, 29 Oct 2020 15:51:01 +0000 Subject: [PATCH 20/20] docs/ Signed-off-by: Ryan Northey --- .../response-config-active-clusters-updated.json | 1 - .../dynamic-config-fs/response-config-active-clusters.json | 1 - .../root/start/sandboxes/dynamic-configuration-filesystem.rst | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json index 9c26dfb083ab..43b676e72d66 100644 --- a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json +++ b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters-updated.json @@ -1,6 +1,5 @@ [ { - "version_info": "1", "cluster": { "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster", "name": "example_proxy_cluster", diff --git a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json index f51d9df5e527..3813a9a9c56c 100644 --- a/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json +++ b/docs/root/start/sandboxes/_include/dynamic-config-fs/response-config-active-clusters.json @@ -1,6 +1,5 @@ [ { - "version_info": "1", "cluster": { "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster", "name": "example_proxy_cluster", diff --git a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst index 6b90206034b9..d71bee0e9673 100644 --- a/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst +++ b/docs/root/start/sandboxes/dynamic-configuration-filesystem.rst @@ -78,7 +78,7 @@ the ``example_proxy_cluster`` pointing to ``service1``. .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters.json :language: json - :emphasize-lines: 11, 19-20 + :emphasize-lines: 10, 18-19 Step 5: Edit ``configs/cds.yaml`` file to update upstream cluster ***************************************************************** @@ -119,4 +119,4 @@ configured to proxy to ``service2``: .. literalinclude:: _include/dynamic-config-fs/response-config-active-clusters-updated.json :language: json - :emphasize-lines: 11, 19-20 + :emphasize-lines: 10, 18-19