Skip to content

Conversation

@mgs255
Copy link

@mgs255 mgs255 commented Dec 8, 2025

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:

  • 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

Fixes: #4764

@mgs255 mgs255 force-pushed the allow-provide-default-proxy-image branch 2 times, most recently from 7da24bf to 02beef5 Compare December 8, 2025 10:56
@mgs255 mgs255 force-pushed the allow-provide-default-proxy-image branch 2 times, most recently from fc0c5b9 to fd2a520 Compare December 10, 2025 17:08
  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]>
@mgs255 mgs255 force-pushed the allow-provide-default-proxy-image branch from fd2a520 to 0ae8e1d Compare December 10, 2025 17:21
@mgs255 mgs255 marked this pull request as ready for review December 10, 2025 17:26
@mgs255 mgs255 requested a review from a team as a code owner December 10, 2025 17:26
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 88.75740% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.34%. Comparing base (1b88e71) to head (0ae8e1d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ernal/infrastructure/kubernetes/common/resource.go 84.87% 8 Missing and 10 partials ⚠️
api/v1alpha1/envoygateway_helpers.go 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

pullPolicy: IfNotPresent
# List of secrets in the same namespace of the component that can be used to pull images from private repositories.
pullSecrets: []
envoyProxy:
Copy link
Member

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.

Copy link
Contributor

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.
Copy link
Contributor

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 {
Copy link
Contributor

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

func Merge[T any](original, patch T, mergeType egv1a1.MergeType) (T, error) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configuring envoyproxy infra attributes in the Helm chart

4 participants