Using a Single External Load Balancer for Kubernetes API and Ingress for On-prem Clusters

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 work nodes.

Configuration for Several Masters

  1. Initiate cluster or platform creation for Bring Your own Infrastructure. The dialog is displayed.
  2. In the dialog, use the INSTANCES tab.
  3. 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 Work Nodes
    • Options for your node group(s).
  4. Use the FEATURES tab.
  5. Enable the Ingress Controller. NGINX Ingress Controller options become available.
  6. In the NGINX Ingress Controller section, select Use Host Port.
  7. In Advanced Options, set Load Balancer Address to the value, previously set for master configuration. Setting Infgress Contoller Feature

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 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:

  1. Access the cluster page, then click CUSTOMIZE SPECIFICATION.

  2. In specification, in the “master” section, set “loadBalancerAddress: [value]”.

  3. 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