From b285e773031eb1598b154c79f124c19364a0ad1d Mon Sep 17 00:00:00 2001 From: tmsnan Date: Tue, 2 Jan 2024 22:43:32 +0800 Subject: [PATCH] bugfix: support eds cache (#2388) --- .../testdata/translate/out/default-resources.all.yaml | 10 ++++++++++ .../testdata/translate/out/envoy-patch-policy.all.yaml | 5 +++++ .../translate/out/from-gateway-api-to-xds.all.json | 10 ++++++++++ .../translate/out/from-gateway-api-to-xds.all.yaml | 5 +++++ .../out/from-gateway-api-to-xds.bootstrap.yaml | 5 +++++ .../out/jwt-single-route-single-match-to-xds.all.json | 10 ++++++++++ .../out/jwt-single-route-single-match-to-xds.all.yaml | 5 +++++ ...jwt-single-route-single-match-to-xds.bootstrap.yaml | 5 +++++ .../kubernetes/proxy/testdata/deployments/custom.yaml | 5 +++++ .../deployments/custom_with_initcontainers.yaml | 5 +++++ .../proxy/testdata/deployments/default-env.yaml | 5 +++++ .../kubernetes/proxy/testdata/deployments/default.yaml | 5 +++++ .../proxy/testdata/deployments/enable-prometheus.yaml | 5 +++++ .../proxy/testdata/deployments/extension-env.yaml | 5 +++++ .../deployments/override-labels-and-annotations.yaml | 5 +++++ .../kubernetes/proxy/testdata/deployments/volumes.yaml | 5 +++++ .../proxy/testdata/deployments/with-annotations.yaml | 5 +++++ .../testdata/deployments/with-image-pull-secrets.yaml | 5 +++++ .../proxy/testdata/deployments/with-node-selector.yaml | 5 +++++ .../deployments/with-topology-spread-constraints.yaml | 5 +++++ internal/xds/bootstrap/bootstrap.yaml.tpl | 5 +++++ .../xds/bootstrap/testdata/custom-stats-matcher.yaml | 5 +++++ .../xds/bootstrap/testdata/disable-prometheus.yaml | 5 +++++ internal/xds/bootstrap/testdata/enable-prometheus.yaml | 5 +++++ internal/xds/bootstrap/testdata/otel-metrics.yaml | 5 +++++ 25 files changed, 140 insertions(+) diff --git a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml index 83d2c82e6d8..c11c272db86 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -17,6 +17,11 @@ envoyProxy: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC @@ -494,6 +499,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml index fb054e518bb..edac1862cfb 100644 --- a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml @@ -27,6 +27,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json index 1e461964bbf..9de218a8d83 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json @@ -44,6 +44,16 @@ "resourceApiVersion": "V3" } }, + "layeredRuntime": { + "layers": [ + { + "name": "global_config", + "staticLayer": { + "envoy.restart_features.use_eds_cache_for_ads": true + } + } + ] + }, "staticResources": { "clusters": [ { diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml index 5c5b27e97f9..f6f6822b0a5 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml @@ -27,6 +27,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml index 27b7bc7bb2a..2e32692abbb 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml @@ -26,6 +26,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json index f3452b71909..c35f2931369 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json @@ -44,6 +44,16 @@ "resourceApiVersion": "V3" } }, + "layeredRuntime": { + "layers": [ + { + "name": "global_config", + "staticLayer": { + "envoy.restart_features.use_eds_cache_for_ads": true + } + } + ] + }, "staticResources": { "clusters": [ { diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml index 6f26675e23f..91b08a8cd7b 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml @@ -27,6 +27,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml index e92c54f0dbc..df95cda5c56 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml @@ -26,6 +26,11 @@ xds: ldsConfig: ads: {} resourceApiVersion: V3 + layeredRuntime: + layers: + - name: global_config + staticLayer: + envoy.restart_features.use_eds_cache_for_ads: true staticResources: clusters: - connectTimeout: 0.250s diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml index 2a1fe754986..dfec805cd7c 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml @@ -50,6 +50,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml index b8aa8192d25..496954f905d 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml @@ -49,6 +49,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml index e6b1a8bd9cf..bb5f0855fbf 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml @@ -47,6 +47,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml index b735c371a13..9287d989dab 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml @@ -45,6 +45,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml index 7732de9f065..2ea1e80535f 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml @@ -49,6 +49,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml index 172511c44ac..a8cf77eae24 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml @@ -47,6 +47,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/override-labels-and-annotations.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/override-labels-and-annotations.yaml index df2bb0e6a46..a959265e023 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/override-labels-and-annotations.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/override-labels-and-annotations.yaml @@ -57,6 +57,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml index bdebfe89faf..4f77ef6f0df 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml @@ -47,6 +47,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-annotations.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-annotations.yaml index 6b0367843de..6fabe74a77c 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-annotations.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-annotations.yaml @@ -51,6 +51,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-image-pull-secrets.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-image-pull-secrets.yaml index aaa51a879fa..71adf745f02 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-image-pull-secrets.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-image-pull-secrets.yaml @@ -45,6 +45,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-node-selector.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-node-selector.yaml index 9763b207395..01c1390e55d 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-node-selector.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-node-selector.yaml @@ -45,6 +45,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-topology-spread-constraints.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-topology-spread-constraints.yaml index 96d102c3f5f..88ff315efdf 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-topology-spread-constraints.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/with-topology-spread-constraints.yaml @@ -45,6 +45,11 @@ spec: socket_address: address: 127.0.0.1 port_value: 19000 + layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/xds/bootstrap/bootstrap.yaml.tpl b/internal/xds/bootstrap/bootstrap.yaml.tpl index ab6a3516510..56d0552f91c 100644 --- a/internal/xds/bootstrap/bootstrap.yaml.tpl +++ b/internal/xds/bootstrap/bootstrap.yaml.tpl @@ -28,6 +28,11 @@ stats_config: regex: {{js $item}} {{- end}} {{- end }} +layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml b/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml index c8376470146..58294aed4dd 100644 --- a/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml +++ b/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml @@ -19,6 +19,11 @@ stats_config: - safe_regex: google_re2: {} regex: virtual.* +layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/xds/bootstrap/testdata/disable-prometheus.yaml b/internal/xds/bootstrap/testdata/disable-prometheus.yaml index 4cfe3d7d2b0..f6933c0de77 100644 --- a/internal/xds/bootstrap/testdata/disable-prometheus.yaml +++ b/internal/xds/bootstrap/testdata/disable-prometheus.yaml @@ -8,6 +8,11 @@ admin: socket_address: address: 127.0.0.1 port_value: 19000 +layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/xds/bootstrap/testdata/enable-prometheus.yaml b/internal/xds/bootstrap/testdata/enable-prometheus.yaml index 667729dadf1..80160bf08dd 100644 --- a/internal/xds/bootstrap/testdata/enable-prometheus.yaml +++ b/internal/xds/bootstrap/testdata/enable-prometheus.yaml @@ -8,6 +8,11 @@ admin: socket_address: address: 127.0.0.1 port_value: 19000 +layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/internal/xds/bootstrap/testdata/otel-metrics.yaml b/internal/xds/bootstrap/testdata/otel-metrics.yaml index c4e4a6b750b..d54047a6871 100644 --- a/internal/xds/bootstrap/testdata/otel-metrics.yaml +++ b/internal/xds/bootstrap/testdata/otel-metrics.yaml @@ -8,6 +8,11 @@ admin: socket_address: address: 127.0.0.1 port_value: 19000 +layered_runtime: + layers: + - name: global_config + static_layer: + envoy.restart_features.use_eds_cache_for_ads: true dynamic_resources: ads_config: api_type: DELTA_GRPC