From 76ba21812cc439aafb88fbceacbd788d5d309d88 Mon Sep 17 00:00:00 2001 From: zhaonan Date: Wed, 23 Aug 2023 20:12:56 +0800 Subject: [PATCH] feat: add doc and fix code Signed-off-by: zhaonan --- api/config/v1alpha1/envoyproxy_types.go | 5 +- ...ig.gateway.envoyproxy.io_envoyproxies.yaml | 5 +- docs/latest/api/config_types.md | 4 +- docs/latest/user/proxy-enhance.md | 49 +++++++++++++++++++ .../kubernetes/proxy/resource.go | 36 +++++++------- .../kubernetes/proxy/resource_provider.go | 4 +- .../proxy/testdata/deployments/bootstrap.yaml | 4 +- .../testdata/deployments/component-level.yaml | 4 +- .../proxy/testdata/deployments/custom.yaml | 4 +- .../testdata/deployments/default-env.yaml | 4 +- .../proxy/testdata/deployments/default.yaml | 4 +- .../testdata/deployments/enable-coredump.yaml | 25 ++++------ .../deployments/enable-prometheus.yaml | 4 +- .../testdata/deployments/extension-env.yaml | 4 +- .../proxy/testdata/deployments/volumes.yaml | 4 +- .../deployments/with-concurrency.yaml | 4 +- 16 files changed, 105 insertions(+), 59 deletions(-) create mode 100644 docs/latest/user/proxy-enhance.md diff --git a/api/config/v1alpha1/envoyproxy_types.go b/api/config/v1alpha1/envoyproxy_types.go index a2451eea067..85c0cbe075b 100644 --- a/api/config/v1alpha1/envoyproxy_types.go +++ b/api/config/v1alpha1/envoyproxy_types.go @@ -64,9 +64,10 @@ type EnvoyProxySpec struct { // +optional Concurrency *int32 `json:"concurrency,omitempty"` - // Enables core dumps for gateway. + // Enables core dumps for the managed Envoy Proxy fleet. // - // If set, gateway will have core dumps enabled. + // If set, the managed Envoy Proxy fleet will generate core dumps + // when they crash or experience a segmentation fault. // // +optional EnableCoreDump bool `json:"enableCoreDump,omitempty"` diff --git a/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml index 00e6e90bb9d..30473af4820 100644 --- a/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml @@ -71,8 +71,9 @@ spec: format: int32 type: integer enableCoreDump: - description: "Enables core dumps for gateway. \n If set, gateway will - have core dumps enabled." + description: "Enables core dumps for the managed Envoy Proxy fleet. + \n If set, the managed Envoy Proxy fleet will generate core dumps + when they crash or experience a segmentation fault." type: boolean logging: default: diff --git a/docs/latest/api/config_types.md b/docs/latest/api/config_types.md index 2531a8e3846..b606dda7361 100644 --- a/docs/latest/api/config_types.md +++ b/docs/latest/api/config_types.md @@ -334,8 +334,8 @@ _Appears in:_ | `telemetry` _[ProxyTelemetry](#proxytelemetry)_ | Telemetry defines telemetry parameters for managed proxies. | | `bootstrap` _[ProxyBootstrap](#proxybootstrap)_ | Bootstrap defines the Envoy Bootstrap as a YAML string. Visit https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap to learn more about the syntax. If set, this is the Bootstrap configuration used for the managed Envoy Proxy fleet instead of the default Bootstrap configuration set by Envoy Gateway. Some fields within the Bootstrap that are required to communicate with the xDS Server (Envoy Gateway) and receive xDS resources from it are not configurable and will result in the `EnvoyProxy` resource being rejected. Backward compatibility across minor versions is not guaranteed. We strongly recommend using `egctl x translate` to generate a `EnvoyProxy` resource with the `Bootstrap` field set to the default Bootstrap configuration used. You can edit this configuration, and rerun `egctl x translate` to ensure there are no validation errors. | | `concurrency` _integer_ | Concurrency defines the number of worker threads to run. If unset, it defaults to the number of cpuset threads on the platform. | -| `enableCoreDump` _boolean_ | Enables core dumps for gateway. - If set, gateway will have core dumps enabled. | +| `enableCoreDump` _boolean_ | Enables core dumps for the managed Envoy Proxy fleet. + If set, the managed Envoy Proxy fleet will generate core dumps when they crash or experience a segmentation fault. | diff --git a/docs/latest/user/proxy-enhance.md b/docs/latest/user/proxy-enhance.md new file mode 100644 index 00000000000..6cc165f4db9 --- /dev/null +++ b/docs/latest/user/proxy-enhance.md @@ -0,0 +1,49 @@ +# Proxy Enhance + +Envoy Gateway provides basic system debugging for the ControlPlane and the underlying EnvoyProxy instances. +This guide show you how to get a core file for debugging in proxy. + +## Prerequisites + +Follow the steps from the [Quickstart Guide](quickstart.md) to install Envoy Gateway and the example manifest. +Before proceeding, you should be able to query the example backend using HTTP. + +### Add GatewayClass ParametersRef +First, you need to add ParametersRef in GatewayClass, and refer to EnvoyProxy Config: + +```shell +cat <