-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support az aware endpoints with multiple sts in one hashring #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
@@ -5,6 +5,7 @@ | |||
# But not these files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update bingo depdencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for lint
@@ -283,7 +289,7 @@ func newReflectorMetrics(reg *prometheus.Registry) prometheusReflectorMetrics { | |||
|
|||
const labelParts = 2 | |||
|
|||
func splitLabel(in string) (key, value string) { | |||
func splitLabel(in string) (string, string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nonamedreturns lint rule
@@ -292,35 +298,35 @@ func splitLabel(in string) (key, value string) { | |||
return parts[0], parts[1] | |||
} | |||
|
|||
func (p prometheusReflectorMetrics) NewListsMetric(name string) cache.CounterMetric { | |||
func (p prometheusReflectorMetrics) NewListsMetric(_ string) cache.CounterMetric { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name is not used
main.go
Outdated
@@ -679,6 +686,40 @@ func (c *controller) populate(ctx context.Context, hashrings []receive.HashringC | |||
} | |||
} | |||
|
|||
func (c *controller) populateEndpoint(sts *appsv1.StatefulSet, podIndex int, err error, pod *corev1.Pod) receive.Endpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract method to reduce cognitive complexity to resolve lint errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, one small comment, you can consider to send this PR to upstream for review too
verified in k8s that this will work |
@@ -563,9 +573,9 @@ func (c *controller) sync(ctx context.Context) { | |||
} | |||
|
|||
// If there's an increase in replicas we poll for the new replicas to be ready | |||
if _, ok := c.replicas[hashring]; ok && c.replicas[hashring] < *sts.Spec.Replicas { | |||
if _, ok := c.replicas[sts.Name]; ok && c.replicas[sts.Name] < *sts.Spec.Replicas { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found a bug when multiple sts pointing to same replicas, not sure whats the point of using hashring name as the key
What changes are proposed in this pull request?
https://thanos.io/tip/components/receive.md/#az-aware-ketama-hashring-experimental,
OSS PR: support az aware hashring and multiple sts in one hashring observatorium/thanos-receive-controller#129
How is this tested?
main_test.go,
Make thanos-receive-controller
pending test in deployment