-
Notifications
You must be signed in to change notification settings - Fork 68
[feat] Add frontend VPC support for NodeBalancers #501
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 support for configuring NodeBalancer frontend VPC placement via service annotations. This enables NodeBalancers to be deployed with private frontend addresses within a VPC. New annotations: - linode-loadbalancer-frontend-ipv4-range: Explicit IPv4 CIDR - linode-loadbalancer-frontend-ipv6-range: Explicit IPv6 CIDR - linode-loadbalancer-frontend-vpc-name: VPC name for resolution - linode-loadbalancer-frontend-subnet-name: Subnet name for resolution - linode-loadbalancer-frontend-subnet-id: Direct subnet ID Resolution precedence: 1. IPv4/IPv6 Range annotations (explicit CIDR) 2. VPC/Subnet name annotations (name-based resolution) 3. Subnet ID annotation (direct ID) Key behavioral difference from backend VPC implementation: - Frontend VPC is opt-in: returns nil when no annotations are present, resulting in no frontend VPC configuration - Backend VPC is always configured: falls through precedence levels and always returns VPC options using the service's default subnet ID This design allows frontend VPC to remain an optional feature while backend VPC continues to be mandatory for NodeBalancer operation. Includes: - CIDR validation for IPv4 and IPv6 ranges - Name-to-ID resolution requiring both vpc-name and subnet-name - Unit tests for validation, status generation, and option building - Debug logging for frontend VPC NodeBalancers
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #501 +/- ##
==========================================
- Coverage 73.72% 73.69% -0.03%
==========================================
Files 19 19
Lines 2835 2885 +50
==========================================
+ Hits 2090 2126 +36
- Misses 504 511 +7
- Partials 241 248 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ) | ||
|
|
||
| replace ( | ||
| github.com/linode/linodego => github.com/komer3/linodego v0.0.0-20251201202808-852faf57b6e0 |
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.
Are we blocked on a new linodego release?
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.
Yeah. I have a PR open for this here: linode/linodego#857.
Once this feature goes GA, they'll merge that, I think, hopefully.
- Change annotation precedence order: subnet-id first, then vpc-name/subnet-name, then optional IP ranges - Consolidate IPv4/IPv6 validation into single validateNodeBalancerFrontendIPRange function - Simplify getFrontendVPCCreateOptions to reduce code duplication and improve readability - Make IP range annotations optional when subnet is specified - Add error when IP ranges are provided without subnet selector - Update tests to cover more senarios
- Document new frontend VPC annotations: frontend-subnet-id, frontend-vpc-name, frontend-subnet-name, frontend-ipv4-range, frontend-ipv6-range - Document backend-subnet-id annotation - Add detailed frontend VPC configuration section explaining annotation precedence and usage - Update backend VPC annotation examples to use correct backend-vpc-name and backend-subnet-name prefixes - Add reference to vpc-frontend-example.yaml in examples
| SubnetID: intfVPCIP.SubnetID, | ||
| IPv4: &linodego.VPCInterfaceIPv4CreateOptions{Ranges: linodeInterfaceRoutes}, | ||
| VPC: &linodego.VPCInterfaceUpdateOptions{ | ||
| IPv4: &linodego.VPCInterfaceIPv4CreateOptions{Ranges: &linodeInterfaceRoutes}, |
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.
Just for clarification, are we removing this because we're changing how we determine the subnet ID?
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.
noo. So there was a change in linodego for VPCInterfaceUpdateOptions which removed the requirement for subnetID. But I'm honestly not entirely sure about it. The linode api docs still say it is required but the linodego team removed it. Need to verify this change
Linode API doc: https://techdocs.akamai.com/linode-api/reference/put-linode-interface
LinodeGo change: https://github.com/linode/linodego/pull/825/changes#diff-b7b79f1ac09ee75185e8a967df69488f9fe9597d89aaa80d50296d9c028ee7d9R125
…et-name annotations. Change annotation check from OR to AND logic for vpc-name and subnet-name
|
Changes look good to me though I'd like to wait for your change to land in linodego first so we don't need to use a fork |
Add support for configuring NodeBalancer frontend VPC placement via service annotations. This enables NodeBalancers to be deployed with private frontend addresses within a VPC.
New annotations:
Resolution precedence:
Key behavioral difference from backend VPC implementation:
This design allows frontend VPC to remain an optional feature while backend VPC continues to be mandatory for NodeBalancer operation.
Includes:
General:
Pull Request Guidelines: