Add mixin to strip cpu/memory limits (issue #72)
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// Strips spec.containers[].limits for certain containers
|
||||
// https://github.com/coreos/kube-prometheus/issues/72
|
||||
{
|
||||
nodeExporter+: {
|
||||
daemonset+: {
|
||||
spec+: {
|
||||
template+: {
|
||||
spec+: {
|
||||
local stripLimits(c) =
|
||||
if std.count([
|
||||
'node-exporter',
|
||||
'kube-rbac-proxy'
|
||||
], c.name) > 0
|
||||
then c + {resources+: {limits: {}}}
|
||||
else c,
|
||||
containers: std.map(stripLimits, super.containers),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
prometheusOperator+: {
|
||||
deployment+: {
|
||||
spec+: {
|
||||
template+: {
|
||||
spec+: {
|
||||
local addArgs(c) =
|
||||
if c.name == 'prometheus-operator'
|
||||
then c + {args+: ['--config-reloader-cpu=0']}
|
||||
else c,
|
||||
containers: std.map(addArgs, super.containers),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
kubeStateMetrics+: {
|
||||
deployment+: {
|
||||
spec+: {
|
||||
template+: {
|
||||
spec+: {
|
||||
local stripLimits(c) =
|
||||
if std.count([
|
||||
'kube-rbac-proxy-main',
|
||||
'kube-rbac-proxy-self',
|
||||
'addon-resizer'
|
||||
], c.name) > 0
|
||||
then c + {resources+: {limits: {}}}
|
||||
else c,
|
||||
containers: std.map(stripLimits, super.containers),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user