-
Notifications
You must be signed in to change notification settings - Fork 176
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
[BREAKING Change] Single ServiceMonitor for store shards #188
[BREAKING Change] Single ServiceMonitor for store shards #188
Conversation
8c0f98e
to
cfc64f0
Compare
The Prometheus operator creates 1 job per endpoint on each ServiceMonitor object it discovers. When using the thanos-store hashmod sharding feature of kube-thanos, 1 ServiceMonitor was created per store shard. This resulted in 1 prometheus job per shard, with names like "thanos-store-0", "thanos-store-1". This commit changes this behavior to instead create only 1 ServiceMonitor, with a Service label selector that selects all Services for the shards. Signed-off-by: Craig Furman <[email protected]>
cfc64f0
to
17a8138
Compare
Ping @kakkoyun @metalmatze :-) |
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.
Looking good. I like the idea of having a single service monitor. However, can we avoid nesting?
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.
🥇
Thanks @kakkoyun! I'm not sure how we're supposed to communicate breaking changes like this, if at all? I guess users will see their |
@craigfurman More or less that is what's going to happen. We have a changelog and what we can this change as breaking change. And we can mention it in our release (the exact same process that we have in Thanos). Thanks for reminding this. I can create another PR to mark this change as a breaking one. Or do you want to do that? |
For example https://github.com/thanos-io/thanos/blob/master/CHANGELOG.md
We already have that mentioned in our changelog as well: https://github.com/thanos-io/kube-thanos/blob/master/CHANGELOG.md |
thanos-io#188 Signed-off-by: Craig Furman <[email protected]>
thanos-io#188 Signed-off-by: Craig Furman <[email protected]>
Changes
The Prometheus operator creates 1 job per endpoint on each
ServiceMonitor object it discovers. When using the thanos-store hashmod
sharding feature of kube-thanos, 1 ServiceMonitor was created per store
shard. This resulted in 1 prometheus job per shard, with names like
"thanos-store-0", "thanos-store-1".
This commit changes this behavior to instead create only 1
ServiceMonitor, with a Service label selector that selects all Services
for the shards.
Verification
make generate validate
, and I've experimented with it in a consumer repository that I use to manage thanos.