Using a Single External Load Balancer for Kubernetes API and Ingress for On-prem Clusters
Overview
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 worker 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.
- Set
- 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.
![Setting Master and worker nodes](./?url=aHR0cHM6Ly9kb2NzLmt1YmxyLmNvbS9pbWFnZXMvbG9hZGJhbGFuY2VyL2xvYWRfYmFsYW5jZXItaW5zdGFuY2VzX3BhcmFtZXRlcnMucG5nI25vbWFyZ2lu&__proxy_form=0)
- 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.
![Setting Infgress Contoller Feature](./?url=aHR0cHM6Ly9kb2NzLmt1YmxyLmNvbS9pbWFnZXMvbG9hZGJhbGFuY2VyL2xvYWRfYmFsYW5jZXItZmVhdHVyZXMtaW5ncmVzc19jb250b2xsZXIucG5nI25vbWFyZ2lu&__proxy_form=0)
Result Example
The configuration from the example above leads to the following result:
- Kubernentes API Server Port part: External Load Balancer 2.2.2.2 watches port 6443 and balances (by round-robin) all that came to 2.2.2.2:6443 between master nodes 1, 2, 3
- Ingress Controller feature part: The same Load Balancer 2.2.2.2 watches ports 80 (http) and 443 (https) and balances all that came to 2.2.2.2:80 and 2.2.2.2:443 between worker 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.
![Setting Load Balancer via Specification](./?url=aHR0cHM6Ly9kb2NzLmt1YmxyLmNvbS9pbWFnZXMvbG9hZGJhbGFuY2VyL2xvYWRfYmFsYW5jZXItc3BlY2lmaWNhdGlvbi5wbmcjbm9tYXJnaW4=&__proxy_form=0)