Skip to main content
Version: 1.0.0

TCP Balancers

The Managed TCP Load Balancer service simplifies the deployment and management of TCP load balancers. It efficiently distributes incoming TCP traffic across multiple backend servers, ensuring high availability and optimal resource utilization.


Configuration Example

Here is a YAML configuration example for a TCP Load Balancer deployment with two replicas and an enabled network whitelist:

apiVersion: apps.cozystack.io/v1alpha1
kind: TCPBalancer
metadata:
name: tcp-balancer-example
spec:
external: false
replicas: 2
httpAndHttps:
mode: tcp
targetPorts:
http: 80
https: 443
endpoints:
- address: "192.168.1.10"
- address: "192.168.1.11"
whitelistHTTP: true
whitelist:
- "192.168.1.0/24"
- "10.0.0.0/8"

Using the kubeconfig provided by Hikube and this example yaml, saved as a manifest.yaml file, you can easily test the application deployment using the following command:

kubectl apply -f manifest.yaml

Configurable Parameters

General Parameters

NameDescriptionDefault Value
externalAllows external access from outside the cluster.false
replicasNumber of HAProxy replicas.2

Configuration Parameters

NameDescriptionDefault Value
httpAndHttps.modeMode for the balancer (tcp or tcp-with-proxy).tcp
httpAndHttps.targetPorts.httpHTTP port used by the balancer.80
httpAndHttps.targetPorts.httpsHTTPS port used by the balancer.443
httpAndHttps.endpointsList of backend endpoint addresses.[]
whitelistHTTPEnables HTTP security via a network whitelist.false
whitelistList of authorized client networks.[]

Additional Resources

To learn more about HAProxy and TCP load balancing, check the following resources: