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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuki Suda
November 25, 2025
Technology
210
0
Share
"なるべくスケジューリングしない" を実現する "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
64
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
160
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.5k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.6k
コミュニティ/ 勉強会紹介
superbrothers
0
270
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
13
6.6k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
97
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
8.7k
わかる!metadata.managedFields
superbrothers
4
2.5k
Other Decks in Technology
See All in Technology
A Harness for Behaviour: how to get AI to generate code that does what we intend, or "TDD in the age of AI"
xpmatteo
1
520
開発を止めない CI/CD ~CI Visibilityによる継続的最適化~
pensuke628
0
220
電子辞書Brainをネットに繋げてみた(自力編)
raspython3
0
380
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
なぜハノーバーメッセに行くべきなのか 〜初参加だから語れること〜
tanakaseiya
0
190
Spring AI × MCP 入門〜AIエージェントへのツール公開、境界設計から始める最小構成 〜
yuyamiyamoto
0
190
Claude code Orchestra
ozakiomumkj
2
770
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
130
Sony_KMP_Journey_KotlinConf2026
sony
1
180
「コーディング」しない人のための Claude Code 入門 ChatGPT の次の一歩 — 業務に組み込む 育成・共有・自動化
rfdnxbro
1
440
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
660
Claude Codeですべての日常業務を爆速化しよう!
minorun365
PRO
16
16k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The SEO identity crisis: Don't let AI make you average
varn
0
480
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Statistics for Hackers
jakevdp
799
230k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
520
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
170
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
55k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Designing for Performance
lara
611
70k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
210
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