move resources requests/limits to _config and simplify mixin

This commit is contained in:
Benoit Gagnon
2019-08-10 14:31:28 -04:00
parent ffc8832ef9
commit 16c22b7250
4 changed files with 32 additions and 42 deletions

View File

@@ -1,21 +1,16 @@
// 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.setMember(c.name, [
'kube-rbac-proxy',
'node-exporter',
])
then c + {resources+: {limits: {}}}
else c,
containers: std.map(stripLimits, super.containers),
},
},
_config+:: {
resources+:: {
'addon-resizer': {
limits: {},
},
'kube-rbac-proxy': {
limits: {},
},
'node-exporter': {
limits: {},
},
},
},
@@ -34,23 +29,4 @@
},
},
},
kubeStateMetrics+: {
deployment+: {
spec+: {
template+: {
spec+: {
local stripLimits(c) =
if std.setMember(c.name, [
'addon-resizer',
'kube-rbac-proxy-main',
'kube-rbac-proxy-self',
])
then c + {resources+: {limits: {}}}
else c,
containers: std.map(stripLimits, super.containers),
},
},
},
},
},
}