Skip to content

Commit 6c9322d

Browse files
committed
Add documentation for frontend VPC configuration annotations
- 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
1 parent aae1a15 commit 6c9322d

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

docs/configuration/annotations.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ The keys and the values in [annotations must be strings](https://kubernetes.io/d
4343
| `backend-ipv4-range` | string | | The IPv4 range from VPC subnet to be applied to the NodeBalancer backend. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
4444
| `backend-vpc-name` | string | | VPC which is connected to the NodeBalancer backend. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
4545
| `backend-subnet-name` | string | | Subnet within VPC which is connected to the NodeBalancer backend. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
46+
| `backend-subnet-id` | string | | Subnet ID within VPC which is connected to the NodeBalancer backend. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
47+
| `frontend-subnet-id` | string | | Subnet ID for the NodeBalancer frontend VPC configuration. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
48+
| `frontend-vpc-name` | string | | Frontend VPC name for the NodeBalancer frontend VPC configuration. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
49+
| `frontend-subnet-name` | string | | Frontend subnet name for the NodeBalancer frontend VPC configuration. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
50+
| `frontend-ipv4-range` | string | | Optional IPv4 CIDR range from the frontend subnet. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
51+
| `frontend-ipv6-range` | string | | Optional IPv6 CIDR range from the frontend subnet. See [Nodebalancer VPC Configuration](#nodebalancer-vpc-configuration) |
4652
| `reserved-ipv4` | string | | An existing Reserved IPv4 address that wil be used to initialize the NodeBalancer instance. See [LoadBalancer Configuration](loadbalancer.md#reserved-ipv4-addresses)) |
4753

4854
### Port Specific Configuration
@@ -135,8 +141,18 @@ metadata:
135141
metadata:
136142
annotations:
137143
service.beta.kubernetes.io/linode-loadbalancer-backend-ipv4-range: "10.100.0.0/30"
138-
service.beta.kubernetes.io/linode-loadbalancer-vpc-name: "vpc1"
139-
service.beta.kubernetes.io/linode-loadbalancer-subnet-name: "subnet1"
144+
service.beta.kubernetes.io/linode-loadbalancer-backend-vpc-name: "vpc1"
145+
service.beta.kubernetes.io/linode-loadbalancer-backend-subnet-name: "subnet1"
146+
```
147+
148+
Frontend VPC configuration:
149+
```yaml
150+
metadata:
151+
annotations:
152+
service.beta.kubernetes.io/linode-loadbalancer-frontend-subnet-id: "169341"
153+
# Optional:
154+
# service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv4-range: "10.0.0.0/24"
155+
# service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv6-range: "2001:db8::/64"
140156
```
141157

142158
### Service with IPv6 Address
@@ -151,7 +167,7 @@ For more examples and detailed configuration options, see:
151167
- [Firewall Configuration](firewall.md)
152168
- [Basic Service Examples](../examples/basic.md)
153169
- [Advanced Configuration Examples](../examples/advanced.md)
154-
- [Complete Stack Example](../examples/complete-stack.md)
170+
- [Examples](../examples/README.md)
155171

156172
See also:
157173
- [Environment Variables](environment.md)

docs/configuration/loadbalancer.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,43 @@ By default, CCM uses first VPC and Subnet name configured with it to attach Node
194194
metadata:
195195
annotations:
196196
service.beta.kubernetes.io/linode-loadbalancer-backend-ipv4-range: "10.100.0.4/30"
197-
service.beta.kubernetes.io/linode-loadbalancer-vpc-name: "vpc1"
198-
service.beta.kubernetes.io/linode-loadbalancer-subnet-name: "subnet1"
197+
service.beta.kubernetes.io/linode-loadbalancer-backend-vpc-name: "vpc1"
198+
service.beta.kubernetes.io/linode-loadbalancer-backend-subnet-name: "subnet1"
199199
```
200200

201+
### Configuring NodeBalancer frontend with VPC
202+
203+
NodeBalancers can optionally be configured with a VPC-based frontend address.
204+
205+
Frontend VPC configuration supports the following annotations:
206+
207+
1. Choose the frontend subnet:
208+
209+
- `service.beta.kubernetes.io/linode-loadbalancer-frontend-subnet-id` (preferred)
210+
- OR `service.beta.kubernetes.io/linode-loadbalancer-frontend-vpc-name` and `service.beta.kubernetes.io/linode-loadbalancer-frontend-subnet-name`
211+
212+
2. Optionally constrain the frontend address assignment within the subnet:
213+
214+
- `service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv4-range` (CIDR)
215+
- `service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv6-range` (CIDR)
216+
217+
Order of precedence:
218+
- If `frontend-subnet-id` is set, it is used.
219+
- Otherwise, `frontend-vpc-name` + `frontend-subnet-name` are used.
220+
- IPv4/IPv6 range annotations are optional add-ons and require one of the subnet selectors above.
221+
222+
Example:
223+
```yaml
224+
metadata:
225+
annotations:
226+
service.beta.kubernetes.io/linode-loadbalancer-frontend-subnet-id: "169341"
227+
# Optional:
228+
# service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv4-range: "10.0.0.0/24"
229+
# service.beta.kubernetes.io/linode-loadbalancer-frontend-ipv6-range: "2001:db8::/64"
230+
```
231+
232+
For a complete working example, see `examples/vpc-frontend-example.yaml`.
233+
201234
If CCM is started with `--nodebalancer-backend-ipv4-subnet` flag, then it will not allow provisioning of nodebalancer unless subnet specified in service annotation lie within the subnet specified using the flag. This is to prevent accidental overlap between nodebalancer backend ips and pod CIDRs.
202235

203236
## Advanced Configuration

docs/examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ This section provides working examples of common CCM configurations. Each exampl
1616
- Shared IP Load-Balancing
1717
- Custom Node Selection
1818

19+
3. **Frontend VPC NodeBalancer**
20+
- `examples/vpc-frontend-example.yaml`
21+
1922
Note: To test UDP based NBs, one can use [test-server](https://github.com/rahulait/test-server) repo to run server using UDP protocol and then use the client commands in repo's readme to connect to the server.
2023

2124
For testing these examples, see the [test script](https://github.com/linode/linode-cloud-controller-manager/blob/master/examples/test.sh).

0 commit comments

Comments
 (0)