From 64851f0632c92b2e2ffa6b3a7fd6ffb375f512e7 Mon Sep 17 00:00:00 2001 From: John T Skarbek Date: Fri, 16 Oct 2026 09:39:38 -0400 Subject: [PATCH] feat(alloy): set default resource requests The Alloy container has no resource requests by default. The scheduler reserves nothing for it, and the node evicts it first under memory pressure. Set small CPU and memory requests. Set no limits: usage grows with the number of scrape targets, and a limit could throttle or OOM-kill the collector on large clusters. Operators can override alloy.alloy.resources. --- README.md | 2 ++ coder-observability/values.yaml | 6 ++++++ compiled/resources.yaml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index ec9d13b..1770459 100644 --- a/README.md +++ b/README.md @@ -318,6 +318,8 @@ values which are defined [here](https://github.com/grafana/helm-charts/tree/main | alloy.alloy.extraArgs[0] | string | `"--disable-reporting=true"` | | | alloy.alloy.mounts.dockercontainers | bool | `true` | | | alloy.alloy.mounts.varlog | bool | `true` | | +| alloy.alloy.resources.requests.cpu | string | `"50m"` | | +| alloy.alloy.resources.requests.memory | string | `"128Mi"` | | | alloy.commonRelabellings | string | `"rule {\n source_labels = [\"__meta_kubernetes_namespace\"]\n target_label = \"namespace\"\n}\nrule {\n source_labels = [\"__meta_kubernetes_pod_name\"]\n target_label = \"pod\"\n}\n// coalesce the following labels and pick the first value; we'll use this to define the \"job\" label\nrule {\n source_labels = [\"__meta_kubernetes_pod_label_app_kubernetes_io_component\", \"app\", \"__meta_kubernetes_pod_container_name\"]\n separator = \"/\"\n target_label = \"__meta_app\"\n action = \"replace\"\n regex = \"^/*([^/]+?)(?:/.*)?$\" // split by the delimiter if it exists, we only want the first one\n replacement = \"${1}\"\n}\nrule {\n source_labels = [\"__meta_kubernetes_namespace\", \"__meta_kubernetes_pod_label_app_kubernetes_io_name\", \"__meta_app\"]\n separator = \"/\"\n target_label = \"job\"\n}\nrule {\n source_labels = [\"__meta_kubernetes_pod_container_name\"]\n target_label = \"container\"\n}\nrule {\n regex = \"__meta_kubernetes_pod_label_(statefulset_kubernetes_io_pod_name|controller_revision_hash)\"\n action = \"labeldrop\"\n}\nrule {\n regex = \"pod_template_generation\"\n action = \"labeldrop\"\n}\nrule {\n source_labels = [\"__meta_kubernetes_pod_phase\"]\n regex = \"Pending|Succeeded|Failed|Completed\"\n action = \"drop\"\n}\nrule {\n source_labels = [\"__meta_kubernetes_pod_node_name\"]\n action = \"replace\"\n target_label = \"node\"\n}\nrule {\n action = \"labelmap\"\n regex = \"__meta_kubernetes_pod_annotation_prometheus_io_param_(.+)\"\n replacement = \"__param_$1\"\n}"` | | | alloy.controller.podAnnotations."prometheus.io/scrape" | string | `"true"` | | | alloy.controller.type | string | `"daemonset"` | | diff --git a/coder-observability/values.yaml b/coder-observability/values.yaml index 834739a..4c82ad1 100644 --- a/coder-observability/values.yaml +++ b/coder-observability/values.yaml @@ -207,6 +207,12 @@ alloy: mounts: varlog: true dockercontainers: true + # Requests only. A limit could throttle or OOM-kill the collector on large + # clusters, where usage grows with the number of scrape targets. + resources: + requests: + cpu: 50m + memory: 128Mi controller: type: daemonset podAnnotations: diff --git a/compiled/resources.yaml b/compiled/resources.yaml index c735291..ae899dc 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -12112,6 +12112,10 @@ spec: scheme: HTTP initialDelaySeconds: 10 timeoutSeconds: 1 + resources: + requests: + cpu: 50m + memory: 128Mi volumeMounts: - name: config mountPath: /etc/alloy