Skip to content

Commit 4bbcdcb

Browse files
authored
Merge branch 'master' into feat/traefik_alerts
2 parents 95bdff9 + cd4dd9a commit 4bbcdcb

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_requests:: null,
37+
exporter_memory_limits:: 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+
// Only add requests or limits if they've been set to a non-null value
68+
(if self.exporter_cpu_requests == null && self.exporter_memory_requests == null then {} else $.util.resourcesRequests(self.exporter_cpu_requests, self.exporter_memory_requests)) +
69+
(if self.exporter_cpu_limits == null && self.exporter_memory_limits == null then {} else $.util.resourcesLimits(self.exporter_cpu_limits, self.exporter_memory_limits)),
6970

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

0 commit comments

Comments
 (0)