Pods are the basic unit of work that are scheduled by Kubernetes to run on nodes. By default, Kubernetes has a built-in scheduler, and it tries to assign pods to the nodes evenly by ensuring that there are sufficient free resources. There are some use cases to configure and extend the scheduler behavior of Kubernetes considering the custom requirements of scalable and reliable cloud-native applications:
- Running certain pods on specialized hardware
- Co-locating some pods that include interacting services
- Dedicating some nodes to some users
Scheduler customization and extension patterns, starting from the basics to the complex, are listed as follows:
- Assigning node labels and using node selectors
- Using affinity and anti-affinity rules
- Marking nodes with taints, and pods with tolerations
- Creating and deploying custom scheduler algorithms