Ever wondered how the K8s scheduler works, and how can you “help” it make the right decision for your application? In this session, we'll cover several different scheduling use-cases in K8s, what scheduling techniques are required in each and when to use them.
10. Worker node
us-west-1a us-west-1b
Worker node Worker node Worker node Worker node Worker node
Pod
Pod
Pod
Pod Pod Pod
Pod
Pod
Pod
PodPod Pod
Pod
New Technology - New Challenges
Pod
19. Pod - a
Pods from different “family” are not allowed
Worker node
c5d.4xlarge
Worker node Worker node
r5.4xlarge r5.8xlarge
Pod - a
Pod - b
Pod - x
Pod - y
Pod - 𝛼
Pod - 𝜷
24. Worker node
us-west-1a us-west-1b
Worker node Worker node Worker node Worker node Worker node
Pod Pod Pod
Pod
Pod
Pod
Pod
PodPod
Pod
Multiple replicas/instances/zones - HA
25. apiVersion: apps/v1
kind: Deployment
metadata:
name: pod-ha-host-zone
spec:
replicas: 3
...
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: name
operator: In
values:
- pod-ha-host-zone
topologyKey: kubernetes.io/hostname
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: service
operator: In
values:
- pod-ha-host-zone
topologyKey: failure-domain.beta.kubernetes.io/zone
1
2
Pod antiAffinity - zone & host level
26. Taints & Tolerations
● Taints - rule for nodes to repel pods
● Tolerations - attribute of pods
28. Additional scheduling considerations
● PVC location - PVC usually exists in a single AZ
● GPU - expensive instances -> “taint” them to repel
unwanted pods
● Don’t let coincidence manage your application
It is your responsibility to take care of this
29.
30.
31. Resources
https://github.com/tsahiduek/k8s-examples
Medium blog - https://bit.ly/2msBdJY
https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
Kubernetes design-proposal directory -
https://github.com/kubernetes/community/tree/master/contributors/design-proposals
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/sch
eduling/nodeaffinity.md
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/sch
eduling/podaffinity.md