Skip to content

chore(monitoring): soft-pin stateful monitoring to agentpool node pool - #90

Merged
hakan-persson merged 1 commit into
mainfrom
chore/monitoring-node-affinity
Jul 26, 2026
Merged

chore(monitoring): soft-pin stateful monitoring to agentpool node pool#90
hakan-persson merged 1 commit into
mainfrom
chore/monitoring-node-affinity

Conversation

@hakan-persson

Copy link
Copy Markdown
Member

What

Mirror of #88 for the monitoring stack: adds a soft nodeAffinity preference (weight 100) toward the original agentpool node pool on the four stateful, memory-heavy components:

  • Grafana, Prometheus, Alertmanager — via helm-values.yaml (kube-prometheus-stack)
  • Loki — via loki-values.yaml (singleBinary.affinity)

Why

After adding the prod userpool node (Standard_D8as_v5, 8 vCPU) and pinning dev to agentpool in #88, monitoring was left with no placement rule. These four have Azure-disk PVCs, but both nodes are in the same zone (swedencentral-1), so the disk/zone binding does not keep them on the old node across a restart — a restarted Prometheus/Alloy could land on the prod node and compete for CPU.

This makes the intent explicit: keep the memory-heavy monitoring stack on the roomier-RAM agentpool node, off the prod userpool node. Preference only (not a hard rule) so they still schedule if agentpool is full.

Scope / safety

  • DaemonSets untouchedalloy and node-exporter run one-per-node by design.
  • Lazy — takes effect as each pod restarts; no forced restarts.
  • Verified with helm template (kube-prometheus-stack 80.2.2, loki 6.49.0): affinity renders on grafana / prometheus / alertmanager / loki only, targeting the correct workloads.

🤖 Generated with Claude Code

Mirror of #88 for the monitoring stack: add a soft nodeAffinity preference
(weight 100) toward the original agentpool node pool on the four stateful,
memory-heavy components — Grafana, Prometheus, Alertmanager (kube-prometheus
-stack values) and Loki (singleBinary). Keeps them off the prod userpool node.

Both nodes share zone swedencentral-1, so the PVC/zone binding alone does NOT
keep these on the old node across a restart — this affinity makes that intent
explicit. Preference only, so they still schedule if agentpool is full.
DaemonSets (alloy, node-exporter) run on every node and are untouched.

Verified with helm template (kube-prometheus-stack 80.2.2, loki 6.49.0):
affinity renders on grafana/prometheus/alertmanager/loki only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 26, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds soft node-affinity preferences to keep the stateful, memory-heavy monitoring components scheduled on the original agentpool node pool (while still allowing scheduling elsewhere if needed). This fits the repo’s infra-as-code model by adjusting Helm values that ArgoCD will apply on the next pod restarts, without forcing rollouts.

Changes:

  • Add preferredDuringSchedulingIgnoredDuringExecution nodeAffinity (weight 100) for Grafana, Prometheus, and Alertmanager in kube-prometheus-stack values.
  • Add singleBinary.affinity preference for Loki in loki chart values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
k8s/infra-manifest/monitoring/helm-values.yaml Adds soft node affinity preferences for Grafana, Prometheus, and Alertmanager toward agentpool.
k8s/infra-manifest/monitoring/loki-values.yaml Adds soft node affinity preference for Loki (singleBinary) toward agentpool.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hakan-persson
hakan-persson requested a review from Copilot July 26, 2026 11:30
@hakan-persson
hakan-persson merged commit 413b99c into main Jul 26, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants