Slide 1

Slide 1 text

Kubernetes Scheduling Features Or How Can I Make the System Do What I Want? Ian Lewis, Developer Advocate, Google

Slide 2

Slide 2 text

Scheduling ?

Slide 3

Slide 3 text

Scheduling Predicates Priorities

Slide 4

Slide 4 text

Scheduling Predicates

Slide 5

Slide 5 text

Scheduling Priorities 10 5

Slide 6

Slide 6 text

Scheduling

Slide 7

Slide 7 text

Scheduling Predicates Priorities

Slide 8

Slide 8 text

Predicates deep dive

Slide 9

Slide 9 text

Prevent overcommit ?

Slide 10

Slide 10 text

Prevent overcommit ?

Slide 11

Slide 11 text

Prevent co-scheduling (pod anti-affinity) ?

Slide 12

Slide 12 text

Prevent co-scheduling (pod anti-affinity)

Slide 13

Slide 13 text

Prevent co-scheduling (pod anti-affinity) ? PodAntiAffinity: { TopologyKey: "hostname", LabelSelector: "type:cat" }

Slide 14

Slide 14 text

Prevent co-scheduling (pod anti-affinity)

Slide 15

Slide 15 text

Prevent co-scheduling (pod anti-affinity)

Slide 16

Slide 16 text

Prevent co-scheduling (pod anti-affinity)

Slide 17

Slide 17 text

Prevent co-scheduling (pod anti-affinity)

Slide 18

Slide 18 text

Prevent co-scheduling (pod anti-affinity) PodAntiAffinity: { TopologyKey: "hostname", LabelSelector: "type:cat" }

Slide 19

Slide 19 text

Force co-scheduling (pod affinity) ?

Slide 20

Slide 20 text

Force co-scheduling (pod affinity) ? PodAffinity: { TopologyKey: "hostname", LabelSelector: "type:sapling" }

Slide 21

Slide 21 text

Force co-scheduling (pod affinity)

Slide 22

Slide 22 text

Dedicated machines (Taints)

Slide 23

Slide 23 text

Dedicated machines (Taints)

Slide 24

Slide 24 text

Dedicated machines (Taints) Taint: { TaintEffect: "NoSchedule", Key: "color", Value: "blue" } Toleration: { Key: "color", Value: "blue", Operator: "Equal", TaintEffect: "NoSchedule" }

Slide 25

Slide 25 text

Dedicated machines (Taints)

Slide 26

Slide 26 text

Predicate summary ● Prevent overcommit ● Prevent co-scheduling ● Force co-scheduling ● Dedicated Nodes

Slide 27

Slide 27 text

Priorities deep dive

Slide 28

Slide 28 text

Best fit vs worst fit ?

Slide 29

Slide 29 text

Best fit vs worst fit Worst fit

Slide 30

Slide 30 text

Best fit vs worst fit Best fit

Slide 31

Slide 31 text

Selector Spreading ?

Slide 32

Slide 32 text

Selector Spreading

Slide 33

Slide 33 text

Node Affinity ?

Slide 34

Slide 34 text

Node Affinity

Slide 35

Slide 35 text

Pod Affinity ?

Slide 36

Slide 36 text

Pod Affinity

Slide 37

Slide 37 text

Pod Anti-Affinity ?

Slide 38

Slide 38 text

Pod Anti-Affinity

Slide 39

Slide 39 text

How to combine scores? ?

Slide 40

Slide 40 text

Linear combination Σa i p i

Slide 41

Slide 41 text

https://commons.wikimedia.org/wiki/File:Messina_Straits_Chauliodus_sloani.jpg Dangers of depending on priorities

Slide 42

Slide 42 text

Decision tree Node Affinity score Node Affinity score ? Spreading score Spreading score ? ... > < = 1000 * (Node Affinity score) + 100 * (Spreading score) + ... > < =

Slide 43

Slide 43 text

Priorities are powerful … but require deep understanding

Slide 44

Slide 44 text

• [beta in 1.6] Multi-scheduler support • [beta in 1.6] Node affinity • [beta in 1.6] Pod affinity/anti-affinity • [beta in 1.6] Tains & tolerations Feature state as of 1.6

Slide 45

Slide 45 text

• Priorities & preemptions • Rescheduler • Resource estimation Future plans

Slide 46

Slide 46 text

SIG Scheduling • Meeting every other Monday 2pm PST • #sig-scheduling Slack channel • kubernetes-sig-scheduling@ mailing group Join community