diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-06-29 10:58:35 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2020-06-30 09:44:05 +0200 |
commit | dd7fda4c5ecf2234b6fabc19a8f4c7286acb337d (patch) | |
tree | 61faa325be832917bd2a759ebcfeaec69b570f90 /flags | |
parent | 17a43c36fa8dfb03f1a87293e02475818fbe04d7 (diff) |
Support duplicate regions within same global endpoint
To support duplicate regions within a global endpoint we create a combination of
latency and weighted alias targets.
In the following examples an application exists in `us-west-2`, `us-east-1a` and
`us-east-1b`. Before this change global endpoints pointed directly to the
zone endpoint:
```
(latency) ALIAS app1.tenant1.global.vespa.example.com -> app1.tenant1.us-west-2.vespa.example.com
(latency) ALIAS app1.tenant1.global.vespa.example.com -> app1.tenant1.us-east-1a.vespa.example.com
(latency) ALIAS app1.tenant1.global.vespa.example.com -> app1.tenant1.us-east-1b.vespa.example.com
```
After this change we introduce an additional level of names by creating a
weighted record per region:
```
(latency) ALIAS app1.tenant1.global.vespa.example.com -> app1.tenant1.us-west-2-w.vespa.example.com
|- (weighted) ALIAS app1.tenant1.us-west-2-w.vespa.example.com -> app1.tenant1.us-west-2.vespa.example.com
(latency) ALIAS app1.tenant1.global.vespa.example.com -> app1.tenant1.us-east-1-w.vespa.example.com
|- (weighted) ALIAS app1.tenant1.us-east-1-w.vespa.example.com -> app1.tenant1.us-east-1a.vespa.example.com
|- (weighted) ALIAS app1.tenant1.us-east-1-w.vespa.example.com -> app1.tenant1.us-east-1b.vespa.example.com
```
Toggling global routing status now adjusts the weight (`0 = out`) instead of
removing records as this simplified the code.
Diffstat (limited to 'flags')
-rw-r--r-- | flags/src/main/java/com/yahoo/vespa/flags/Flags.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 64d020f4d46..9e27d0c4a0b 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -295,6 +295,13 @@ public class Flags { "Takes effect on next tick" ); + public static final UnboundBooleanFlag WEIGHTED_DNS_PER_REGION = defineFeatureFlag( + "weighted-dns-per-region", false, + "Whether to create weighted DNS records per region in global endpoints", + "Takes effect on next deployment through controller", + APPLICATION_ID + ); + /** WARNING: public for testing: All flags should be defined in {@link Flags}. */ public static UnboundBooleanFlag defineFeatureFlag(String flagId, boolean defaultValue, String description, String modificationEffect, FetchVector.Dimension... dimensions) { |