kube-scheduler-simulator

module
v0.0.0-...-bd98516 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0

README

Web-based Kubernetes scheduler simulator

Hello world. Here is web-based Kubernetes scheduler simulator.

On the simulator, you can create/edit/delete these resources to simulate a cluster.

  • Nodes
  • Pods
  • Persistent Volumes
  • Persistent Volume Claims
  • Storage Classes
  • Priority Classes

list resources

You can create resources with yaml file as usual.

create node

And, after pods are scheduled, you can see the results of

  • Each Filter plugins
  • Each Score plugins
  • Final score (normalized and applied Plugin Weight)

result

You can configure the scheduler on the simulator through KubeSchedulerConfiguration.

Scheduler Configuration | Kubernetes

You can pass a KubeSchedulerConfiguration file via the environment variable KUBE_SCHEDULER_CONFIG_PATH and the simulator will start kube-scheduler with that configuration.

Note: changes to any fields other than .profiles are disabled on simulator, since they do not affect the results of the scheduling.

configure scheduler

If you want to use your custom plugins as out-of-tree plugins in the simulator, please follow this doc.

Background

In real Kubernetes, we cannot know the results of scheduling in detail without reading the logs, which usually requires privileged access to the control plane. Therefore, we have developed a simulator for kube-scheduler -- you can try out the behavior of the scheduler with web UI while checking which plugin made what decision for which Node.

It can be used to learn about the Kubernetes scheduler or to examine the detailed behavior of plugins, etc.

Getting started

Run simulator with Docker

We have docker-compose.yml to run the simulator easily.

You can use the following command.

# build the images for web frontend and simulator server, then start the containers.
make docker_build_and_up

Then, you can access the simulator with http://localhost:3000

Note: Insufficient memory allocation may cause problems in building the image. Please allocate enough memory in that case.

Run simulator locally

You have to run frontend, server and etcd.

Run simulator server and etcd

To run this simulator's server, you have to install Go and etcd.

You can install etcd with kubernetes/kubernetes/hack/install-etcd.sh.

cd simulator
make start

It starts etcd and simulator-server locally.

Run simulator frontend

To run the frontend, please see README.md on ./web dir.

Contributing

see CONTRIBUTING.md

other docs

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

Directories

Path Synopsis
docs
simulator module

Jump to

Keyboard shortcuts

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