Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
"なるべくスケジューリングしない" を実現する "PreferNoSchedule" taint
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuki Suda
November 25, 2025
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
"なるべくスケジューリングしない" を実現する "PreferNoSchedule" taint
Kubernetes Meetup Tokyo 72 - LT
Kazuki Suda
November 25, 2025
More Decks by Kazuki Suda
See All by Kazuki Suda
実践/先取り「入門 Kubernetes Validating/Mutating Admission Policy」 / CloudNative Days Winter 2024
superbrothers
0
72
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
170
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.6k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.6k
コミュニティ/ 勉強会紹介
superbrothers
0
280
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
13
6.6k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
110
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
8.7k
わかる!metadata.managedFields
superbrothers
4
2.5k
Other Decks in Technology
See All in Technology
クラウドファンディング版StackChan 3体(4体)をインタラクティブな体験型作品にして展示もした話 / スタックチャンお誕生日会2026
you
PRO
0
260
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
1
1.9k
きのこカンファレンス2026_肩書きを外したとき私は誰か
yamasatimi
1
110
從觀望到全公司落地:AI Agentic Coding 導入實戰 — 流程整合與安全治理
appleboy
0
260
AI時代における最適なQA組織の作り方
ymty
3
260
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
120
MySQL & MySQL HeatWave Report - June 2026
freshdaz
0
230
トークン最適化のためのユーザーストーリー分析 / User Story Analysis for Token Optimization
oomatomo
0
150
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
200
水を運ぶ人としてのリーダーシップ
izumii19
4
1.1k
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.7k
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
200
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
230
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
870
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Facilitating Awesome Meetings
lara
57
7k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
220
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
640
Paper Plane
katiecoart
PRO
1
52k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
GitHub's CSS Performance
jonrohan
1033
470k
Transcript
@superbrothers Kubernetes Meetup Tokyo # 7 2 - LT
( 2025 / 11 / 25 ) SUDA Kazuki “なるべくスケジューリングしない” を実現する “PreferNoSchedule” taint
@superbrothers ノードの taint ノードに Pods をスケジューリングしないように制御する機能 2 kind: Node
taints: - key: "key1" value: "value1" effect: "NoSchedule" kind: Pod tolerations: - key: "key1" value: "value1" effect: "NoSchedule" ノードの taints を許容するための設定
@superbrothers ノードの taint: e ff ect の種類 ▶ NoSchedule
+ Pod が合致する toleration を持たなければスケジューリングしない ▶ NoExecute + Pod が合致する toleration を持たなければスケジューリングしない + 既に実 行 中の Pod がノードから排除される ▶ PreferNoSchedule + Pod が合致する toleration を持たなければ ”なるべくスケジューリングしない” 3 目立ってないけど、taints/tolerations が Kubernetes に初めて実装された v1.3 から存在してます。
@superbrothers PreferNoSchedule taint: なるべくスケジューリングしない 4 GPU Node taints: -
key: “nvidia.com/gpu“ effect: “PreferNoSchedule" allocatable: cpu: “36” nvidia.com/gpu: “8” GPU pod resources: requests: cpu: “1000m" limits: nvidia.com/gpu: 8 CPU pod resources: requests: cpu: “1000m" CPU Node allocatable: cpu: “24” GPU ノードにしか入らないのでそのまま入っていく GPU ノードに PreferNoSchedule taint があるので CPU ノードに空きがあればこっちが優先される CPU ノードに空きがなければ GPU ノードに入る
@superbrothers PreferNoSchedule taint の使いどころ ▶ GPU ノードに CPU pods
をなるべくスケジューリングしたくない + GPU ノードに nvidia.com/gpu:PreferNoSchedule taint を付与する + GPU pod をスケジューリングする際に CPU 割り当て量が 足 りずにスケジューリングできない 自 体を避けたいが、CPU ノードのリソースが 足 りない場合は GPU ノードへのスケジューリン グを許容したい ▶ これからメンテナンスするノードに pods を新たになるべくスケジューリングしたくない + メンテ対象の全ノードに maintenance-20251125:PreferNoSchedule taint を付与して 1ノードずつ完了後に削除する + メンテでノード上の pods を drain する際にこれからメンテされるノードではなく、既にメン テが完了したノードになるべくスケジューリングして evict の機会を減らしたい + Cluster API ではクラスタアップグレード時にロールアウト対象ノードに PreferNoSchedule taint を設定することでこれを実現している 5
@superbrothers PreferNoSchedule taint を実現する “TaintToleration” scheduler plugin ▶ 各ノードで
intolerable な (許容できない) taint の個数が最少のノードを100、最多を0の範囲で 線形に正規化する(スコア値が 高 いノードが望ましいノード) 6 func (pl *TaintToleration) Score(ctx context.Context, state fwk.CycleState, pod *v1.Pod, nodeInfo fwk.NodeInfo) (int64, *fwk.Status) { node := nodeInfo.Node() s, err := getPreScoreState(state) if err != nil { return 0, fwk.AsStatus(err) } score := int64(countIntolerableTaintsPreferNoSchedule(node.Spec.Taints, s.tolerationsPreferNoSchedule)) return score, nil } // CountIntolerableTaintsPreferNoSchedule gives the count of intolerable taints of a pod with effect PreferNoSchedule func countIntolerableTaintsPreferNoSchedule(taints []v1.Taint, tolerations []v1.Toleration) (intolerableTaints int) { for _, taint := range taints { // check only on taints that have effect PreferNoSchedule if taint.Effect != v1.TaintEffectPreferNoSchedule { continue } if !v1helper.TolerationsTolerateTaint(tolerations, &taint) { intolerableTaints++ } } return } https://github.com/kubernetes/kubernetes/blob/v 1 . 34 . 2 /pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go#L 1 8 3 -L 1 9 4
@superbrothers Appendix ▶ Taints and Tolerations | Kubernetes 7