Skip to content

feat(provisioner): ContourDeployment loadBalancerSourceRanges and loadBalancerClass - #7665

Open
VedantMadane wants to merge 3 commits into
projectcontour:mainfrom
VedantMadane:feat/contourdeployment-lb-source-ranges-class-7334
Open

feat(provisioner): ContourDeployment loadBalancerSourceRanges and loadBalancerClass#7665
VedantMadane wants to merge 3 commits into
projectcontour:mainfrom
VedantMadane:feat/contourdeployment-lb-source-ranges-class-7334

Conversation

@VedantMadane

Copy link
Copy Markdown

Summary

Adds loadBalancerSourceRanges and loadBalancerClass to ContourDeployment.spec.envoy.networkPublishing so the Gateway provisioner can set the corresponding Envoy Service fields when publishing as a LoadBalancer.

Fixes #7334

Motivation

When using Contour Gateway Provisioner with a custom ContourDeployment, there was no way to configure:

  • Service.spec.loadBalancerSourceRanges (restrict source IPs)
  • Service.spec.loadBalancerClass (select LB implementation)

Changes

  1. API (ContourDeployment / NetworkPublishing): new optional fields
  2. Provisioner model + gateway controller: plumb fields from ContourDeployment params
  3. Envoy Service: set fields when publishing type is LoadBalancerService
  4. Equality: detect changes to reconcile those fields
  5. CRDs / examples: regenerated-style updates for the new schema
  6. Unit test: TestDesiredEnvoyServiceLoadBalancerFields

Example

apiVersion: projectcontour.io/v1alpha1
kind: ContourDeployment
metadata:
  name: contour
spec:
  envoy:
    networkPublishing:
      type: LoadBalancerService
      loadBalancerSourceRanges:
        - 10.0.0.0/8
      loadBalancerClass: service.k8s.aws/nlb

@VedantMadane
VedantMadane requested a review from a team as a code owner August 9, 2026 15:15
@VedantMadane
VedantMadane requested review from sunjayBhatia and tsaarni and removed request for a team August 9, 2026 15:15
@tsaarni tsaarni added the release-note/small A small change that needs one line of explanation in the release notes. label Aug 18, 2026
…lass on ContourDeployment

Allow ContourDeployment.spec.envoy.networkPublishing to configure the
Envoy Service LoadBalancer fields Service.spec.loadBalancerSourceRanges
and Service.spec.loadBalancerClass so Gateway provisioner users can
restrict source IPs and select a load balancer implementation.

Fixes projectcontour#7334

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
Add unreleased changelog for projectcontour#7665 and regenerate CRDs, example
manifests, and API reference docs so check-generate passes.

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@VedantMadane
VedantMadane force-pushed the feat/contourdeployment-lb-source-ranges-class-7334 branch from 1b726e3 to 96edf5e Compare August 18, 2026 15:39
VedantMadane added a commit to VedantMadane/contour that referenced this pull request Aug 18, 2026
Add unreleased changelog for projectcontour#7665 and regenerate CRDs, example
manifests, and API reference docs so check-generate passes.

Signed-off-by: Vedant Madane <vedantnm@gmail.com>
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.31%. Comparing base (fdb28b9) to head (96edf5e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/provisioner/equality/equality.go 0.00% 4 Missing and 2 partials ⚠️
internal/provisioner/controller/gateway.go 0.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7665      +/-   ##
==========================================
- Coverage   82.35%   82.31%   -0.05%     
==========================================
  Files         131      131              
  Lines       15915    15930      +15     
==========================================
+ Hits        13107    13112       +5     
- Misses       2520     2526       +6     
- Partials      288      292       +4     
Files with missing lines Coverage Δ
internal/provisioner/model/model.go 100.00% <ø> (ø)
internal/provisioner/objects/service/service.go 75.80% <100.00%> (+0.66%) ⬆️
internal/provisioner/controller/gateway.go 58.72% <0.00%> (-1.02%) ⬇️
internal/provisioner/equality/equality.go 53.80% <0.00%> (-1.70%) ⬇️
🚀 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.

Add unit coverage for ContourDeployment networkPublishing LB fields
through equality change detection, DesiredEnvoyService (LB and
ClusterIP ignore paths), and gateway controller copy into the Envoy
Service. Improves codecov/patch on the ContourDeployment LB feature.

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@VedantMadane
VedantMadane force-pushed the feat/contourdeployment-lb-source-ranges-class-7334 branch from 42fb60a to 74297e0 Compare August 22, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/small A small change that needs one line of explanation in the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configuring Envoy Service loadBalancerSourceRanges/loadBalancerClass via ContourDeployment

2 participants