<p>The k8s scheduling implementation comes in two forms: <a href="https://v1-18.docs.kubernetes.io/docs/reference/scheduling/" rel="nofollow noreferrer">Scheduling Policies and Scheduling Profiles</a>.</p>
<p><strong>What is the relationship between the two?</strong> They seem to overlap but have some differences. For example, there is a <code>NodeUnschedulable</code> in the <code>profiles</code> but not in the <code>policy</code>. <code>CheckNodePIDPressure</code> is in the <code>policy</code>, but not in the <code>profiles</code></p>
<p>In addition, there is a default startup option in the scheduling configuration, but it is not specified in the scheduling policy. How can I know about the default startup policy?</p>
<p>I really appreciate any help with this.</p>

<p>The difference is simple: Kubernetes does't support 'Scheduling policies' from v1.19 or later. Kubernetes v1.19 supports <a href="https://kubernetes.io/docs/reference/scheduling/config/#multiple-profiles" rel="nofollow noreferrer">configuring multiple scheduling policies</a> with a single scheduler. We are using this to define a bin-packing scheduling policy in all v1.19 clusters by default. 'Scheduling profiles' can be used to define a bin-packing scheduling policy in all v1.19 clusters by default.</p>
<p>To use that scheduling policy, all that is required is to specify the scheduler name bin-packing-scheduler in the Pod spec. For example:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 5
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      schedulerName: bin-packing-scheduler
      containers:
      - name: nginx
        image: nginx:1.17.8
        resources:
          requests:
            cpu: 200m
</code></pre>
<p>The pods of this deployment will be scheduled onto the nodes which already have the highest resource utilisation, to optimise for autoscaling or ensuring efficient pod placement when mixing large and small pods in the same cluster.</p>
<p>If a scheduler name is not specified then the default spreading algorithm will be used to distribute pods across all nodes.</p>
