Skip to content

Instantly share code, notes, and snippets.

@digitalronin
Created November 4, 2020 14:47
Show Gist options
  • Save digitalronin/6a131807ff90b2835fd9d53092bde44b to your computer and use it in GitHub Desktop.
Save digitalronin/6a131807ff90b2835fd9d53092bde44b to your computer and use it in GitHub Desktop.

Cross Zone Load-balancing

Our live-1 load balancer doesn't have cross-zone load-balancing enabled. I think that means traffic gets distributed like this:

                Internet traffic
                       |
           +-----------+-----------+
           |           |           |
        +--+----+  +---+---+   +---+---+
        |LB node|  |LB node|   |LB node|
        |  2a   |  |  2b   |   |  2c   |
        +--+----+  +---+---+   +---+---+
           |           |           |
           |           |           |
       +---+----+  +---+----+  +---+----+
       | worker |  | worker |  | worker |
       | nodes  |  | nodes  |  | nodes  |
       | 2a     |  | 2b     |  | 2c     |
       +--------+  +--------+  +--------+

With cross-zone enabled, traffic should be distributed like this:

                Internet traffic
                       |
           +-----------+-----------+
           |           |           |
        +--+----+  +---+---+   +---+---+
        |LB node|  |LB node|   |LB node|
        |  2a   |  |  2b   |   |  2c   |
        +--+----+  +---+---+   +---+---+
           |           |           |
           +-----------+-----------+
                       |
           +-----------+-----------+
           |           |           |
       +---+----+  +---+----+  +---+----+
       | worker |  | worker |  | worker |
       | nodes  |  | nodes  |  | nodes  |
       | 2a     |  | 2b     |  | 2c     |
       +--------+  +--------+  +--------+

This is a minor improvement, but worth having.

Question

If we change the value of the "Cross-Zone Load Balancing" parameter via terraform, does the load-balancer get replaced (i.e. will there be downtime for our services)?

Test 1: AWS console

Changing the value of the flag in the AWS console, during an ab batch test, does not result in any errors.

Test 2: Change via kops

kops edit cluster

As per this file, amend the spec.api.loadBalancer configuration like this:

spec:
  api:
    loadBalancer:
      type: Public
      crossZoneLoadBalancing: true
kops update cluster --yes

This doesn't require a rolling update.

I did this while running an ab batch test, and viewing the load-balancer in the AWS console.

It didn't cause any errors or downtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment