Skip to content

Commit b60cf9f

Browse files
authored
Memcached: Set CPU and memory for the memcached exporter (#1461)
The Prometheus exporter doesn't use many resources but it should still set requested and limits for CPU and memory. Signed-off-by: Nick Pillitteri <[email protected]>
1 parent afeacf2 commit b60cf9f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

memcached/memcached.libsonnet

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ k {
3131
std.ceil((self.memory_limit_mb * self.overprovision_factor) + self.memory_request_overhead_mb) * 1024 * 1024,
3232
memory_limits_bytes::
3333
std.max(self.memory_limit_mb * 1.5 * 1024 * 1024, self.memory_request_bytes),
34+
exporter_cpu_requests:: '50m',
35+
exporter_cpu_limits:: '500m',
36+
exporter_memory_request_bytes:: 50 * 1024 * 1024,
37+
exporter_memory_limits_bytes:: 250 * 1024 * 1024,
3438
use_topology_spread:: false,
3539
topology_spread_max_skew:: 1,
3640
extended_options:: [],
@@ -59,7 +63,9 @@ k {
5963
container.withArgs([
6064
'--memcached.address=localhost:11211',
6165
'--web.listen-address=0.0.0.0:9150',
62-
]),
66+
]) +
67+
$.util.resourcesRequests(self.exporter_cpu_requests, $.util.bytesToK8sQuantity(self.exporter_memory_request_bytes)) +
68+
$.util.resourcesLimits(self.exporter_cpu_limits, $.util.bytesToK8sQuantity(self.exporter_memory_limits_bytes)),
6369

6470
local statefulSet = $.apps.v1.statefulSet,
6571
local topologySpreadConstraints = k.core.v1.topologySpreadConstraint,

0 commit comments

Comments
 (0)