Skip to content

Commit

Permalink
Correct Accelerator endpoint weights to use 50/50 distribution
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Emerson <[email protected]>
  • Loading branch information
ryanemerson committed Jun 28, 2024
1 parent 8012561 commit f0c4095
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions doc/kubernetes/modules/ROOT/pages/running/loadbalancing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ image::accelerator/accelerator-multi-az.dio.svg[]

An AWS Network Load Balancer (NLB) is created on both ROSA clusters in order to make the Keycloak
pods available as Endpoints to an AWS Global Accelerator instance. Each cluster endpoint is assigned a weight of
50 to ensure that accelerator traffic is routed equally to both availability-zones when both clusters are healthy.
128 (half of the maximum weight 255) to ensure that accelerator traffic is routed equally to both availability-zones
when both clusters are healthy.

== Prerequisites

Expand Down Expand Up @@ -196,12 +197,12 @@ CLUSTER_2_ENDPOINT_ARN=$(aws elbv2 describe-load-balancers \
ENDPOINTS='[
{
"EndpointId": "'${CLUSTER_1_ENDPOINT_ARN}'",
"Weight": 50,
"Weight": 128,
"ClientIPPreservationEnabled": false
},
{
"EndpointId": "'${CLUSTER_2_ENDPOINT_ARN}'",
"Weight": 50,
"Weight": 128,
"ClientIPPreservationEnabled": false
}
]'
Expand All @@ -226,13 +227,13 @@ aws globalaccelerator create-endpoint-group \
"EndpointDescriptions": [
{
"EndpointId": "arn:aws:elasticloadbalancing:eu-west-1:606671647913:loadbalancer/net/abab80a363ce8479ea9c4349d116bce2/6b65e8b4272fa4b5",
"Weight": 50,
"Weight": 128,
"HealthState": "HEALTHY",
"ClientIPPreservationEnabled": false
},
{
"EndpointId": "arn:aws:elasticloadbalancing:eu-west-1:606671647913:loadbalancer/net/a1c76566e3c334e4ab7b762d9f8dcbcf/985941f9c8d108d4",
"Weight": 50,
"Weight": 128,
"HealthState": "HEALTHY",
"ClientIPPreservationEnabled": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ include::partial$accelerator-endpoint-group.adoc[]
"EndpointDescriptions": [
{
"EndpointId": "arn:aws:elasticloadbalancing:eu-west-1:606671647913:loadbalancer/net/a49e56e51e16843b9a3bc686327c907b/9b786f80ed4eba3d",
"Weight": 50,
"Weight": 128,
"HealthState": "HEALTHY",
"ClientIPPreservationEnabled": false
},
{
"EndpointId": "arn:aws:elasticloadbalancing:eu-west-1:606671647913:loadbalancer/net/a3c75f239541c4a6e9c48cf8d48d602f/5ba333e87019ccf0",
"Weight": 50,
"Weight": 128,
"HealthState": "HEALTHY",
"ClientIPPreservationEnabled": false
}
Expand All @@ -66,7 +66,7 @@ aws globalaccelerator update-endpoint-group \
[
{
"EndpointId": "arn:aws:elasticloadbalancing:eu-west-1:606671647913:loadbalancer/net/a49e56e51e16843b9a3bc686327c907b/9b786f80ed4eba3d",
"Weight": 50,
"Weight": 128,
"ClientIPPreservationEnabled": false
}
]
Expand Down
4 changes: 2 additions & 2 deletions provision/opentofu/modules/aws/accelerator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ module "global_accelerator" {
{
client_ip_preservation_enabled = false
endpoint_id = data.aws_lb.site_a.arn
weight = 50
weight = 128
}, {
client_ip_preservation_enabled = false
endpoint_id = data.aws_lb.site_b.arn
weight = 50
weight = 128
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static void acceleratorFallback(String acceleratorDns) {
.map(elb -> EndpointConfiguration.builder()
.clientIPPreservationEnabled(false)
.endpointId(elb)
.weight(50)
.weight(128)
.build()
).toList();

Expand Down

0 comments on commit f0c4095

Please sign in to comment.