jsonnet/addons/strip-limits: Simplify logic
Since `release-0.8` resources has become a first-class object to all components of kube-prometheus. Therefore, we're simplifying this addon to reflect those changes. Signed-off-by: ArthurSens <arthursens2005@gmail.com>
This commit is contained in:
@@ -2,46 +2,55 @@
|
|||||||
// https://github.com/prometheus-operator/kube-prometheus/issues/72
|
// https://github.com/prometheus-operator/kube-prometheus/issues/72
|
||||||
|
|
||||||
{
|
{
|
||||||
local noLimit(c) =
|
//TODO(arthursens): Expand example once kube-rbac-proxy can be managed with a first-class
|
||||||
//if std.objectHas(c, 'resources') && c.name != 'kube-state-metrics'
|
// object inside node-exporter, kube-state-metrics and prometheus-operator.
|
||||||
if c.name != 'kube-state-metrics'
|
// See also: https://github.com/prometheus-operator/kube-prometheus/issues/1500#issuecomment-966727623
|
||||||
then c { resources+: { limits: {} } }
|
values+:: {
|
||||||
else c,
|
alertmanager+: {
|
||||||
|
resources+: {
|
||||||
|
limits: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
nodeExporter+: {
|
blackboxExporter+: {
|
||||||
daemonset+: {
|
resources+: {
|
||||||
spec+: {
|
limits: {},
|
||||||
template+: {
|
|
||||||
spec+: {
|
|
||||||
containers: std.map(noLimit, super.containers),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
kubeStateMetrics+: {
|
grafana+: {
|
||||||
deployment+: {
|
resources+: {
|
||||||
spec+: {
|
limits: {},
|
||||||
template+: {
|
|
||||||
spec+: {
|
|
||||||
containers: std.map(noLimit, super.containers),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
prometheusOperator+: {
|
kubeStateMetrics+: {
|
||||||
deployment+: {
|
resources+: {
|
||||||
spec+: {
|
limits: {},
|
||||||
template+: {
|
},
|
||||||
spec+: {
|
},
|
||||||
local addArgs(c) =
|
|
||||||
if c.name == 'prometheus-operator'
|
nodeExporter+: {
|
||||||
then c { args+: ['--config-reloader-cpu-limit=0', '--config-reloader-memory-limit=0'] }
|
resources+: {
|
||||||
else c,
|
limits: {},
|
||||||
containers: std.map(addArgs, super.containers),
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
prometheusAdapter+: {
|
||||||
|
resources+: {
|
||||||
|
limits: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
prometheusOperator+: {
|
||||||
|
resources+: {
|
||||||
|
limits: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
prometheus+: {
|
||||||
|
resources+: {
|
||||||
|
limits: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user