-
Notifications
You must be signed in to change notification settings - Fork 608
feat: Add EnvoyProxyTemplate for global Envoy Proxy defaults #7698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add EnvoyProxyTemplate for global Envoy Proxy defaults #7698
Conversation
7da24bf to
02beef5
Compare
fc0c5b9 to
fd2a520
Compare
Introduce EnvoyProxyTemplate in EnvoyGateway provider configuration to
define default settings for all Envoy Proxy deployments. Individual
EnvoyProxy resource settings take precedence over these template defaults.
This change includes:
* Add EnvoyProxyTemplate field to EnvoyGatewayKubernetesProvider API
* Implement merge functions for combining template defaults with more specific configurations
- Container specs (image, env vars, resources, volume mounts)
- Pod specs (annotations, labels, volumes, tolerations, affinity)
* Extend helm chart to support configuring default Envoy Proxy image settings via new
envoyProxyTemplate object.
* Add unit tests for merge logic
Signed-off-by: Michael Sommerville <[email protected]>
fd2a520 to
0ae8e1d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7698 +/- ##
==========================================
+ Coverage 72.29% 72.34% +0.05%
==========================================
Files 234 234
Lines 34480 34630 +150
==========================================
+ Hits 24927 25053 +126
- Misses 7765 7775 +10
- Partials 1788 1802 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| pullPolicy: IfNotPresent | ||
| # List of secrets in the same namespace of the component that can be used to pull images from private repositories. | ||
| pullSecrets: [] | ||
| envoyProxy: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you split this into a separated PR? let keep a PR as small as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| // +optional | ||
| ImageRepository *string `json:"imageRepository,omitempty"` | ||
|
|
||
| // ImagePullPolicy specifies the pull policy for the container image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be removed from this PR
| // EnvoyProxy-specific config takes precedence over global defaults. The default proxy image | ||
| // is passed as MergeContainerDefaults will override that image with that specified on the | ||
| // template. | ||
| func (r *ResourceRender) mergeContainerDefaults(containerSpec *egv1a1.KubernetesContainerSpec) *egv1a1.KubernetesContainerSpec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of writing our own merge functions, imo lets rely on something like strategic merge
gateway/internal/utils/merge.go
Line 66 in 88ee096
| func Merge[T any](original, patch T, mergeType egv1a1.MergeType) (T, error) { |
Add EnvoyProxyTemplate for global Envoy Proxy defaults
Introduce EnvoyProxyTemplate in EnvoyGateway provider configuration to define default settings for all Envoy Proxy deployments. Individual EnvoyProxy resource settings take precedence over these template defaults.
This change includes:
envoyProxyTemplate object.
Fixes: #4764