惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Palo Alto Networks Blog
S
Security Affairs
T
Tor Project blog
T
Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
A
Arctic Wolf
K
Kaspersky official blog
O
OpenAI News
Spread Privacy
Spread Privacy
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
Simon Willison's Weblog
Simon Willison's Weblog
雷峰网
雷峰网
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
量子位
博客园_首页
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
V2EX - 技术
V2EX - 技术
S
Schneier on Security
博客园 - 叶小钗
Attack and Defense Labs
Attack and Defense Labs
AI
AI
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 【当耐特】
Jina AI
Jina AI
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
V
V2EX
S
SegmentFault 最新的问题
V
Visual Studio Blog
PCI Perspectives
PCI Perspectives
Microsoft Security Blog
Microsoft Security Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
🧹 Keeping Your Kubernetes Cluster Clean with the Descheduler
Hamdi (KHELIL) LION · 2026-06-26 · via DEV Community

Your scheduler did a great job placing pods this morning. But your cluster never stops moving, and by this afternoon those decisions are already a little bit wrong. 😅

The kube-scheduler only decides things once, at pod creation time. After that it walks away. The descheduler is the friend that comes back later, looks at the mess, and gently tidies up.

Let me walk you through it. 🚀

🗺️ what we will cover

  • 🤔 why a perfectly scheduled cluster slowly drifts
  • 🧹 what the descheduler does (and what it does not do)
  • 🧩 the building blocks: profiles, plugins and extension points
  • 🔌 the strategy plugins you will actually reach for
  • 🛡️ the Default Evictor, your safety net
  • 🚀 installing it with Helm (full values file)
  • ⏱️ CronJob vs Deployment mode
  • 🧪 testing safely with dry run
  • 🧯 a production safety checklist
  • 🧠 the gotcha that bites everyone

🤔 why your cluster drifts

The scheduler makes a one time decision based on the cluster as it looked the moment a pod appeared. Real clusters keep changing under that decision:

  • 🆕 New nodes join (autoscaler or manual) and sit half empty while old nodes stay packed.
  • 🔧 You drain and uncordon a node for maintenance, and nothing moves back onto it.
  • 🏷️ Labels and taints change, so pods that matched the old rules now violate them.
  • 💥 Nodes fail, pods pile up elsewhere, and the spread never recovers on its own.

The result is drift: hotspots, lopsided utilization, and affinity rules that are quietly broken.

👉 The descheduler exists to correct this drift, on a schedule, without you babysitting it.

🧹 what it actually does

Here is the part people get wrong, so let me be blunt about it.

The descheduler does not schedule pods. It only evicts them. 🙅

It finds pods that are poorly placed, evicts them through the standard Kubernetes Eviction API, and then trusts the normal kube-scheduler to recreate them in a better spot.

That has two big consequences:

  • ✅ It plays nicely with the scheduler you already have, no replacement needed.
  • ✅ It respects PodDisruptionBudgets, because it uses the same eviction path everything else does. If an eviction would break a PDB, the request is rejected and that pod is skipped.

So the mental model is simple: the descheduler makes room, the scheduler fills it. 🔁

🧩 the building blocks

Modern descheduler config uses the descheduler/v1alpha2 API. Three concepts matter.

1. Profiles 📋
A profile is a named bundle of plugins and their config. You can run more than one.

2. Plugins 🔌
Each strategy is a plugin (for example LowNodeUtilization). You configure it under pluginConfig and then switch it on under plugins.

3. Extension points 🪝
This is where a plugin runs. The two you care about for strategies are:

  • deschedule: looks at pods one by one and evicts the bad ones.
  • balance: looks across nodes and evicts to even things out.

There are also filter and preEvictionFilter points, which the Default Evictor uses to decide what is safe to touch.

Here is the shape of a policy so the pieces click:

apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
  - name: default
    pluginConfig:
      - name: "LowNodeUtilization"
        args:
          thresholds:
            cpu: 20
            memory: 20
            pods: 20
          targetThresholds:
            cpu: 50
            memory: 50
            pods: 50
    plugins:
      balance:
        enabled:
          - "LowNodeUtilization"

🔌 the strategies you will actually use

There are many plugins, but a handful do most of the work. Let me group them by extension point.

⚖️ balance plugins

These rebalance placement across the cluster.

  • 🔥 LowNodeUtilization: finds underused nodes and evicts pods from overused ones, hoping they reschedule onto the quiet nodes. Note: utilization here is based on pod requests vs allocatable, not live metrics, unless you wire up a metrics provider.
  • 🌶️ HighNodeUtilization: the opposite idea, pack pods off underused nodes so they can be scaled down. Great with a cluster autoscaler that scales in.
  • 👯 RemoveDuplicates: stops multiple pods of the same workload from piling onto one node, which is exactly what you want for high availability.
  • 🗺️ RemovePodsViolatingTopologySpreadConstraint: re-balances pods so they respect your topology spread constraints again.

🧨 deschedule plugins

These walk pods and evict the ones that no longer belong.

  • 🚫 RemovePodsViolatingNodeAffinity: evicts pods stuck on nodes that no longer match their node affinity.
  • 🧪 RemovePodsViolatingNodeTaints: evicts pods that no longer tolerate a node's taints.
  • 🧲 RemovePodsViolatingInterPodAntiAffinity: cleans up pods that now break their anti affinity rules.
  • ♻️ RemovePodsHavingTooManyRestarts: evicts crash looping pods past a restart threshold so they can try a healthier node.
  • PodLifeTime: evicts pods older than a max lifetime, handy for forcing periodic recycling.
  • 🧟 RemoveFailedPods: clears out pods stuck in a failed state.

👉 Start with RemoveDuplicates and LowNodeUtilization. They give the most value with the least surprise.

🛡️ the Default Evictor, your safety net

Before any strategy evicts a pod, the Default Evictor decides whether that pod is even allowed to be touched. This is your most important safety layer, so do not skip it.

The args you will reach for:

  • 🧷 nodeFit: true: only evict a pod if there is actually another node it could land on. This single setting prevents most pointless eviction loops.
  • 🔢 minReplicas: never evict if fewer than this many replicas exist, so you do not knock out a lonely pod.
  • 👑 evictSystemCriticalPods: false: leave system critical priority pods alone (this is the default).
  • 💾 evictLocalStoragePods: false: do not evict pods using local storage, unless you really mean to.
  • 🐝 evictDaemonSetPods: false: leave DaemonSet pods in place (this is the default).
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
  - name: default
    pluginConfig:
      - name: "DefaultEvictor"
        args:
          nodeFit: true
          minReplicas: 2
          evictSystemCriticalPods: false
          evictLocalStoragePods: false
          evictDaemonSetPods: false

Newer releases also offer a podProtections block (with defaultDisabled and extraEnabled lists, plus extras like PodsWithPVC and PodsWithoutPDB). The classic args above still work and are easier to read when you are getting started.

🚀 installing it with Helm

The official Helm chart is the cleanest path. These commands are for the chart published by the project.

helm repo add descheduler https://kubernetes-sigs.github.io/descheduler/
helm repo update
helm install descheduler descheduler/descheduler --namespace kube-system

Now here is a complete, opinionated values.yaml you can actually start from. It runs as a CronJob, enables the safe high value strategies, and keeps the Default Evictor strict.

# values.yaml
kind: CronJob
schedule: "*/15 * * * *"   # run every 15 minutes, tune to taste

# pin the image to a known version
image:
  repository: registry.k8s.io/descheduler/descheduler
  tag: v0.36.0

deschedulerPolicyAPIVersion: "descheduler/v1alpha2"

deschedulerPolicy:
  # cluster wide eviction guard rails
  maxNoOfPodsToEvictPerNode: 5
  maxNoOfPodsToEvictPerNamespace: 10
  maxNoOfPodsToEvictTotal: 50

  profiles:
    - name: default
      pluginConfig:
        - name: "DefaultEvictor"
          args:
            nodeFit: true
            minReplicas: 2
            evictSystemCriticalPods: false
            evictLocalStoragePods: false
            evictDaemonSetPods: false

        - name: "RemoveDuplicates"
          args:
            excludeOwnerKinds:
              - "DaemonSet"

        - name: "LowNodeUtilization"
          args:
            thresholds:
              cpu: 20
              memory: 20
              pods: 20
            targetThresholds:
              cpu: 50
              memory: 50
              pods: 50

        - name: "RemovePodsHavingTooManyRestarts"
          args:
            podRestartThreshold: 100
            includingInitContainers: true

      plugins:
        balance:
          enabled:
            - "RemoveDuplicates"
            - "LowNodeUtilization"
        deschedule:
          enabled:
            - "RemovePodsHavingTooManyRestarts"

Apply it with:

helm upgrade --install descheduler descheduler/descheduler \
  --namespace kube-system \
  --values values.yaml

Prefer Kustomize? The project ships base manifests too. Swap the ref for the release branch that matches your version (for example release-1.36 for v0.36.0):

kustomize build 'github.com/kubernetes-sigs/descheduler/kubernetes/cronjob?ref=release-1.34' | kubectl apply -f -

⏱️ CronJob vs Deployment mode

The descheduler can run in three shapes. Two matter day to day.

  • 🕒 CronJob: runs on a schedule (schedule: "*/15 * * * *") and exits. Simple, cheap, easy to reason about. Great default.
  • ♾️ Deployment: runs continuously and re-evaluates every deschedulingInterval (for example 5m). Pair it with leader election if you run more than one replica.
# Deployment mode snippet
kind: Deployment
replicas: 1
deschedulingInterval: 5m
leaderElection:
  enabled: true

👉 If you are not sure, start with CronJob. You only move to Deployment when you want tighter, continuous reaction.

🧪 test safely with dry run first

Please do not point this at production blind. Run it in dry run mode and read the logs first. 🙏

With Helm:

helm upgrade --install descheduler descheduler/descheduler \
  --namespace kube-system \
  --values values.yaml \
  --set cmdOptions.dry-run=true

Then watch what it would have done:

kubectl -n kube-system logs -l app.kubernetes.io/name=descheduler -f

You will see lines naming the pods it would evict and the strategy that picked them. Tune your thresholds until the list looks sane, then turn dry run off.

🧯 production safety checklist

Before you let it evict for real, walk this list. ✅

  • PodDisruptionBudgets everywhere that matters. The descheduler honors them, so a good PDB is your strongest guard against an outage.
  • nodeFit: true so it never evicts a pod that has nowhere else to go.
  • minReplicas set so single replica workloads are left alone.
  • Eviction caps via maxNoOfPodsToEvictPerNode, maxNoOfPodsToEvictPerNamespace and maxNoOfPodsToEvictTotal so a bad run cannot churn the whole cluster.
  • System namespaces protected, and system critical priority pods left untouched.
  • Sensible schedule. Every few minutes is rarely needed. Every 15 to 30 minutes is plenty for most clusters.

📊 keep an eye on it

The descheduler exposes Prometheus metrics, served on https://localhost:10258/metrics by default. You can change the address with the --binding-address and --secure-port flags.

Scrape it, then watch how many pods it evicts per run. A healthy cluster should settle into a small, steady number. A number that never drops is a signal that something keeps fighting it. ⚠️

🧠 the gotcha that bites everyone

Here is the classic trap: an eviction and reschedule loop.

It usually looks like this:

  1. You enable a strategy (say node affinity based) to nudge pods toward preferred nodes.
  2. Those preferred nodes are not available yet.
  3. The descheduler evicts the pod, the scheduler puts it right back where it was, and the cycle repeats forever. 🔄

This shows up a lot with spot or autoscaled node pools, where the target nodes are still being provisioned when the eviction happens.

How to avoid the loop:

  • 🧷 Keep nodeFit: true so it will not evict when there is no valid destination.
  • 🐢 Use a calmer schedule so the cluster has time to settle between runs.
  • 🎯 Be careful with preferred affinity rules as eviction triggers, since "preferred" is never fully satisfied and can churn endlessly.
  • 🚦 Cap evictions so even a misconfiguration stays contained.

👉 If you see the same pods evicted over and over in dry run, fix that before going live. Dry run is exactly how you catch this.

🎁 wrapping up

The descheduler is one of those tools that quietly earns its keep. It does not replace your scheduler, it just keeps cleaning up after entropy:

  • 🧹 It evicts poorly placed pods and lets the scheduler re-place them.
  • 🛡️ It respects PDBs and the Default Evictor so it stays polite.
  • 🚀 It installs in minutes with Helm and tunes with a single values file.
  • 🧪 It is safe to trial thanks to dry run.

Start small. Turn on RemoveDuplicates and LowNodeUtilization, run in dry run, read the logs, then let it loose. Your nodes will thank you. 😄

Happy clustering and stay safe! 🧹🚀