-
Notifications
You must be signed in to change notification settings - Fork 96
Add FrontendVPCs support to NodeBalancers #857
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?
Conversation
- Add `FrontendAddressType` and `FrontendVPCSubnetID` fields to `NodeBalancer` struct - Add `FrontendVPCs` field to `NodeBalancerCreateOptions` struct - Add clarifying comment to `IPv4RangeAutoAssign` field in `NodeBalancerVPCOptions`
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.
Pull request overview
This PR adds support for frontend VPC configuration to NodeBalancers, enabling VPC-based frontend addressing alongside the existing backend VPC support. The changes introduce new fields to track frontend VPC subnet information and allow frontend VPC specification during NodeBalancer creation.
Key changes:
- Added
FrontendAddressTypeandFrontendVPCSubnetIDfields to track frontend VPC configuration - Added
FrontendVPCsoption to enable frontend VPC specification during creation - Clarified that
IPv4RangeAutoAssignapplies only to backend VPC configuration
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Frontend address type (e.g., "vpc") | ||
| FrontendAddressType *string `json:"frontend_address_type,omitempty"` |
Copilot
AI
Dec 15, 2025
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.
The comment should specify what valid values are accepted for FrontendAddressType beyond the example 'vpc'. Consider documenting all possible values or using a constant/enum type to make valid options explicit.
| // IPv4RangeAutoAssign is only used for backend VPC configuration. | ||
| // For frontend VPCs, this field is ignored. |
Copilot
AI
Dec 15, 2025
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.
This comment creates ambiguity since NodeBalancerVPCOptions is now used for both VPCs (line 80) and FrontendVPCs (line 81). The behavior of IPv4RangeAutoAssign should be clarified based on context of use rather than stating it's 'ignored' for frontend VPCs, as the same struct is used in both contexts.
| // IPv4RangeAutoAssign is only used for backend VPC configuration. | |
| // For frontend VPCs, this field is ignored. | |
| // IPv4RangeAutoAssign is only used when NodeBalancerVPCOptions is provided as part of the VPCs field (backend VPC configuration) in NodeBalancerCreateOptions. | |
| // When used in the FrontendVPCs field (frontend VPC configuration), this field is ignored. |
| Out *float64 `json:"out"` | ||
| // The total outbound transfer, in MB, used for this NodeBalancer this month. | ||
| In *float64 `json:"in"` | ||
| // The total outbound transfer, in MB, used for this NodeBalancer this month. | ||
| Out *float64 `json:"out"` |
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.
good catch
| Tags []string `json:"tags"` | ||
| FirewallID int `json:"firewall_id,omitempty"` | ||
| Type NodeBalancerPlanType `json:"type,omitempty"` | ||
| VPCs []NodeBalancerVPCOptions `json:"vpcs,omitempty"` |
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.
Thoughts on adding a new BackendVPCs field and marking the VPCs field as deprecated in favor of the BackendVPCs field?
| IPv4 *string `json:"ipv4"` | ||
| // This NodeBalancer's public IPv6 address. | ||
| IPv6 *string `json:"ipv6"` | ||
| // Frontend address type (e.g., "vpc") |
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.
Is vpc the only supported type currently / are do we expect other types to be needed?
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.
AFAIK, vpc is the only one right now. May others will be introduced in future
| // Frontend address type (e.g., "vpc") | ||
| FrontendAddressType *string `json:"frontend_address_type,omitempty"` | ||
| // Frontend VPC subnet ID when using VPC addressing | ||
| FrontendVPCSubnetID *int `json:"frontend_vpc_subnet_id,omitempty"` |
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.
I know this PR is for adding frontendVPC support, but why don't we already have (Backend)VPC fields?
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.
Also, I didn't see this field used in your CCM PR, is this field necessary?
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.
These field a primarily used for returned response body!
FrontendAddressTypeandFrontendVPCSubnetIDfields toNodeBalancerstructFrontendVPCsfield toNodeBalancerCreateOptionsstructIPv4RangeAutoAssignfield inNodeBalancerVPCOptions📝 Description
What does this PR do and why is this change necessary?
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.