Comments (8)
@kuritka Yep, so my point is that by using percentages we're forcing users to think in % and keep the "100% in total" rule in mind.
Whereas when we use just numbers and calculate resulting weights as a proportion of the total sum, we give more flexibility.
This approach still allows using percentages as well, as you've shown in the examples above.
And we don't have to provide a complex validation in this case, we might just limit the max weight to some sensible value, like 1000
from k8gb.
Hi @ytsarev , sure we can. I supposed it's already closed
from k8gb.
The round robin is taken care of by our library https://github.com/k8gb-io/go-weight-shuffling, which shuffles the indexes in the array according to the predefined weights.
The library would run in the new CoreDNS external plugin within https://github.com/k8gb-io/coredns-crd-plugin. Data will be fed into this plugin from annotation within external DNS endpoints. The CoreDNS - external DNS plugin will read these annotations and arrange itself accordingly.
One cluster can have a number of IP addresses that can change from time to time. The N% weight is set per cluster (region), so I need IP addresses X Region X weight
. The annotation is string, so I can annotate by json:
[
{region: "eu", weightPercent: 20, targets:["172.18.0.5","172.18.0.6"]},
{region: "us", weightPercent:80, targets:["172.18.0.1","172.18.0.2"]}
]
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
annotations:
k8gb.absa.oss/dnstype: local
k8gb.absa.oss/weight-round-robin: '[{"region":"eu","weightPercent":20,"targets":["172.18.0.5","172.18.0.6"]},{"region":"us","weightPercent":80,"targets":["172.18.0.1","172.18.0.2"]}]'
name: k8gb-ns-extdns
namespace: k8gb
from k8gb.
@kuritka sorry if I'm coming late to the party, but I've tried to check settings for different implementations of WRR, and in most cases, WRR weights are provided as positive integer instead of percentage:
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html
https://cloud.google.com/dns/docs/zones/manage-routing-policies
https://en.wikipedia.org/wiki/Weighted_round_robin
https://en.wikipedia.org/wiki/SRV_record
The resulting percentage for a particular member can be calculated as a proportion of the total weight of all the members in the WRR group.
This way users also don't have to keep in mind the rule of having 100%
of weights in total across n
clusters.
from k8gb.
It's more about the point of view. The change is a little more extensive, but not complex. Currently it works with percentages and accept values values like "100", "100%",100,100%
But I can change it so that the results are equivalent
# current
weight:
us: 50%
eu: 30%
za: 20
uk: 0%
# new alternative (integers distribution)
weight:
us: 50
eu: 30
za: 20
uk: 0
weight:
us: 5
eu: 3
za: 2
uk: 0
weight:
us: 64
eu: 38
za: 26
uk: 0
from k8gb.
ok, will keep it consistent with route53 style and refactor k8gb controller to integers.
from k8gb.
@kuritka as WRR is implemented, can we close this issue?
from k8gb.
WRR was released in https://github.com/k8gb-io/k8gb/releases/tag/v0.11.1. Closing
from k8gb.
Related Issues (20)
- 🟢 Revisit github workflow pipelines HOT 1
- 🟢 Revisit HelmChart
- 🟢 Revisit documentation
- 🟢 Release K8gb v1.0.0
- 🟢 Replace the old k8gb code with the new k8gb-lite code HOT 1
- Push k8gb to OCP operator hub
- Security slam HOT 1
- Cluster can't return own entries
- document split brain scenario and the system behaviour HOT 2
- Create security self-assessment.md of k8gb and contribute it to CNCF Tag security
- Expand renovate to more codebase containing versions
- Please add yourself to `ADOPTERS.md`!
- "Additional property cloudflare is not allowed" appears when deploying Cloudflare integration HOT 2
- `TestFailoverPlayground ` flaky terratest
- Document the case of when a load balancing configuration is not deployed in every cluster
- Release pipeline fails with cosign validation
- scorecard pipeline is failing in `master` branch HOT 4
- Bug: Unnecessary permissions HOT 1
- Azure DNS: ability to reference existing secret
- deploy-full-local-setup: external-dns pod `exec format error` with Docker Desktop > 4.26.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8gb.