Git Product home page Git Product logo

kube-scheduler-simulator's Introduction

Kubernetes scheduler simulator

Hello world. Here is Kubernetes scheduler simulator.

Nowadays, the scheduler is configurable/extendable in the multiple ways:

But, unfortunately, not all configurations/expansions yield good results. Those who customize the scheduler need to make sure their scheduler is working as expected, and doesn't have an unacceptably negative impact on the scheduling.

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. That's why we are developing 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.

Simulator's architecture

We have several components:

  • Simulator (in /simulator)
  • Web UI (in /web)
  • Coming soon... :) (see ./keps to see some nice ideas we're working on)

Simulator

Simulator internally has kube-apiserver, scheduler, and HTTP server.

You can create any resources by communicating with kube-apiserver via kubectl, k8s client library, or web UI.

See the following docs to know more about simulator:

  • how-it-works.md: describes about how the simulator works.
  • kube-apiserver.md: describe about kube-apiserver in simulator. (how you can configure and access)
  • api.md: describes about HTTP server the simulator has.

Web UI

Web UI is one of the clients of simulator, but it's optimized for simulator.

From the web, 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.

Getting started

Read more about environment variables being used in simulator server here.

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. If you want to deploy the simulator on a remote server and access it via a specific IP (e.g: like http://10.0.0.1:3000/), please make sure that you have executed export SIMULATOR_EXTERNAL_IP=your.server.ip before running docker-compose up -d.

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

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.

kube-scheduler-simulator's People

Contributors

196ikuchil avatar aibarbetta avatar amewayne avatar ezetowers avatar jonyhy96 avatar k8s-ci-robot avatar kerthcet avatar khalilswdp avatar markstur avatar matthewygf avatar momom-i avatar p1ass avatar panli889 avatar pravarag avatar riita10069 avatar sanposhiho avatar sivchari avatar skuethe avatar spiffxp avatar tamboliasir1 avatar thearas avatar tk3fftk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.