fix(k8s): set requests and limits on the pods that shipped with neither
Eighteen containers had no memory limit at all, so nothing on the node could bound them. Three of the values files even claimed to set resources: Helm does not complain about a key it does not recognise, so the block sat there looking like a limit while the pod ran unbounded. alloy is the one that mattered. The chart reads `alloy.resources`; the file had `controller.resources`, so the DaemonSet that tails every pod log on the node shipped with nothing at all. `kubeStateMetrics` is the same trap in a different shape -- that is the condition key, the values live under `kube-state-metrics` -- and `configReloader` in the alloy chart sits at the top level rather than under `alloy`. Each one is verified by rendering the chart and reading the resources back off the containers, because a values key that is ignored looks exactly like one that works. reloader turned out to be set and still wrong: 64Mi request against a measured p95 of 73M, so the pod ran permanently above its own request and stayed a standing eviction candidate. That is the pod that restarts every other pod, so it is the last one that should be evicted. Raised to 96Mi. Requests are set at p95 throughout, grafana, playwright and alloy included. Left at the values first proposed they would have sat below their own p95 and queued for eviction ahead of everything smaller. CPU limits are deliberately absent: the node is I/O bound at 5% CPU, and CFS throttling would turn disk wait into runnable-throttled, which is the failure mode that took the node down. The prometheus and alertmanager configReloader sidecars are left open: chart 86.2.3 does not template the key, so reaching those two containers needs a postRenderer. Verified: all four charts render with the resources landing on the intended containers, and 16/16 local gates pass.
This commit is contained in:
1 parent
a5409edbf2
commit
16aaeb60c1
7 files changed
+116
-6
No files matched your search
@@ -26,6 +26,25 @@ grafana:
|
||||
service:
|
||||
port: 80
|
||||
|
||||
# p95 391M, observed max 1046M with no limit at all. Request is set at p95 so the
|
||||
# scheduler sees reality; the limit is a manual exception above the 1.3x max
|
||||
# formula, because a single query burst reached 1046M.
|
||||
resources:
|
||||
requests:
|
||||
memory: "416Mi"
|
||||
cpu: 100m
|
||||
limits:
|
||||
memory: "1536Mi"
|
||||
|
||||
# One block covers both the dashboards and datasources sidecars (p95 91M / 80M).
|
||||
sidecar:
|
||||
resources:
|
||||
requests:
|
||||
memory: "96Mi"
|
||||
cpu: 10m
|
||||
limits:
|
||||
memory: "192Mi"
|
||||
|
||||
additionalDataSources:
|
||||
- name: Loki
|
||||
type: loki
|
||||
@@ -55,6 +74,14 @@ prometheus:
|
||||
alertmanager:
|
||||
alertmanagerSpec:
|
||||
configSecret: alertmanager-config
|
||||
# p95 66M, max 68M. Silences and notification state live here, so the request
|
||||
# stays above p95 to keep the pod out of the eviction candidates.
|
||||
resources:
|
||||
requests:
|
||||
memory: "96Mi"
|
||||
cpu: 10m
|
||||
limits:
|
||||
memory: "192Mi"
|
||||
storage:
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
@@ -66,6 +93,39 @@ alertmanager:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
|
||||
# p95 103M, max 107M, and it grows with the number of cluster objects.
|
||||
kube-state-metrics:
|
||||
# Values key is the dependency name from Chart.yaml, not the `kubeStateMetrics`
|
||||
# condition key. Setting resources under `kubeStateMetrics:` is silently ignored.
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: 50m
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
|
||||
# p95 39M, max 40M. One per node, so it scales with node count.
|
||||
prometheus-node-exporter:
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: 20m
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
|
||||
# p95 75M, max 75M. Creates and reconciles every PrometheusRule in the cluster.
|
||||
prometheusOperator:
|
||||
resources:
|
||||
requests:
|
||||
memory: "96Mi"
|
||||
cpu: 50m
|
||||
limits:
|
||||
memory: "192Mi"
|
||||
|
||||
# config-reloader sidecars (p95 33M, max 43M) are not covered: the chart does not
|
||||
# template `prometheusSpec.configReloader.resources`, so there is no values key
|
||||
# for them. They keep shipping with requests only.
|
||||
|
||||
defaultRules:
|
||||
disabled:
|
||||
CPUThrottlingHigh: true
|
||||
|
||||
Reference in new issue
Block a user