Skip to content

Commit

Permalink
add introductions for scheduler component config api migrations
Browse files Browse the repository at this point in the history
Signed-off-by: kerthcet <kerthcet@gmail.com>
  • Loading branch information
kerthcet committed Oct 21, 2021
1 parent bbd7abf commit 5c51a5b
Showing 1 changed file with 55 additions and 11 deletions.
66 changes: 55 additions & 11 deletions content/en/docs/reference/scheduling/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ by implementing one or more of these extension points.
You can specify scheduling profiles by running `kube-scheduler --config <filename>`,
using the
KubeSchedulerConfiguration ([v1beta1](/docs/reference/config-api/kube-scheduler-config.v1beta1/)
or [v1beta2](/docs/reference/config-api/kube-scheduler-config.v1beta2/))
or [v1beta2](/docs/reference/config-api/kube-scheduler-config.v1beta2/))
struct.

A minimal configuration looks as follows:
Expand Down Expand Up @@ -89,7 +89,7 @@ profiles:
- plugins:
score:
disabled:
- name: NodeResourcesLeastAllocated
- name: PodTopologySpread
enabled:
- name: MyCustomPluginA
weight: 2
Expand All @@ -100,7 +100,7 @@ profiles:
You can use `*` as name in the disabled array to disable all default plugins
for that extension point. This can also be used to rearrange plugins order, if
desired.

### Scheduling plugins

The following plugins, enabled by default, implement one or more of these
Expand All @@ -116,10 +116,6 @@ extension points:
Extension points: `filter`.
- `NodePorts`: Checks if a node has free ports for the requested Pod ports.
Extension points: `preFilter`, `filter`.
- `NodePreferAvoidPods`: Scores nodes according to the node
{{< glossary_tooltip text="annotation" term_id="annotation" >}}
`scheduler.alpha.kubernetes.io/preferAvoidPods`.
Extension points: `score`.
- `NodeAffinity`: Implements
[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
and [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity).
Expand Down Expand Up @@ -170,7 +166,7 @@ extension points:
Extension points: `bind`.
- `DefaultPreemption`: Provides the default preemption mechanism.
Extension points: `postFilter`.

You can also enable the following plugins, through the component config APIs,
that are not enabled by default:

Expand All @@ -182,7 +178,7 @@ that are not enabled by default:
- `CinderLimits`: Checks that [OpenStack Cinder](https://docs.openstack.org/cinder/)
volume limits can be satisfied for the node.
Extension points: `filter`.

The following plugins are deprecated and can only be enabled in a `v1beta1`
configuration:

Expand All @@ -206,7 +202,7 @@ configuration:
- `NodePreferAvoidPods`: Prioritizes nodes according to the node annotation
`scheduler.alpha.kubernetes.io/preferAvoidPods`.
Extension points: `score`.

### Multiple profiles

You can configure `kube-scheduler` to run more than one profile.
Expand Down Expand Up @@ -255,10 +251,58 @@ the same configuration parameters (if applicable). This is because the scheduler
only has one pending pods queue.
{{< /note >}}

## Scheduler configuration migrations

{{< tabs name="tab_with_md" >}}
{{% tab name="v1beta1 → v1beta2" %}}
* A new score extension for `NodeResourcesFit` plugin is introduced, it merges the functionalities of `NodeResourcesLeastAllocated`, `NodeResourcesMostAllocated` and `RequestedToCapacityRatio` plugins, e.g., if you want to use `NodeResourceLeastAllocated` plugin, you have to use `NodeResourcesFit` plugin(enabled by default) and add a `pluginConfig` with a `scoreStrategy` like this:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
profiles:
- pluginConfig:
- args:
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: NodeResourcesFitArgs
scoringStrategy:
resources:
- name: cpu
weight: 1
type: LeastAllocated
name: NodeResourcesFit
```
* Scheduler plugin `NodeLabel` is deprecated, using [`NodeAffinity`](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) plugin(enabled by default) instead.
* Scheduler plugin `ServiceAffinity` is deprecated, using `InterPodAffinity` plugin instead, you should add a `pluginConfig` like this:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- pluginConfig:
- args:
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: InterPodAffinityArgs
hardPodAffinityWeight: 2
name: InterPodAffinity
```
* Scheduler plugin `NodePreferAvoidPods` is deprecated, using [node taints](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) instead.
* A plugin enabled in a v1beta2 configuration file takes precedence over the default configuration for that plugin. This simplifies enabling default plugins with custom configuration without the necessary to explicitly disable those default plugins.
* New parameter `defaultingType` added for `PodTopologySpread` plugin allowing to use k8s defined or user provided default constraints.
* Add pre-checks for scheduler healthz and metrics bind address:
```
1. If the value is nil, default to 0.0.0.0 and default scheduler port
2. If there is a value set, attempt to split it. If it's just a port (ie, ":1234"), default to 0.0.0.0 with that port
3. If splitting the value fails, check if the value is even a valid IP. If so, use that with the default port.
Otherwise leave the address as-is, it will be caught during validation.
```
{{% /tab %}}
{{< /tabs >}}
## {{% heading "whatsnext" %}}
* Read the [kube-scheduler reference](/docs/reference/command-line-tools-reference/kube-scheduler/)
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
* Read the [kube-scheduler configuration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) reference
* Read the [kube-scheduler configuration (v1beta2)](/docs/reference/config-api/kube-scheduler-config.v1beta2/) reference

0 comments on commit 5c51a5b

Please sign in to comment.