From e6e50304e2aa9116eb98e3408d9c79a9113067d7 Mon Sep 17 00:00:00 2001 From: Chris Thain Date: Mon, 12 Jun 2023 13:29:11 -0700 Subject: [PATCH] Update default values for Envoy extension proxy types --- .../configuration/property-override.mdx | 3 +- .../proxies/envoy-extensions/usage/lua.mdx | 35 +++++++++---------- .../usage/property-override.mdx | 26 +++++++------- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/website/content/docs/connect/proxies/envoy-extensions/configuration/property-override.mdx b/website/content/docs/connect/proxies/envoy-extensions/configuration/property-override.mdx index 9b13cb940b235..f88cd476a0bd0 100644 --- a/website/content/docs/connect/proxies/envoy-extensions/configuration/property-override.mdx +++ b/website/content/docs/connect/proxies/envoy-extensions/configuration/property-override.mdx @@ -17,7 +17,7 @@ The following list outlines the field hierarchy, data types, and requirements fo Click on a property name to view additional details, including default values. -- [`ProxyType`](#proxytype): string | required +- [`ProxyType`](#proxytype): string | `connect-proxy` - [`Debug`](#debug): bool | `false` - [`Patches`](#patches): list | required - [`ResourceFilter`](#patches-resourcefilter): map @@ -69,7 +69,6 @@ Specifies the type of Envoy proxy that the extension applies to. The only suppor #### Values - Default: `connect-proxy` -- This field is required. - Data type: String ### `Debug` diff --git a/website/content/docs/connect/proxies/envoy-extensions/usage/lua.mdx b/website/content/docs/connect/proxies/envoy-extensions/usage/lua.mdx index 496b7d5fa58f3..da9e4c9b0f102 100644 --- a/website/content/docs/connect/proxies/envoy-extensions/usage/lua.mdx +++ b/website/content/docs/connect/proxies/envoy-extensions/usage/lua.mdx @@ -15,11 +15,9 @@ Envoy filters support setting and getting dynamic metadata, allowing a filter to To use the Lua Envoy extension, configure the following arguments in the `EnvoyExtensions` block: -| Arguments | Description | -| -------------- | ------------------------------------------------------------------------------------------------ | -| `ProxyType` | Determines the proxy type the extension applies to. The only supported value is `connect-proxy`. | -| `ListenerType` | Specifies if the extension is applied to the `inbound` or `outbound` listener. | -| `Script` | The Lua script that is configured to run by the HTTP Lua filter. | +- `ProxyType`: string | `connect-proxy` - Determines the proxy type the extension applies to. The only supported value is `connect-proxy`. +- `ListenerType`: string | required - Specifies if the extension is applied to the `inbound` or `outbound` listener. +- `Script`: string | required - The Lua script that is configured to run by the HTTP Lua filter. ## Workflow @@ -44,16 +42,15 @@ The following example configures the Lua Envoy extension on every service by usi ```hcl -Kind = "proxy-defaults" -Name = "global" -Protocol = "http" +Kind = "proxy-defaults" +Name = "global" +Protocol = "http" EnvoyExtensions { Name = "builtin/lua" - Arguments = { ProxyType = "connect-proxy" - Listener = "inbound" - Script = <<-EOS + Listener = "inbound" + Script = <<-EOS function envoy_on_request(request_handle) meta = request_handle:streamInfo():dynamicMetadata() m = meta:get("consul") @@ -159,7 +156,7 @@ $ kubectl apply lua-envoy-extension-proxy-defaults.yaml In the following example, the `service-defaults` configure the Lua Envoy extension to insert the HTTP Lua filter for service `myservice` and add the Consul service name to the`x-consul-service` header for all inbound requests. The `ListenerType` makes it so that the extension applies only on the inbound listener of the service's connect proxy. - + ```hcl Kind = "service-defaults" @@ -170,8 +167,8 @@ EnvoyExtensions = [ Arguments = { ProxyType = "connect-proxy" - Listener = "inbound" - Script = < + ```hcl Kind = "service-defaults" @@ -198,8 +195,8 @@ EnvoyExtensions = [ Name = "builtin/lua", Arguments = { ProxyType = "connect-proxy" - Listener = "inbound" - Script = <<-EOF + Listener = "inbound" + Script = <<-EOF function envoy_on_request(request_handle) meta = request_handle:streamInfo():dynamicMetadata() m = meta:get("consul") @@ -212,8 +209,8 @@ end Name = "builtin/lua", Arguments = { ProxyType = "connect-proxy" - Listener = "inbound" - Script = <<-EOF + Listener = "inbound" + Script = <<-EOF function envoy_on_request(request_handle) meta = request_handle:streamInfo():dynamicMetadata() m = meta:get("consul") diff --git a/website/content/docs/connect/proxies/envoy-extensions/usage/property-override.mdx b/website/content/docs/connect/proxies/envoy-extensions/usage/property-override.mdx index 0166f84ec193d..8055402657879 100644 --- a/website/content/docs/connect/proxies/envoy-extensions/usage/property-override.mdx +++ b/website/content/docs/connect/proxies/envoy-extensions/usage/property-override.mdx @@ -32,28 +32,30 @@ In the following service defaults configuration entry example, Consul adds a new ```hcl -Kind = "service-defaults" -Name = "global" -Protocol = "http" +Kind = "service-defaults" +Name = "global" +Protocol = "http" EnvoyExtensions = [ { Name = "builtin/property-override" Arguments = { - ProxyType = "connect-proxy", + ProxyType = "connect-proxy" Patches = [ { ResourceFilter = { - ResourceType = "cluster", - TrafficDirection = "outbound" + ResourceType = "cluster" + TrafficDirection = "outbound" Services = [{ Name = "other-svc" - }], - Op = "add" - Path = "/upstream_connection_options/tcp_keepalive/keepalive_probes", - Value = 5, + }] + } + Op = "add" + Path = "/upstream_connection_options/tcp_keepalive/keepalive_probes" + Value = 5 } - ] - } + ] + } + } ] ```