Kubernetes Classroom Series – 02/Jul/2021

Scheduling Process (Automated Placement)

  • Overview Preview

  • 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)

  • Node Selctor:

    • This assignment can be done under node selector
    • .spec.nodeSelector is 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    
      
      
  • Node Affinity:

    • This feature is generalization of the node selector approach.
    • Node Affinity feature greatly expands the types of constraints that be expressed by providing operators
      • In
      • NotIn
      • Exists
      • DoesNotExist
      • Gt
      • Lt
    • Refer Here for the changeset containing node affinity demo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin