From c70144b4799a0ac3761fb79bb07b26e362c988eb Mon Sep 17 00:00:00 2001 From: Karol Szwaj Date: Tue, 26 Sep 2023 23:12:48 +0200 Subject: [PATCH] api: add mergeGateways field to EnvoyProxy spec (#1289) * Add mergeGateways field to EnvoyProxy spec Signed-off-by: Karol Szwaj * Update api/config/v1alpha1/envoyproxy_types.go Co-authored-by: Arko Dasgupta Signed-off-by: Karol Szwaj * Fix dot Signed-off-by: Karol Szwaj --------- Signed-off-by: Karol Szwaj Co-authored-by: Arko Dasgupta --- api/config/v1alpha1/envoyproxy_types.go | 8 ++++++++ api/config/v1alpha1/zz_generated.deepcopy.go | 5 +++++ .../config.gateway.envoyproxy.io_envoyproxies.yaml | 9 +++++++++ docs/latest/api/config_types.md | 1 + 4 files changed, 23 insertions(+) diff --git a/api/config/v1alpha1/envoyproxy_types.go b/api/config/v1alpha1/envoyproxy_types.go index ba6664baec0..dd0f2f1447a 100644 --- a/api/config/v1alpha1/envoyproxy_types.go +++ b/api/config/v1alpha1/envoyproxy_types.go @@ -63,6 +63,14 @@ type EnvoyProxySpec struct { // // +optional Concurrency *int32 `json:"concurrency,omitempty"` + + // MergeGateways defines if Gateway resources should be merged onto the same Envoy Proxy Infrastructure. + // Setting this field to true would merge all Gateway Listeners under the parent Gateway Class. + // This means that the port, protocol and hostname tuple must be unique for every listener. + // If a duplicate listener is detected, the newer listener (based on timestamp) will be rejected and its status will be updated with a "Accepted=False" condition. + // + // +optional + MergeGateways *bool `json:"mergeGateways,omitempty"` } type ProxyTelemetry struct { diff --git a/api/config/v1alpha1/zz_generated.deepcopy.go b/api/config/v1alpha1/zz_generated.deepcopy.go index 76a6146adf8..9a5abf68a76 100644 --- a/api/config/v1alpha1/zz_generated.deepcopy.go +++ b/api/config/v1alpha1/zz_generated.deepcopy.go @@ -471,6 +471,11 @@ func (in *EnvoyProxySpec) DeepCopyInto(out *EnvoyProxySpec) { *out = new(int32) **out = **in } + if in.MergeGateways != nil { + in, out := &in.MergeGateways, &out.MergeGateways + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyProxySpec. 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 c759f858b69..9351f934044 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 @@ -95,6 +95,15 @@ spec: unspecified, defaults to "default: warn".' type: object type: object + mergeGateways: + description: MergeGateways defines if Gateway resources should be + merged onto the same Envoy Proxy Infrastructure. Setting this field + to true would merge all Gateway Listeners under the parent Gateway + Class. This means that the port, protocol and hostname tuple must + be unique for every listener. If a duplicate listener is detected, + the newer listener (based on timestamp) will be rejected and its + status will be updated with a "Accepted=False" condition. + type: boolean provider: description: Provider defines the desired resource provider and provider-specific configuration. If unspecified, the "Kubernetes" resource provider diff --git a/docs/latest/api/config_types.md b/docs/latest/api/config_types.md index e62d2fa6137..5ef796047c6 100644 --- a/docs/latest/api/config_types.md +++ b/docs/latest/api/config_types.md @@ -334,6 +334,7 @@ _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. | +| `mergeGateways` _boolean_ | MergeGateways defines if Gateway resources should be merged onto the same Envoy Proxy Infrastructure. Setting this field to true would merge all Gateway Listeners under the parent Gateway Class. This means that the port, protocol and hostname tuple must be unique for every listener. If a duplicate listener is detected, the newer listener (based on timestamp) will be rejected and its status will be updated with a "Accepted=False" condition. |