Skip to content

Commit 98ccf6c

Browse files
author
Rahul Sharma
committed
update documentation for UDP support
1 parent 76ba695 commit 98ccf6c

6 files changed

Lines changed: 66 additions & 10 deletions

File tree

docs/configuration/annotations.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ The keys and the values in [annotations must be strings](https://kubernetes.io/d
1919
| Annotation (Suffix) | Values | Default | Description |
2020
|--------------------|--------|---------|-------------|
2121
| `throttle` | `0`-`20` (`0` to disable) | `0` | Client Connection Throttle, which limits the number of subsequent new connections per second from the same client IP |
22-
| `default-protocol` | `tcp`, `http`, `https` | `tcp` | This annotation is used to specify the default protocol for Linode NodeBalancer |
22+
| `default-protocol` | `tcp`, `udp`, `http`, `https` | `tcp` | This annotation is used to specify the default protocol for Linode NodeBalancer |
2323
| `default-proxy-protocol` | `none`, `v1`, `v2` | `none` | Specifies whether to use a version of Proxy Protocol on the underlying NodeBalancer |
24+
| `default-algorithm` | `roundrobin`, `leastconn`, `source`, `ring_hash` | `roundrobin` | This annotation is used to specify the default alogrithm for Linode NodeBalancer |
25+
| `default-stickiness` | `none`, `session`, `table`, `http_cookie`, `source_ip` | `none` | This annotation is used to specify the default stickiness for Linode NodeBalancer |
2426
| `port-*` | json object | | Specifies port specific NodeBalancer configuration. See [Port Configuration](#port-specific-configuration) |
25-
| `check-type` | `none`, `connection`, `http`, `http_body` | | The type of health check to perform against back-ends. See [Health Checks](loadbalancer.md#health-checks) |
27+
| `check-type` | `none`, `connection`, `http`, `http_body` | `none` for UDP, else `connection` | The type of health check to perform against back-ends. See [Health Checks](loadbalancer.md#health-checks) |
2628
| `check-path` | string | | The URL path to check on each back-end during health checks |
2729
| `check-body` | string | | Text which must be present in the response body to pass the health check |
28-
| `check-interval` | int | | Duration, in seconds, to wait between health checks |
29-
| `check-timeout` | int (1-30) | | Duration, in seconds, to wait for a health check to succeed |
30-
| `check-attempts` | int (1-30) | | Number of health check failures necessary to remove a back-end |
30+
| `check-interval` | int | `5` | Duration, in seconds, to wait between health checks |
31+
| `check-timeout` | int (1-30) | `3` | Duration, in seconds, to wait for a health check to succeed |
32+
| `check-attempts` | int (1-30) | `2` | Number of health check failures necessary to remove a back-end |
3133
| `check-passive` | bool | `false` | When `true`, `5xx` status codes will cause the health check to fail |
34+
| `udp-check-port` | int | `80` | Specifies health check port for UDP nodebalancer |
3235
| `preserve` | bool | `false` | When `true`, deleting a `LoadBalancer` service does not delete the underlying NodeBalancer |
3336
| `nodebalancer-id` | int | | The ID of the NodeBalancer to front the service |
3437
| `hostname-only-ingress` | bool | `false` | When `true`, the LoadBalancerStatus will only contain the Hostname |
@@ -49,16 +52,22 @@ The `port-*` annotation allows per-port configuration, encoded in JSON. For deta
4952
metadata:
5053
annotations:
5154
service.beta.kubernetes.io/linode-loadbalancer-port-443: |
52-
"protocol": "https",
53-
"tls-secret-name": "my-tls-secret",
54-
"proxy-protocol": "v2"
55-
}
55+
{
56+
"protocol": "https",
57+
"tls-secret-name": "my-tls-secret",
58+
"proxy-protocol": "v2",
59+
"algorithm": "leastconn",
60+
"stickiness": "http_cookie",
61+
}
5662
```
5763
5864
Available port options:
5965
- `protocol`: Protocol for this port (tcp, http, https)
6066
- `tls-secret-name`: Name of TLS secret for HTTPS. The secret type should be `kubernetes.io/tls`
6167
- `proxy-protocol`: Proxy protocol version for this port
68+
- `algorithm`: Algorithm for this port
69+
- `stickiness`: Stickiness for this port
70+
- `udp-check-port`: UDP health check port for this port
6271

6372
### Deprecated Annotations
6473

@@ -118,6 +127,7 @@ Linode supports nodebalancers of different types: common and premium. By default
118127
metadata:
119128
annotations:
120129
service.beta.kubernetes.io/linode-loadbalancer-nodebalancer-type: premium
130+
```
121131

122132
### Nodebalancer VPC Configuration
123133
```yaml

docs/configuration/loadbalancer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Available protocols:
7070
- `tcp` (default)
7171
- `http`
7272
- `https`
73+
- `udp`
7374

7475
Set the default protocol:
7576
```yaml

docs/examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This section provides working examples of common CCM configurations. Each exampl
77
1. **[Basic Services](basic.md)**
88
- HTTP LoadBalancer
99
- HTTPS LoadBalancer with TLS termination
10+
- UDP LoadBalancer
1011

1112
2. **[Advanced Configuration](advanced.md)**
1213
- Custom Health Checks
@@ -15,6 +16,8 @@ This section provides working examples of common CCM configurations. Each exampl
1516
- Shared IP Load-Balancing
1617
- Custom Node Selection
1718

19+
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.
20+
1821
For testing these examples, see the [test script](https://github.com/linode/linode-cloud-controller-manager/blob/master/examples/test.sh).
1922

2023
For more configuration options, see:

docs/examples/basic.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,47 @@ spec:
102102
protocol: TCP
103103
```
104104
105+
## UDP LoadBalancer
106+
107+
Basic UDP LoadBalancer service:
108+
109+
```yaml
110+
kind: Service
111+
apiVersion: v1
112+
metadata:
113+
name: udp-lb
114+
spec:
115+
type: LoadBalancer
116+
selector:
117+
app: udp-example
118+
ports:
119+
- name: udp
120+
protocol: UDP
121+
port: 7070
122+
targetPort: 7070
123+
---
124+
apiVersion: apps/v1
125+
kind: Deployment
126+
metadata:
127+
name: udp-deployment
128+
spec:
129+
replicas: 2
130+
selector:
131+
matchLabels:
132+
app: udp-example
133+
template:
134+
metadata:
135+
labels:
136+
app: udp-example
137+
spec:
138+
containers:
139+
- name: test-server
140+
image: rahulait/test-server:0.1
141+
ports:
142+
- containerPort: 7070
143+
protocol: UDP
144+
```
145+
105146
For more configuration options, see:
106147
- [Service Annotations](../configuration/annotations.md)
107148
- [LoadBalancer Configuration](../configuration/loadbalancer.md)

examples/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -euxo pipefail
44

55
kubectl apply -f ./http-nginx.yaml
66
kubectl apply -f ./tcp-nginx.yaml
7+
kubectl apply -f ./udp-example.yaml
78

89
openssl req -newkey rsa:4096 \
910
-x509 \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
app: udp-example
2929
spec:
3030
containers:
31-
- name: nginx
31+
- name: test-server
3232
image: rahulait/test-server:0.1
3333
ports:
3434
- containerPort: 7070

0 commit comments

Comments
 (0)