wao-scheduler

module
v1.27.0-alpha.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: Apache-2.0

README

WAO Scheduler Version 2

A kube-scheduler with MinimizePower plugin and PodSpread plugin to schedule pods with WAO.

Overview

WAO Scheduler schedules pods with features focused on minimizing power consumption. This is done by the following scheduler plugins:

  • MinimizePower: Score nodes based on expected power consumption.
  • PodSpread: Keep availability high by spreading pods across nodes, works together with MinimizePower.

Getting Started

Installation

[!NOTE] Make sure you have wao-core and wao-metrics-adapter set up.

Install WAO Scheduler with default configuration.

kubectl apply -f https://github.com/waok8s/wao-scheduler/releases/download/v1.27.0/wao-scheduler.yaml

Wait for the scheduler to be ready.

kubectl wait pod $(kubectl get pods -n kube-system -l app=wao-scheduler -o jsonpath="{.items[0].metadata.name}") -n kube-system --for condition=Ready
Deploy Pods with MinimizePower

This plugin is enabled by default, so you only need to set spec.schedulerName.

[!WARNING] Note that this plugin requires that at least one container in the pod has requests.cpu or limits.cpu set, otherwise the pod will be rejected. To be exact, if requests.cpu is set, it will be used as the expected CPU usage of the pod, otherwise limits.cpu will be used, otherwise the pod will be rejected.

  apiVersion: v1
  kind: Pod
  metadata:
    name: nginx
  spec:
+   schedulerName: wao-scheduler
    containers:
    - name: nginx
      image: nginx:1.14.2
      resources:
        requests:
          cpu: 100m
        limits:
          cpu: 200m
Deploy Pods with PodSpread

This plugin only effects pods controlled by Deployment (and ReplicaSet), and it needs to be enabled by setting wao.bitmedia.co.jp/podspread-rate annotation.

  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: nginx-deployment
    labels:
      app: nginx
+   annotations:
+     wao.bitmedia.co.jp/podspread-rate: "0.6"
  spec:
    replicas: 10
    selector:
      matchLabels:
        app: nginx
    template:
      metadata:
        labels:
          app: nginx
      spec:
+       schedulerName: wao-scheduler
        containers:
        - name: nginx
          image: nginx:1.14.2

Then 60 percent of the pods will be spread across nodes, and the rest 40 percent will be scheduled normally (i.e. MinimizePower plugin will be used).

Configuration

Just like kube-scheduler, WAO Scheduler reads configuration from a file specified by --config flag.

Here is an example KubeSchedulerConfiguration with MinimizePower and PodSpread plugins enabled.

apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
leaderElection:
  leaderElect: false
profiles:
  - schedulerName: wao-scheduler
    plugins:
      multiPoint:
        enabled:
        - name: MinimizePower
        - name: PodSpread

Development

This project is following Scheduling Framework.

Components
  • pkg/plugins/minimizepower: MinimizePower plugin.
  • pkg/plugins/podspread: PodSpread plugin.

Changelog

Versioning: we use the same major.minor as Kubernetes, and the patch is our own.

  • What comes next:
    • TBD
  • 2023-xx-xx v1.27.0
    • First release.
    • minimizepower Add the scheduler plugin.
    • podspread Add the scheduler plugin.

Acknowledgements

This work is based on results obtained from a project, JPNP21005, subsidized by the New Energy and Industrial Technology Development Organization (NEDO).

License

Copyright 2023 Bitmedia, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL