Using a Single External Load Balancer for Kubernetes API and Ingress for On-prem Clusters
This article describes how to configure a Kubernetes cluster in Kublr to use the same external Load Balancer for Kubernetes API server and Ingress Controller. This allows using the same Load Balancer for master and work nodes.
Configuration for Several Masters
- Initiate cluster or platform creation for Bring Your own Infrastructure. The dialog is displayed.
- In the dialog, use the INSTANCES tab.
- Masters number to more than “1”. The Load Balancer Address (optional) option is displayed.
- IP/DNS .. for each master.
- Load Balancer Address (optional).
- Advanced Options > Kubernentes API Server Port.
- Options for your node group(s).
- Use the FEATURES tab.
- Enable the Ingress Controller. NGINX Ingress Controller options become available.
- In the NGINX Ingress Controller section, select Use Host Port.
- In Advanced Options, set Load Balancer Address to the value, previously set for master configuration.
The configuration from the example above leads to the following result:
- Kubernentes API Server Port part: External Load Balancer 220.127.116.11 watches port 6443 and balances (by round-robin) all that came to 18.104.22.168:6443 between master nodes 1, 2, 3
- Ingress Controller feature part: The same Load Balancer 22.214.171.124 watches ports 80 (http) and 443 (https) and balances all that came to 126.96.36.199:80 and 188.8.131.52:443 between work nodes to the ports 8080, 8043
Configuration for One Master
When creating a cluster or platform with only 1 master, the Load Balancer Address (optional) is not displayed in a user interface. Still, if you want to use an external Load Balancer for your cluster, you can configure that via specification directly:
Access the cluster page, then click CUSTOMIZE SPECIFICATION.
In specification, in the “master” section, set “loadBalancerAddress: [value]”.
In the “features > ingress > ingressContollers > nginx” set required options as shown in the picture below.
Note You can copy-paste required strings from multi-master configuration.