This topic is weighed 5% on exam
Use label selectors to schedule Pods.
nodeSelector tells kubernetes to deploy a pod only to nodes containing a particular label
Create label on node
kubectl label node bk8s-node2 rack=prod
Edit pod manifest to include the following under spec:
nodeSelector: rack: "prod"
Understand the role of DaemonSets.
- Run a pod on each and every node in the cluster
- pods managed by DaemonSets bypass the scheduler
Understand how resource limits can affect Pod scheduling.
Understand how to run multiple schedulers and how to configure Pods to use them.
Manually schedule a pod without a scheduler.
Display scheduler events.
kubectl get events
kubectl get events --watch
kubectl logs kube-scheduler-bk8s-node0 -n kube-system(if scheduler is a pod)
/var/log/kube-scheduler.log on the control/master node(if schedule is standalone service)
Know how to configure the Kubernetes scheduler.
- taints - applies to nodes
- master node typically has a taint of node-role.kubernetes.io/master:NoSchedule; pods cannot be scheduled here UNLESS the pod tolerates this taint; pods that typically tolerate it are system pods; if a toleration matches the taint, it can be scheduled
- tolerations - apply to pods; to deploy to a node, they need to tolerate the taint
- node selectors
- pod affinity - determine where pods are placed in respect to one another
- pod anti-affinity - determine where pods are not placed in respect to one another
- node affinity - schedule pods only to specific subset of nodes
- currently only affects pod scheduling and never causes a pod to be evicted from a node
- ability to specify which nodes the Scheduler should prefer when scheduling a specific pod