Configuring Kubernetes load balancers

Kubernetes clusters have two types of load balancers:

  • The API load balancer is created when the Kubernetes master node has high availability enabled and is used by the Kubernetes API.
  • The external load balancer is created by Kubernetes users and used by Kubernetes applications.

By default, these two load balancers use the preconfigured flavor that makes the load balancing service highly available.

After updating the load balancer flavors, the changes will be applied only in new Kubernetes clusters. Existing Kubernetes clusters will retain their previous parameters.

To improve the stability of Kubernetes clusters, it is highly recommended to select a load balancer flavor that provides high availability.

Prerequisites

To change the load balancer flavor

Use the following command:

vinfra service compute k8saas defaults set --labels octavia_api_lb_flavor=<mode>,octavia_default_flavor=<mode> <version>
--labels <key1=value1,key2=value2,key3=value3...>

Arbitrary labels in the form of key=value pairs to associate with a cluster:

  • octavia_api_lb_flavor=<mode>: set the load balancer flavor for Kubernetes master nodes:

    • SINGLE: create only one load balancer for Kubernetes master nodes
    • ACTIVE_STANDBY: create two load balancers that will work in the Active/Standby mode
  • octavia_default_flavor=<mode>: set the load balancer flavor for Kubernetes applications:

    • SINGLE: create only one load balancer for Kubernetes applications
    • ACTIVE_STANDBY: create two load balancers that will work in the Active/Standby mode
<version>
Kubernetes version to apply new defaults for.

For example, to create only one load balancer for highly available Kubernetes master nodes and apply this change for all of the supported Kubernetes versions, run:

# vinfra service compute k8saas defaults set --labels octavia_default_flavor=SINGLE

To set this flavor only for version 1.24.3, append the version number to the command:

# vinfra service compute k8saas defaults set --labels octavia_default_flavor=SINGLE v1.24.3