Skip to content

Commit cb128f6

Browse files
committed
Memcached: Default exporter resources to null
Since they weren't previously set, default them to null to avoid changes until users explicitly set them. Follow up to #1461 Signed-off-by: Nick Pillitteri <[email protected]>
1 parent e04c0bd commit cb128f6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

memcached/memcached.libsonnet

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +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,
34+
exporter_cpu_requests:: null,
35+
exporter_cpu_limits:: null,
36+
exporter_memory_request_bytes:: null,
37+
exporter_memory_limits_bytes:: null,
3838
use_topology_spread:: false,
3939
topology_spread_max_skew:: 1,
4040
extended_options:: [],
@@ -64,8 +64,9 @@ k {
6464
'--memcached.address=localhost:11211',
6565
'--web.listen-address=0.0.0.0:9150',
6666
]) +
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)),
67+
// Note that we don't set any requests or limits unless the corresponding memory config is set.
68+
(if self.exporter_memory_request_bytes == null then {} else $.util.resourcesRequests(self.exporter_cpu_requests, $.util.bytesToK8sQuantity(self.exporter_memory_request_bytes))) +
69+
(if self.exporter_memory_limits_bytes == null then {} else $.util.resourcesLimits(self.exporter_cpu_limits, $.util.bytesToK8sQuantity(self.exporter_memory_limits_bytes))),
6970

7071
local statefulSet = $.apps.v1.statefulSet,
7172
local topologySpreadConstraints = k.core.v1.topologySpreadConstraint,

0 commit comments

Comments
 (0)