Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog.d/1815.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Fixed
- The eBPF profiler pod on the node that runs the most pods is no longer OOMKilled every few minutes: the `alloy-profiles` memory limit is 1024Mi, up from 512Mi ([#1815](https://github.com/dan-petty/devops-cli/issues/1815)).
18 changes: 18 additions & 0 deletions docs/agent/tasks/task-1815-alloy-profiles-memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Task: The Profiler Pod on the Busiest Node Stays Up (#1815)

**Issue**: [#1815](https://github.com/dan-petty/devops-cli/issues/1815)
**Scope**: scope/k8s
**Feasibility**: Read from the live cluster, read-only. One pod of the `alloy-profiles` DaemonSet had 31 restarts in 148 minutes, its `alloy` container's last state was `OOMKilled` (exit code 137) at the 512Mi limit, and the pod sat at 1/2 Ready in CrashLoopBackOff, while the DaemonSet's pods on the two other nodes ran without a restart. Prometheus's cAdvisor series, scraped too seldom to catch the spikes, put the pods' working sets between 197 and 351Mi, and `kubectl top` showed 205 to 215Mi on the healthy pods and 286Mi on the crashing one a few minutes after a restart.

## Description
The profiler targets every pod on its node (`profiling.ebpf.targetingScheme: all`), so its memory follows the node's pod count, and 512Mi did not hold on the node that runs the most pods. The limit is now 1024Mi and the request is unchanged at 128Mi. The values say why.

The profiler's log also shows `unsupported Go version go1.27.1 (need >= 1.13 and <= 1.26)` for the Prometheus binary: it costs that binary's profile and waits for an Alloy release whose profiler supports Go 1.27.

## Key Changes
- `k8s/monitoring/k8s-monitoring-values.yaml`: `collectors.alloy-profiles.alloy.resources.limits.memory` is `1024Mi`, with a comment on the pod count and the OOM kills.
- `tests/test_k8s_monitoring_integration.py`: `test_the_profiler_limit_leaves_room_above_the_spikes_that_killed_it` pins the request and the limit.

## Acceptance Criteria
- [x] The profiler's memory limit is 1024Mi (`test_the_profiler_limit_leaves_room_above_the_spikes_that_killed_it`).
- Pending a person: after the release reaches `main` and Argo CD syncs `k8s-monitoring`, every pod of `kubectl -n monitoring get pods -l app.kubernetes.io/name=alloy-profiles` is 2/2 Ready with no new restarts after a day. If the pod on the busiest node still reaches 1024Mi, narrow `profiling.ebpf.targetingScheme` instead of raising the limit again.
5 changes: 4 additions & 1 deletion k8s/monitoring/k8s-monitoring-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,13 @@ collectors:
- privileged
alloy:
enableReporting: false
# The eBPF profiler targets every pod on its node (profiling.ebpf.targetingScheme: all), so its
# memory follows the node's pod count. At 512Mi the pod on the busiest node was OOMKilled 31
# times in 148 minutes while the pods on the other nodes held 200 to 300Mi (#1815).
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
memory: 1024Mi
12 changes: 12 additions & 0 deletions tests/test_k8s_monitoring_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,15 @@ def test_profiling_runs_on_k8s_monitoring_alloy_profiles() -> None:
),
["daemonset", "privileged"],
)


def test_the_profiler_limit_leaves_room_above_the_spikes_that_killed_it() -> None:
"""The eBPF profiler on the node that runs the most pods was OOMKilled 31 times in 148
minutes at 512Mi, while the same pods on two quieter nodes held 200 to 300Mi without a restart
(#1815). Its limit is 1024Mi and its request is unchanged."""
resources = _k8s_monitoring_values()["collectors"]["alloy-profiles"]["alloy"]["resources"]

assert (resources["requests"]["memory"], resources["limits"]["memory"]) == (
"128Mi",
"1024Mi",
)