chore(monitoring): soft-pin stateful monitoring to agentpool node pool - #90
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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
preferredDuringSchedulingIgnoredDuringExecutionnodeAffinity(weight 100) for Grafana, Prometheus, and Alertmanager in kube-prometheus-stack values. - Add
singleBinary.affinitypreference 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Mirror of #88 for the monitoring stack: adds a soft
nodeAffinitypreference (weight 100) toward the originalagentpoolnode pool on the four stateful, memory-heavy components:helm-values.yaml(kube-prometheus-stack)loki-values.yaml(singleBinary.affinity)Why
After adding the prod
userpoolnode (Standard_D8as_v5, 8 vCPU) and pinning dev toagentpoolin #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
agentpoolnode, off the produserpoolnode. Preference only (not a hard rule) so they still schedule ifagentpoolis full.Scope / safety
alloyandnode-exporterrun one-per-node by design.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