Scheduling: Control plane component that handles scheduling. KubeScheduler: Control plane component that handles scheduling.
Scheduling Process
The Kubernetes scheduler selects a suitable Node for each Pod. It takes into account things like:
nodeSelector
You can configure a nodeSelector for your Pods to limit which Node(s) the Pod can be scheduled on. Node selectors use node labels to filter suitable nodes.
kubectl label nodes k8s-worker2 key=value
apiVersion: v1
kind: Pod
metadata:
name: nodeselector-pod
spec:
nodeSelector:
special: "true" #It is written in quotes so that it should not interpert it as
containers: # Boolean
- name: nginx
image: nginx:1.19.1
nodeName
You can bypass scheduling and assign a Pod to a specific Node by name using nodeName.
apiVersion: v1
kind: Pod
metadata:
name: nodename-pod
spec:
nodeName: <node name>
containers:
- name: nginx
image: nginx:1.19.1