← Back to Pull requests

api: raise LoadBalancerSourceRanges MaxItems from 64 to 512 #10708

Closed
unknown closed this pull request without merging on Nov 27, 2026 07:28 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 23:58 UTC
Author

Raises the MaxItems limit on EnvoyProxy.spec.provider.kubernetes.envoyService.loadBalancerSourceRanges
from 64 to 513.

#9818 introduced +kubebuilder:validation:MaxItems=64. 64 is too low for real-world allow-lists
(corporate egress ranges, partner/CDN ranges), and the upstream core Service.spec.loadBalancerSourceRanges
has no limit at all.

Why 512:

  • The 512 is kind of arbitrary, satisfies my use case, but happy to amend to make it larger

  • Ack I'm using AWS as that is the environment my team uses, not sure about limits on other environments, have included a GCP comment below but I'm not sure about this

  • On AWS, the cloud provider/AWS Load Balancer Controller creates one security group rule per CIDR

  • per listener port. AWS caps security group rules at 1000 per network interface
    (rules-per-SG × SGs-per-ENI ≤ 1000).
  • A typical Gateway exposes 2 ports (80 + 443), so 500 CIDRs × 2 = 1000 rules, which is the largest

  • value that can still be satisfied on AWS.
  • GCP (5000 source ranges per firewall rule) and Azure NSG limits are higher, so 512 doesn't

  • constrain them.

    Why this is safe for the CRD:

  • The only CEL rule touching the field (!has(self.loadBalancerSourceRanges) || self.type == 'LoadBalancer')

  • doesn't iterate the list, so its cost is independent of MaxItems.
  • CEL validation tests pass across all ENVTEST_K8S_VERSIONS.
  • Compatibility: non-breaking. This only relaxes validation, so all existing resources remain valid.

    Changes:

  • api/v1alpha1/shared_types.go: MaxItems=64 → MaxItems=512

  • test/cel-validation/envoyproxy_test.go: updated the too-many-items case (513 rejected)

  • Regenerated CRDs and helm test outputs

  • Release note under release-notes/current/other_changes/
  • Which issue(s) this PR fixes:
    Follow-up to #9818.
    Fixes #10706

    ---

    PR Checklist
    <!--
    Please tick the boxes below before requesting a review. PRs that leave required items unchecked may
    be delayed or closed. Replace [ ] with [x] to check a box. If an item does not apply, check it
    and add "N/A: <reason>".
    -->

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.

  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.

  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.

  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)

  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.

  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.

  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.

  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.

  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.

  • Codex review: Requested a Codex review and addressed all of its comments.

  • Copilot review: Requested a Copilot review and addressed all of its comments.
  • Diff: 524 lines (+393 / -131) across 6 files Reviewer: zirain Review duration: 1890m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 524 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.375
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10708"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.8% (MEDIUM) · Higher = larger blast radius
    47.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.7% · Safe to merge
    20.7%