This page describes load balancing options for a HA Kubernetes API Server.
For cloud installations, Kublr will create a load balancer for master nodes by default. There are several options:
ClusterSpec
)ClusterSpec
)Options for on-premises installations:
Example for AWS:
...
spec:
...
master:
...
locations:
- locationRef: aws1
aws:
...
masterElbAllocationPolicy: private
Example for AWS:
...
spec:
...
master:
...
locations:
- locationRef: aws1
aws:
...
masterElbAllocationPolicy: privateAndPublic
If you don’t need Public or Private ELB, you can disable its creation in the ClusterSpec
Example for AWS:
...
spec:
...
master:
...
locations:
- locationRef: aws1
aws:
...
masterElbAllocationPolicy: none
Kublr allows installation of a multi-master Kubernetes cluster on-premises. To work with the Kubernetes API:
Kubernetes API Server is configured to serve incoming requests on port 443. It is needed to configure HAProxy to round robin with health checks to the cluster’s API Servers.
Sample HAProxy configuration (/etc/haproxy/haproxy.cfg
) may look like this:
frontend k8s-api
bind <haproxy address>:443
bind 127.0.0.1:443
mode tcp
option tcplog
timeout client 300000
default_backend k8s-api
backend k8s-api
mode tcp
option tcplog
option tcp-check
timeout server 300000
balance roundrobin
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
server apiserver1 192.168.31.201:443 check
server apiserver2 192.168.31.202:443 check
server apiserver3 192.168.31.203:443 check
This configuration will accept traffic on 192.168.31.204:443 (the IP Address/Port where HAProxy is listening) and will forward requests to three servers (apiserver1, apiserver2, apiserver3) using round robin. Additional configuration options are described in HAProxy Configuration Manual
For more information, check the documentation of the load balancer you’re using. Kubernetes API Server is configured to listen on port 443. If you need help, please contact a Kublr representative.