-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add memcached and enable memcached index cache for Thanos Store #238
Conversation
0eea2db
to
5d2829b
Compare
components/observatorium.libsonnet
Outdated
@@ -92,6 +93,9 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; | |||
}, | |||
replicas: 1, | |||
ignoreDeletionMarksDelay: '24h', | |||
memcached+: { | |||
addresses: ['dnssrv+_http._tcp.%s.%s.svc.cluster.local' % [obs.storeCache.service.metadata.name, obs.storeCache.service.metadata.namespace]], |
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.
we can't rely on the .cluster.local
suffix
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.
@brancz Could you please explain a little bit more? We already rely heavily on .cluster.local
across the board, what do I miss?
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.
We do 😱 . The problem is that this suffix is configurable for every kubernetes, cluster so we need to omit it. The local DNS server will still resolve it correctly for the local service, but it may not be correct if we add the suffix.
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.
tl;dr We need to remove it wherever we use it. (I'm fine if that happens in a separate PR)
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, looking good generally! Some minor comments only. Does it work? (:
9e88212
to
79a4c0c
Compare
b9afe0a
to
54b7c7a
Compare
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.
I think there are a couple of things that could be cleaned up and I have some small questions. Great work so far!
17ba982
to
6ee411f
Compare
6ee411f
to
77a517a
Compare
77a517a
to
5c74443
Compare
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, some comments (:
{ name: 'client', containerPort: mc.service.spec.ports[0].port }, | ||
]) + | ||
container.withArgs([ | ||
'-m %(memoryLimitMb)s' % mc.config, |
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 future, using long flags is preferable for readability.
// Convert number to k8s "quantity" (ie 1.5Gi -> "1536Mi") | ||
// as per https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go | ||
// Original from https://github.com/grafana/jsonnet-libs/blob/master/memcached/memcached.libsonnet | ||
bytesToK8sQuantity(i):: |
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.
Wow
And someone just said DON'T USE GOLANG IT HAS IFs? =D
- --experimental.enable-index-cache-postings-compression | ||
- |- | ||
--index-cache.config="config": | ||
"addresses": |
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.
How we ensure how many items we can cache? 🤔
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.
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.
We limit the max item size and max memory, this is how we control maximum number of items in the cache. For our own deployment, we will have another internal PR I'll address them over there.
Also I have created an issue as a follow up to this #243
This PR adds Memcached index cache support for Thanos Store.
Depends: