diff --git a/.circleci/config.yml b/.circleci/config.yml index 13f963adb..efa960f5e 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 d646bfe93..54287069b 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 4bc5432ab..0aaee2787 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 3e58f8679..a3ceaf9e7 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 2b8851377..fc704bd6a 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 6d8c7980f..b81fc2b1e 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 9b8b656ea..264b0dc66 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 726828984..845361ec1 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 57e660f1b..7ab52ab78 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 c58d4d32c..f51834610 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 c58d4d32c..f51834610 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 c58d4d32c..f51834610 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 76ccbc23c..a302087c9 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 8b83fbba0..b793637bf 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 72693933b..6f5fd0d56 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 72693933b..6f5fd0d56 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 72693933b..6f5fd0d56 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 72693933b..6f5fd0d56 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 74bcab3be..ca9a24eb9 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 a89745395..2df2a12c8 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 a5cfdfdff..4ce0a117f 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 8ca335807..e40201a31 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 51ae8628a..aab568caa 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 d8ac9fdb8..e2e62a46d 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† |