From 9cb7adb304a928d042e6896857a5bbdbf14be7ce Mon Sep 17 00:00:00 2001 From: Hans Hasselberg Date: Mon, 10 Feb 2020 20:53:04 +0100 Subject: [PATCH] add envoy version 1.12.2 and 1.13.0 to the matrix (#7240) * add 1.12.2 * add envoy 1.13.0 * Introduce -envoy-version to get 1.10.0 passing. * update old version and fix consul-exec case * add envoy_version and fix check * Update Envoy CLI tests to account for the 1.13 compatibility changes. Co-authored-by: Matt Keeler --- .circleci/config.yml | 31 +++++++++---------- command/connect/envoy/bootstrap_tpl.go | 21 ++++++++++++- command/connect/envoy/envoy.go | 5 +++ command/connect/envoy/envoy_test.go | 17 ++++++++++ .../envoy/testdata/access-log-path.golden | 15 ++++++++- .../connect/envoy/testdata/defaults.golden | 15 ++++++++- .../envoy/testdata/existing-ca-file.golden | 15 ++++++++- .../envoy/testdata/extra_-multiple.golden | 15 ++++++++- .../envoy/testdata/extra_-single.golden | 15 ++++++++- .../envoy/testdata/grpc-addr-config.golden | 15 ++++++++- .../envoy/testdata/grpc-addr-env.golden | 15 ++++++++- .../envoy/testdata/grpc-addr-flag.golden | 15 ++++++++- .../envoy/testdata/grpc-addr-unix.golden | 15 ++++++++- .../testdata/stats-config-override.golden | 15 ++++++++- .../connect/envoy/testdata/token-arg.golden | 15 ++++++++- .../connect/envoy/testdata/token-env.golden | 15 ++++++++- .../envoy/testdata/token-file-arg.golden | 15 ++++++++- .../envoy/testdata/token-file-env.golden | 15 ++++++++- .../testdata/zipkin-tracing-config.golden | 15 ++++++++- .../connect/envoy/docker-compose.yml | 30 +++++++++--------- test/integration/connect/envoy/helpers.bash | 10 +++++- test/integration/connect/envoy/run-tests.sh | 3 +- .../docs/commands/connect/envoy.html.md.erb | 3 ++ website/source/docs/connect/proxies/envoy.md | 3 +- 24 files changed, 298 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13f963adba..efa960f5ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -525,14 +525,13 @@ jobs: - store_test_results: path: ui-v2/test-results - # Envoy integration tests. Require docker dev binary to be built already - envoy-integration-test-1.8.0: + envoy-integration-test-1.10.0: docker: # We only really need bash and docker-compose which is installed on all # Circle images but pick Go since we have to pick one of them. - image: *GOLANG_IMAGE environment: - ENVOY_VERSIONS: "1.8.0" + ENVOY_VERSIONS: "1.10.0" steps: &ENVOY_INTEGRATION_TEST_STEPS - checkout # Get go binary from workspace @@ -552,25 +551,25 @@ jobs: path: ./test/integration/connect/envoy/workdir/logs destination: container-logs - envoy-integration-test-1.9.1: + envoy-integration-test-1.11.2: docker: - image: *GOLANG_IMAGE environment: - ENVOY_VERSIONS: "1.9.1" + ENVOY_VERSIONS: "1.11.2" steps: *ENVOY_INTEGRATION_TEST_STEPS - envoy-integration-test-1.10.0: + envoy-integration-test-1.12.2: docker: - image: *GOLANG_IMAGE environment: - ENVOY_VERSIONS: "1.10.0" + ENVOY_VERSIONS: "1.12.2" steps: *ENVOY_INTEGRATION_TEST_STEPS - envoy-integration-test-1.11.1: + envoy-integration-test-1.13.0: docker: - image: *GOLANG_IMAGE environment: - ENVOY_VERSIONS: "1.11.1" + ENVOY_VERSIONS: "1.13.0" steps: *ENVOY_INTEGRATION_TEST_STEPS # run tests on vault ca provider integration tests @@ -656,16 +655,16 @@ workflows: - nomad-integration-0_8: requires: - dev-build - - envoy-integration-test-1.8.0: - requires: - - dev-build - - envoy-integration-test-1.9.1: - requires: - - dev-build - envoy-integration-test-1.10.0: requires: - dev-build - - envoy-integration-test-1.11.1: + - envoy-integration-test-1.11.2: + requires: + - dev-build + - envoy-integration-test-1.12.2: + requires: + - dev-build + - envoy-integration-test-1.13.0: requires: - dev-build - vault-ca-provider: diff --git a/command/connect/envoy/bootstrap_tpl.go b/command/connect/envoy/bootstrap_tpl.go index d646bfe930..54287069be 100644 --- a/command/connect/envoy/bootstrap_tpl.go +++ b/command/connect/envoy/bootstrap_tpl.go @@ -96,6 +96,10 @@ type BootstrapTplArgs struct { // Namespace is the Consul Enterprise Namespace of the proxy service instance as // registered with the Consul agent. Namespace string + + // EnvoyVersion is the envoy version, which is necessary to generate the + // correct configuration. + EnvoyVersion string } const bootstrapTemplate = `{ @@ -112,7 +116,8 @@ const bootstrapTemplate = `{ "cluster": "{{ .ProxyCluster }}", "id": "{{ .ProxyID }}", "metadata": { - "namespace": "{{if ne .Namespace ""}}{{ .Namespace }}{{else}}default{{end}}" + "namespace": "{{if ne .Namespace ""}}{{ .Namespace }}{{else}}default{{end}}", + "envoy_version": "{{ .EnvoyVersion }}" } }, "static_resources": { @@ -190,6 +195,20 @@ const bootstrapTemplate = `{ } } } + {{- if ne .EnvoyVersion "1.10.0"}} + }, + "layered_runtime":{ + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] + {{- end }} } } ` diff --git a/command/connect/envoy/envoy.go b/command/connect/envoy/envoy.go index 4bc5432ab4..0aaee2787e 100644 --- a/command/connect/envoy/envoy.go +++ b/command/connect/envoy/envoy.go @@ -56,6 +56,7 @@ type cmd struct { bootstrap bool disableCentralConfig bool grpcAddr string + envoyVersion string // mesh gateway registration information register bool @@ -110,6 +111,9 @@ func (c *cmd) init() { "Set the agent's gRPC address and port (in http(s)://host:port format). "+ "Alternatively, you can specify CONSUL_GRPC_ADDR in ENV.") + c.flags.StringVar(&c.envoyVersion, "envoy-version", "1.13.0", + "Sets the envoy-version that the envoy binary has.") + c.flags.BoolVar(&c.register, "register", false, "Register a new Mesh Gateway service before configuring and starting Envoy") @@ -519,6 +523,7 @@ func (c *cmd) templateArgs() (*BootstrapTplArgs, error) { Token: httpCfg.Token, LocalAgentClusterName: xds.LocalAgentClusterName, Namespace: httpCfg.Namespace, + EnvoyVersion: c.envoyVersion, }, nil } diff --git a/command/connect/envoy/envoy_test.go b/command/connect/envoy/envoy_test.go index 3e58f8679f..a3ceaf9e73 100644 --- a/command/connect/envoy/envoy_test.go +++ b/command/connect/envoy/envoy_test.go @@ -83,6 +83,7 @@ func TestGenerateConfig(t *testing.T) { Flags: []string{"-proxy-id", "test-proxy"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -99,6 +100,7 @@ func TestGenerateConfig(t *testing.T) { "-token", "c9a52720-bf6c-4aa6-b8bc-66881a5ade95"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -117,6 +119,7 @@ func TestGenerateConfig(t *testing.T) { "CONSUL_HTTP_TOKEN=c9a52720-bf6c-4aa6-b8bc-66881a5ade95", }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -138,6 +141,7 @@ func TestGenerateConfig(t *testing.T) { "token.txt": "c9a52720-bf6c-4aa6-b8bc-66881a5ade95", }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -159,6 +163,7 @@ func TestGenerateConfig(t *testing.T) { "token.txt": "c9a52720-bf6c-4aa6-b8bc-66881a5ade95", }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -176,6 +181,7 @@ func TestGenerateConfig(t *testing.T) { "-grpc-addr", "localhost:9999"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -196,6 +202,7 @@ func TestGenerateConfig(t *testing.T) { "CONSUL_GRPC_ADDR=localhost:9999", }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -215,6 +222,7 @@ func TestGenerateConfig(t *testing.T) { "-grpc-addr", "unix:///var/run/consul.sock"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentSocket: "/var/run/consul.sock", @@ -229,6 +237,7 @@ func TestGenerateConfig(t *testing.T) { Flags: []string{"-proxy-id", "test-proxy"}, GRPCPort: 9999, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -247,6 +256,7 @@ func TestGenerateConfig(t *testing.T) { Flags: []string{"-proxy-id", "test-proxy", "-admin-access-log-path", "/some/path/access.log"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -265,6 +275,7 @@ func TestGenerateConfig(t *testing.T) { Flags: []string{"-proxy-id", "test-proxy", "-ca-file", "some/path"}, Env: []string{}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -280,6 +291,7 @@ func TestGenerateConfig(t *testing.T) { Flags: []string{"-proxy-id", "test-proxy", "-ca-file", "../../../test/ca/root.cer"}, Env: []string{"CONSUL_HTTP_SSL=1"}, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", // Should resolve IP, note this might not resolve the same way @@ -322,6 +334,7 @@ func TestGenerateConfig(t *testing.T) { }`, }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -354,6 +367,7 @@ func TestGenerateConfig(t *testing.T) { }`, }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -391,6 +405,7 @@ func TestGenerateConfig(t *testing.T) { } , { "name": "fake_sink_2" }`, }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -415,6 +430,7 @@ func TestGenerateConfig(t *testing.T) { }`, }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", @@ -469,6 +485,7 @@ func TestGenerateConfig(t *testing.T) { }`, }, WantArgs: BootstrapTplArgs{ + EnvoyVersion: "1.13.0", ProxyCluster: "test-proxy", ProxyID: "test-proxy", AgentAddress: "127.0.0.1", diff --git a/command/connect/envoy/testdata/access-log-path.golden b/command/connect/envoy/testdata/access-log-path.golden index 2b8851377c..fc704bd6a5 100644 --- a/command/connect/envoy/testdata/access-log-path.golden +++ b/command/connect/envoy/testdata/access-log-path.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/defaults.golden b/command/connect/envoy/testdata/defaults.golden index 6d8c7980f6..b81fc2b1e9 100644 --- a/command/connect/envoy/testdata/defaults.golden +++ b/command/connect/envoy/testdata/defaults.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/existing-ca-file.golden b/command/connect/envoy/testdata/existing-ca-file.golden index 9b8b656ea3..264b0dc667 100644 --- a/command/connect/envoy/testdata/existing-ca-file.golden +++ b/command/connect/envoy/testdata/existing-ca-file.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -108,5 +109,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/extra_-multiple.golden b/command/connect/envoy/testdata/extra_-multiple.golden index 7268289847..845361ec13 100644 --- a/command/connect/envoy/testdata/extra_-multiple.golden +++ b/command/connect/envoy/testdata/extra_-multiple.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -121,5 +122,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/extra_-single.golden b/command/connect/envoy/testdata/extra_-single.golden index 57e660f1b2..7ab52ab78e 100644 --- a/command/connect/envoy/testdata/extra_-single.golden +++ b/command/connect/envoy/testdata/extra_-single.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -112,5 +113,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/grpc-addr-config.golden b/command/connect/envoy/testdata/grpc-addr-config.golden index c58d4d32cd..f51834610f 100644 --- a/command/connect/envoy/testdata/grpc-addr-config.golden +++ b/command/connect/envoy/testdata/grpc-addr-config.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/grpc-addr-env.golden b/command/connect/envoy/testdata/grpc-addr-env.golden index c58d4d32cd..f51834610f 100644 --- a/command/connect/envoy/testdata/grpc-addr-env.golden +++ b/command/connect/envoy/testdata/grpc-addr-env.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/grpc-addr-flag.golden b/command/connect/envoy/testdata/grpc-addr-flag.golden index c58d4d32cd..f51834610f 100644 --- a/command/connect/envoy/testdata/grpc-addr-flag.golden +++ b/command/connect/envoy/testdata/grpc-addr-flag.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/grpc-addr-unix.golden b/command/connect/envoy/testdata/grpc-addr-unix.golden index 76ccbc23ca..a302087c92 100644 --- a/command/connect/envoy/testdata/grpc-addr-unix.golden +++ b/command/connect/envoy/testdata/grpc-addr-unix.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -98,5 +99,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/stats-config-override.golden b/command/connect/envoy/testdata/stats-config-override.golden index 8b83fbba04..b793637bff 100644 --- a/command/connect/envoy/testdata/stats-config-override.golden +++ b/command/connect/envoy/testdata/stats-config-override.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -57,5 +58,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/token-arg.golden b/command/connect/envoy/testdata/token-arg.golden index 72693933b9..6f5fd0d56a 100644 --- a/command/connect/envoy/testdata/token-arg.golden +++ b/command/connect/envoy/testdata/token-arg.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/token-env.golden b/command/connect/envoy/testdata/token-env.golden index 72693933b9..6f5fd0d56a 100644 --- a/command/connect/envoy/testdata/token-env.golden +++ b/command/connect/envoy/testdata/token-env.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/token-file-arg.golden b/command/connect/envoy/testdata/token-file-arg.golden index 72693933b9..6f5fd0d56a 100644 --- a/command/connect/envoy/testdata/token-file-arg.golden +++ b/command/connect/envoy/testdata/token-file-arg.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/token-file-env.golden b/command/connect/envoy/testdata/token-file-env.golden index 72693933b9..6f5fd0d56a 100644 --- a/command/connect/envoy/testdata/token-file-env.golden +++ b/command/connect/envoy/testdata/token-file-env.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -99,5 +100,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/command/connect/envoy/testdata/zipkin-tracing-config.golden b/command/connect/envoy/testdata/zipkin-tracing-config.golden index 74bcab3be0..ca9a24eb9a 100644 --- a/command/connect/envoy/testdata/zipkin-tracing-config.golden +++ b/command/connect/envoy/testdata/zipkin-tracing-config.golden @@ -12,7 +12,8 @@ "cluster": "test-proxy", "id": "test-proxy", "metadata": { - "namespace": "default" + "namespace": "default", + "envoy_version": "1.13.0" } }, "static_resources": { @@ -132,5 +133,17 @@ } } } + }, + "layered_runtime": { + "layers": [ + { + "name": "static_layer", + "static_layer": { + "envoy.deprecated_features:envoy.api.v2.Cluster.tls_context": true, + "envoy.deprecated_features:envoy.config.trace.v2.ZipkinConfig.HTTP_JSON_V1": true, + "envoy.deprecated_features:envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager.Tracing.operation_name": true + } + } + ] } } diff --git a/test/integration/connect/envoy/docker-compose.yml b/test/integration/connect/envoy/docker-compose.yml index a89745395f..2df2a12c81 100644 --- a/test/integration/connect/envoy/docker-compose.yml +++ b/test/integration/connect/envoy/docker-compose.yml @@ -175,7 +175,7 @@ services: s1-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -196,7 +196,7 @@ services: s2-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -217,7 +217,7 @@ services: s2-v1-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -238,7 +238,7 @@ services: s2-v2-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -259,7 +259,7 @@ services: s3-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -280,7 +280,7 @@ services: s3-v1-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -301,7 +301,7 @@ services: s3-v2-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -322,7 +322,7 @@ services: s3-alt-sidecar-proxy: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -363,14 +363,16 @@ services: context: . dockerfile: Dockerfile-consul-envoy args: - ENVOY_VERSION: ${ENVOY_VERSION:-1.8.0} - image: consul-dev-envoy:${ENVOY_VERSION:-1.8.0} + ENVOY_VERSION: ${ENVOY_VERSION} + image: consul-dev-envoy:${ENVOY_VERSION} command: - "consul" - "connect" - "envoy" - "-sidecar-for" - "s1" + - "-envoy-version" + - ${ENVOY_VERSION} - "--" - "-l" - "debug" @@ -480,7 +482,7 @@ services: s1-sidecar-proxy-secondary: depends_on: - consul-secondary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -501,7 +503,7 @@ services: s2-sidecar-proxy-secondary: depends_on: - consul-secondary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -522,7 +524,7 @@ services: gateway-primary: depends_on: - consul-primary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" @@ -543,7 +545,7 @@ services: gateway-secondary: depends_on: - consul-secondary - image: "envoyproxy/envoy:v${ENVOY_VERSION:-1.8.0}" + image: "envoyproxy/envoy:v${ENVOY_VERSION}" command: - "envoy" - "-c" diff --git a/test/integration/connect/envoy/helpers.bash b/test/integration/connect/envoy/helpers.bash index a5cfdfdffc..4ce0a117f4 100755 --- a/test/integration/connect/envoy/helpers.bash +++ b/test/integration/connect/envoy/helpers.bash @@ -144,7 +144,14 @@ function get_envoy_listener_filters { local HOSTPORT=$1 run retry_default curl -s -f $HOSTPORT/config_dump [ "$status" -eq 0 ] - echo "$output" | jq --raw-output '.configs[2].dynamic_active_listeners[].listener | "\(.name) \( .filter_chains[0].filters | map(.name) | join(","))"' + local ENVOY_VERSION=$(echo $output | jq --raw-output '.configs[0].bootstrap.node.metadata.envoy_version') + local QUERY='' + if [ "$ENVOY_VERSION" == "1.13.0" ]; then + QUERY='.configs[2].dynamic_listeners[].active_state.listener | "\(.name) \( .filter_chains[0].filters | map(.name) | join(","))"' + else + QUERY='.configs[2].dynamic_active_listeners[].listener | "\(.name) \( .filter_chains[0].filters | map(.name) | join(","))"' + fi + echo "$output" | jq --raw-output "$QUERY" } function get_envoy_cluster_threshold { @@ -508,6 +515,7 @@ function gen_envoy_bootstrap { if output=$(docker_consul "$DC" connect envoy -bootstrap \ -proxy-id $PROXY_ID \ + -envoy-version "$ENVOY_VERSION" \ -admin-bind 0.0.0.0:$ADMIN_PORT ${EXTRA_ENVOY_BS_ARGS} 2>&1); then # All OK, write config to file diff --git a/test/integration/connect/envoy/run-tests.sh b/test/integration/connect/envoy/run-tests.sh index 8ca3358074..e40201a31d 100755 --- a/test/integration/connect/envoy/run-tests.sh +++ b/test/integration/connect/envoy/run-tests.sh @@ -17,7 +17,7 @@ FILTER_TESTS=${FILTER_TESTS:-} STOP_ON_FAIL=${STOP_ON_FAIL:-} # ENVOY_VERSIONS is the list of envoy versions to run each test against -ENVOY_VERSIONS=${ENVOY_VERSIONS:-"1.10.0 1.9.1 1.8.0 1.11.2"} +ENVOY_VERSIONS=${ENVOY_VERSIONS:-"1.10.0 1.11.2 1.12.2 1.13.0"} if [ ! -z "$DEBUG" ] ; then set -x @@ -27,7 +27,6 @@ DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd $DIR -FILTER_TESTS=${FILTER_TESTS:-} LEAVE_CONSUL_UP=${LEAVE_CONSUL_UP:-} PROXY_LOGS_ON_FAIL=${PROXY_LOGS_ON_FAIL:-} diff --git a/website/source/docs/commands/connect/envoy.html.md.erb b/website/source/docs/commands/connect/envoy.html.md.erb index 51ae8628ab..aab568caa8 100644 --- a/website/source/docs/commands/connect/envoy.html.md.erb +++ b/website/source/docs/commands/connect/envoy.html.md.erb @@ -73,6 +73,9 @@ proxy configuration needed. for and so can be used to access any upstream service that that service is allowed to access by [Connect intentions](/docs/connect/intentions.html). + * `-envoy-version` - The version of envoy that is being started. Default is + `1.13.0`. This is required so that the correct configuration can be generated. + * `-- [pass-through options]` - Any options given after a double dash are passed directly through to the `envoy` invocation. See [Envoy's documentation](https://www.envoyproxy.io/docs) for more details. The command diff --git a/website/source/docs/connect/proxies/envoy.md b/website/source/docs/connect/proxies/envoy.md index d8ac9fdb85..e2e62a46df 100644 --- a/website/source/docs/connect/proxies/envoy.md +++ b/website/source/docs/connect/proxies/envoy.md @@ -36,7 +36,8 @@ compatible Envoy versions. | Consul Version | Compatible Envoy Versions | |---|---| -| 1.5.2 and higher | 1.11.1 1.10.0, 1.9.1, 1.8.0† | +| 1.7.0 and higher | 1.12.2, 1.11.2, 1.10.0, 1.9.1 | +| 1.5.2, 1.5.3, 1.6.x | 1.11.1, 1.10.0, 1.9.1, 1.8.0† | | 1.5.0, 1.5.1 | 1.9.1, 1.8.0† | | 1.3.x, 1.4.x | 1.9.1, 1.8.0†, 1.7.0† |