jsonnet/addons: update removal of resource limits for certain containers

This commit is contained in:
paulfantom
2021-01-19 15:46:34 +01:00
parent 4132da532c
commit 0424835b04

View File

@@ -1,19 +1,32 @@
// Strips spec.containers[].limits for certain containers // Strips spec.containers[].limits for certain containers
// https://github.com/prometheus-operator/kube-prometheus/issues/72 // https://github.com/prometheus-operator/kube-prometheus/issues/72
{ {
_config+:: { local noLimit(c) =
resources+:: { //if std.objectHas(c, 'resources') && c.name != 'kube-state-metrics'
'addon-resizer'+: { if c.name != 'kube-state-metrics'
limits: {}, then c { resources+: { limits: {} } }
else c,
nodeExporter+: {
daemonset+: {
spec+: {
template+: {
spec+: {
containers: std.map(noLimit, super.containers),
},
},
}, },
'kube-rbac-proxy'+: { },
limits: {}, },
}, kubeStateMetrics+: {
'kube-state-metrics'+: { deployment+: {
limits: {}, spec+: {
}, template+: {
'node-exporter'+: { spec+: {
limits: {}, containers: std.map(noLimit, super.containers),
},
},
}, },
}, },
}, },