Skip to content

[feat] add support for reserved IPv4 range in NodeBalancer backend allocation - #632

Open
vsilva-akamai wants to merge 5 commits into
linode:mainfrom
vsilva-akamai:LKE-9993-nitro-networking
Open

vsilva-akamai wants to merge 5 commits into
linode:mainfrom
vsilva-akamai:LKE-9993-nitro-networking

Conversation

@vsilva-akamai

Copy link
Copy Markdown

Summary

  • Adds --nodebalancer-backend-ipv4-reserved-range and the matching Helm value for reserving the highest /30 in a configured NodeBalancer backend subnet.
  • Allocates the first available /30 below the reserved range by reading the subnet's existing NodeBalancer assignments.
  • Rejects invalid reservations, existing assignments that use the reserved range, and service-provided backend ranges that overlap the reservation.
  • Adds unit coverage for allocation, validation, VPC option construction, and Helm rendering.

Rationale

Reserving the highest /30 prevents CCM-managed NodeBalancer backend allocation from consuming an address range that must remain available for networking.

Validation

  • go test ./cloud/linode -count=1
  • make helm-template

General

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@github-actions github-actions Bot added the new-feature for new features in the changelog. label Sep 22, 2026
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.15038% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.15%. Comparing base (db88dde) to head (0c17b7f).

Files with missing lines Patch % Lines
cloud/linode/nodebalancer_backend_range.go 59.77% 18 Missing and 17 partials ⚠️
cloud/linode/loadbalancers.go 70.00% 6 Missing and 6 partials ⚠️
cloud/linode/cloud.go 0.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #632      +/-   ##
==========================================
- Coverage   75.91%   75.15%   -0.77%     
==========================================
  Files          18       19       +1     
  Lines        2811     2938     +127     
==========================================
+ Hits         2134     2208      +74     
- Misses        464      493      +29     
- Partials      213      237      +24     

☔ View full report in Codecov by Harness.
📢 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.

Comment on lines +146 to +147
{{- else if hasKey .Values "configureCloudRoutes" }}
- --configure-cloud-routes={{ .Values.configureCloudRoutes }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this make it so --configure-cloud-routes is passed twice if values has routeController.configureCloudRoutes and configureCloudRoutes set?
If we want to add support to configure cloud routes outside of enabling the route controller, we might want to deprecate/remove the option from the route controller itself.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I teested this with both keys set to opposite values to check which one would be the winner, only one --configure-cloud-routes renders, and it's the routeController one.
L146 is the else if arm of the {{- if .Values.routeController }} at L124, so the two branches don't both fire. Letting the top-level false pass would render --enable-route-controller=true --configure-cloud-routes=false, which stops the route controller from start.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ helm template ccm ./deploy/chart \
    --set configureCloudRoutes=false \
    --set routeController.configureCloudRoutes=true \
    --set routeController.vpcNames=vpc1 --set routeController.clusterCIDR=10.0.0.0/8
          name: ccm-linode
          args:
            - --leader-elect-resource-lock=leases
            - --v=3
            - --secure-port=10253
            - --webhook-secure-port=0
            - --enable-route-controller=true
            - --configure-cloud-routes=true
            - --vpc-names=vpc1
            - --cluster-cidr=10.0.0.0/8

@AshleyDumaine

AshleyDumaine commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Can you document the new feature on docs/configuration/environment.md and docs/configuration/loadbalancer.md as well?
I think we'll also want a new chainsaw e2e test for this.

@vsilva-akamai

Copy link
Copy Markdown
Author

Can you document the new feature on docs/configuration/environment.md and docs/configuration/loadbalancer.md as well? I think we'll also want a new chainsaw e2e test for this.

I updated the docs as requested, and now I'm working on getting the Chainsaw tests implemented and working.

This branch was successfully deployed

1 active deployment
prod-external — 0c17b7f3 Deployed Sep 24, 2026 by vsilva-akamai via e2e-tests #2054
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants