Scheduling Process (Automated Placement)
As soon as pod is create that is not assigned to a node yet, it gets picked by scheduler together with all the available nodes and set of filtering and priority policies.
In first stage, Scheduler tries to apply the filtering and priority policies by removing all the nodes that do not qualify the Pod’s criteria
In Second stage, all the qualified nodes get ordered by weight
In last stage Pod gets assigned to the node (highest weight)
- This assignment can be done under node selector
.spec.nodeSelectoris the Pod field and specifies a map of key values pairs that must be present on the node for the node to be eligible to run the Pod
- To assign labels to nodes Refer Here
apiVersion: v1 kind: Pod metadata: name: nodeselector-demo spec: containers: - name: nodeselector-container image: nginx ports: - containerPort: 80 livenessProbe: httpGet: port: 80 path: / initialDelaySeconds: 30 nodeSelector: disktype: ssd os: ubuntu
- Refer Here for the changeset
- This feature is generalization of the node selector approach.
- Node Affinity feature greatly expands the types of constraints that be expressed by providing operators
- Refer Here for the changeset containing node affinity demo