-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcproute: add support for round-robin load balancing (#148)
Add support for round-robin load balancing for `TCPRoute`. This enables mutliple backend references in a UDPRoute object, with traffic being distributed to each backend in a round-robin fashion. A new BPF map `TCP_CONNECTIONS` was introduced to help keep track of active TCP connections, with its key storing the clien <<ip:port>> identifier and the value storing the backend's <<ip:port>> along with the state of the connection. Fixes #119 Follow up items: * modify `TCP_CONNECTIONS` to be more generic; get rid of `BLIXT_CONNTRACK` and refactor udp ingress and icmp egress to use the new generic map
- Loading branch information
Showing
15 changed files
with
635 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../samples/tcproute | ||
- server.yaml | ||
patches: | ||
- path: patch.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: TCPRoute | ||
metadata: | ||
name: blixt-tcproute-sample | ||
spec: | ||
parentRefs: | ||
- name: blixt-tcproute-sample | ||
port: 8080 | ||
rules: | ||
- backendRefs: | ||
- name: blixt-tcproute-sample | ||
port: 8080 | ||
- backendRefs: | ||
- name: tcproute-rr-v1 | ||
port: 8080 | ||
- name: tcproute-rr-v2 | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tcproute-rr-v1 | ||
labels: | ||
app: tcproute-rr-v1 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: tcproute-rr-v1 | ||
template: | ||
metadata: | ||
labels: | ||
app: tcproute-rr-v1 | ||
spec: | ||
containers: | ||
- name: tcp-echo | ||
image: istio/tcp-echo-server:1.1 | ||
imagePullPolicy: IfNotPresent | ||
args: [ "8080", "tcproute-rr-v1:" ] | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tcproute-rr-v2 | ||
labels: | ||
app: tcproute-rr-v2 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: tcproute-rr-v2 | ||
template: | ||
metadata: | ||
labels: | ||
app: tcproute-rr-v2 | ||
spec: | ||
containers: | ||
- name: tcp-echo | ||
image: istio/tcp-echo-server:1.1 | ||
imagePullPolicy: IfNotPresent | ||
args: [ "8080", "tcproute-rr-v2:" ] | ||
ports: | ||
- containerPort: 8080 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: tcproute-rr-v1 | ||
name: tcproute-rr-v1 | ||
spec: | ||
ports: | ||
- name: tcp | ||
port: 8080 | ||
protocol: TCP | ||
selector: | ||
app: tcproute-rr-v1 | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: tcproute-rr-v2 | ||
name: tcproute-rr-v2 | ||
spec: | ||
ports: | ||
- name: tcp | ||
port: 8080 | ||
protocol: TCP | ||
selector: | ||
app: tcproute-rr-v2 | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.