A web-based simulator for the Kubernetes scheduler

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

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

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

configure scheduler

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 with Docker

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

You can use it with the below command.

make docker_build_and_up

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

Run 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.

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.

Owner
Kubernetes SIGs
Org for Kubernetes SIG-related work
Kubernetes SIGs
Comments
  • use prow job

    use prow job

    We cannot run github actions on PRs from first contributor. With prow job, it seems that we can trust PR and run actions with /ok-to-test.

    https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md

    /kind feature

  • Implement import/export API

    Implement import/export API

    What type of PR is this?

    /kind api-change /kind feature

    What this PR does / why we need it:

    • Add import/export method on API
      • Add resources service & handler

    export

    1. Call each List function and return it in json.

    import

    1. Post data in json.
    2. Apply` to each resource.
    3. return status 200 code if cuccess.

    Which issue(s) this PR fixes:

    Fixes #28

    Special notes for your reviewer:

    Please review the sections I commented on.

    /label tide/merge-method-squash /label do-not-merge/work-in-progress /hold

  • Feature: Simulate Pods scheduling process in any existing clusters

    Feature: Simulate Pods scheduling process in any existing clusters

    Hi, I am new to this project (from scheduling-plugin sig). I learned about the kube-scheduler-simulator. In my option, this simulator only simulate pods scheduling process in a new simulation cluster, which means it can't simulate a real cluster for now(e.g production environment) . Is it possible to simulate pods in an already exist environment? I am interesting in contributing to this project, maybe I need to learn more details about it.

  • Replace k8sapiserver startAPIServer to use Kubernetes createServerChain

    Replace k8sapiserver startAPIServer to use Kubernetes createServerChain

    What type of PR is this?

    /kind feature

    What this PR does / why we need it:

    This PR tries to extend the simulator apiserver to accept CRDs, this is useful because some scheduler-plugins uses CRDs. https://github.com/kubernetes-sigs/kube-scheduler-simulator/issues/77

    Additionally, we can directly use the Kubernetes/api-server/createServerChain method to reduce the burden of maintaining API code.

    This is a PR spawned from a discussion in PR #113

    Which issue(s) this PR fixes:

    Fixes #

    Special notes for your reviewer:

    After this extension, user can use kubectl to apply CRDs.

    /label tide/merge-method-squash

  • Fix lint issues on frontend

    Fix lint issues on frontend

    What type of PR is this?

    /kind cleanup

    What this PR does / why we need it:

    Fix lint issues on frontend.

    Which issue(s) this PR fixes:

    Fixes #

    Special notes for your reviewer:

    /label tide/merge-method-squash

  • Improve documentation about environment variables being used

    Improve documentation about environment variables being used

    What type of PR is this?

    /kind documentation

    What this PR does / why we need it:

    As part of this PR, we are adding documentation for environment variables that are used to configure kube-scheduler-simulator

    Which issue(s) this PR fixes:

    Fixes #106

    Special notes for your reviewer:

    /label tide/merge-method-squash

  • support PriorityClass on backend

    support PriorityClass on backend

    Added Service Layer Interface, Service, Handler, DI to container, as well as the handler and paths to the server. Can I have some guidance on how to test and possible next steps? Thank you

  • Implement Import/export button on frontend

    Implement Import/export button on frontend

    What type of PR is this?

    /kind feature

    What this PR does / why we need it:

    • Implement import/export button on web.
    • follow import/export API that implemented on PR #64

    Which issue(s) this PR fixes:

    Fixes #28

    Special notes for your reviewer:

    • This PR is related to PR #64 and is including that commit.
    • Currently, the basic import/export function be working.

    /label tide/merge-method-squash /hold

  • Provide images for simulator with k8s.gcr.io

    Provide images for simulator with k8s.gcr.io

    /kind feature /cc @adtac /cc @Huang-Wei /cc @alculquicondor /assign

    Hi team.

    what want to do

    add images for backend/frontend to k8s.gcr.io

    • create PR on kubernetes/k8s.io
      • this doc helps us: https://github.com/kubernetes/k8s.io/tree/main/k8s.gcr.io
      • (like this pr?: https://github.com/kubernetes/k8s.io/pull/1431/files)
    • push images with cloudbuild
      • this doc helps us: https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md

    why

    Now, when users want to use the simulator, they have to clone this repo, build it and run it(on docker or local). This is a little inconvenient because it will take them a lot of time to build frontend/backend (maybe because of some huge dependencies).

    So it is great if we can provide images for backend/frontend so that users can only have to run these images. wdyt?

    Question

    • Are there any requirements for creating the image?
    • Do we need to get someone's approval to create images?

    I cannot find anything about these in documentations.

  • Make it easy for users to add their custom plugins

    Make it easy for users to add their custom plugins

    Currently, the simulator only supports default plugins. But some users may want to try their custom plugins on the simulator.

    • Describe in the documentation how to add a custom plugin to the simulator.
    • Add some functions(or some option?) to register the custom plugins

    /assign

  • Implement table view on Web UI

    Implement table view on Web UI

    What type of PR is this?

    /kind feature

    What this PR does / why we need it:

    • Reorganization of the directories of some current resources List components.
    • Implement DataTable on web UI. This table view is switchable to the current resources list view.
      • This is an alpha feature. It will be enabled if the ALPHA_TABLE_VIEWS environment value is 1.
    • simple searching.
    • sorting.
    • clickable to edit and delete.

    Which issue(s) this PR fixes:

    Fixes #96

    Special notes for your reviewer:

    Samples
    スクリーンショット 2022-02-28 22 57 05 スクリーンショット 2022-02-28 22 57 16 スクリーンショット 2022-02-28 23 06 15
    clickable
    スクリーンショット 2022-02-28 22 58 12

    /label tide/merge-method-squash

  • API to fetch pod annotations and more

    API to fetch pod annotations and more

    Closes: 109

    Adding endpoint /namespaces/:namespace/pods/:name/metadata/annotations/:annotation

    This allows fetching of a single annotation from a specific pod in a specific namespace. The path (.../metadata/annotation...) is intended to mirror the apimachinery API to avoid re-inventing especially assuming this might be expanded.

    Given the leveraging of apimachinery, it made sense to add some additional endpoints:

    • /namespaces/:namespace/pods/:name/metadata/annotations - when no :annotation is added (or is blank) all annotations are returned
    • /namespaces/:namespace/pods/:name - pod details are returned for namspace/pod
    • /namespaces/:namespace/pods - pod details are returned for all pods in namespace

    Unmarshalling of annotations:

    Since the specific goal is to help access scheduler-simulator annotations in a usable format, we attempt to unmarshal specific annotations. A specific scheduler-simulator/* annotation will become map[string]map[string]string.

    In addition, when :annotation = "scheduler-simulator" or "scheduler-simulator/" we can conclude that all the simulator annotations for this pod should be returned and unmarshalled into map[string]map[string]map[string]string.

    Other cases dump all the metadata and do not unmarshal annotations to avoid errors.

    Signed-off-by: Mark Sturdevant [email protected]

    What type of PR is this?

    What this PR does / why we need it:

    Which issue(s) this PR fixes:

    Fixes #

    Special notes for your reviewer:

    /label tide/merge-method-squash

  • Create user config file for web

    Create user config file for web

    What type of PR is this?

    /area web

    What this PR does / why we need it:

    Create user config file for web. Refer to #245.

    Which issue(s) this PR fixes:

    Fixes #

    Special notes for your reviewer:

  • Integrate kwok into simulator

    Integrate kwok into simulator

    In the simulator, we just run almost pure kube-apiserver. The simulator doesn't have much controllers, and something seems actually weird to users sometimes. (like some fields in Pods and Nodes don't get changed, etc) And, for example, https://github.com/kubernetes-sigs/kube-scheduler-simulator/issues/243 directly affects the scheduling results, which we must avoid as a simulator.

    I feel we can almost resolve them by integrating Kwok which watches Node and Pods and behaves like kubelet. We can expect Pods and Nodes to behave more like a real cluster but without running any real instances or containers.

    /kind feature /triage accepted /area simulator /priority important-longterm

  • Create the component config for simulator.(#245)

    Create the component config for simulator.(#245)

    Create the component config in simulator.

    Signed-off-by: yanghesong [email protected]

    What type of PR is this?

    /kind feature /kind cleanup /area simulator

    What this PR does / why we need it:

    Which issue(s) this PR fixes:

    Fixes #245

    Special notes for your reviewer:

    /cc @sanposhiho

  • New feature idea:`Benchmarker`

    New feature idea:`Benchmarker`

    I propose a new feature benchmarker idea based on MetricsCollector #246. In the proposal of the collector, the only responsibility was to collect metrics. This is to provide a way to access metrics not only from scenarios but also from general tools.

    Therefore, the Benchmarker aims to make benchmark tests easily executable by having the Scenario and the Collector work together.

    It would be nice if it could also work well with KEP-184:scheduler-simulation.

    Relates: #167

A batch scheduler of kubernetes for high performance workload, e.g. AI/ML, BigData, HPC
A batch scheduler of kubernetes for high performance workload, e.g. AI/ML, BigData, HPC

kube-batch kube-batch is a batch scheduler for Kubernetes, providing mechanisms for applications which would like to run batch jobs leveraging Kuberne

Jan 6, 2023
OpenAIOS vGPU scheduler for Kubernetes is originated from the OpenAIOS project to virtualize GPU device memory.
OpenAIOS vGPU scheduler for Kubernetes is originated from the OpenAIOS project to virtualize GPU device memory.

OpenAIOS vGPU scheduler for Kubernetes English version|中文版 Introduction 4paradigm k8s vGPU scheduler is an "all in one" chart to manage your GPU in k8

Jan 3, 2023
Wirewold cellular automata simulator, running entirely on GPU.

Wireworld-gpu Wireworld implements the data and rules for the Wireworld cellular automata. This particular version is an experiment whereby the simula

Dec 31, 2022
A cloud-native application simulator for golang

Build and upload Docker images Build docker images for main application and work

Aug 10, 2022
Zeonica is a simulator for CGRA and Wafer-Scale Accelerators.

Zeonica Zeonica is a simulator for CGRA and wafer-scale accelerators. ISA Definition Register Space Special registers include: PC: Program Counter. TI

Oct 12, 2022
Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021
Modern Job Scheduler
Modern Job Scheduler

Kala Kala is a simplistic, modern, and performant job scheduler written in Go. Features: Single binary No dependencies JSON over HTTP API Job Stats Co

Dec 21, 2022
scenario system to check the behavior of kube-scheduler

kube-scheduler-simulator-cli: Kubernetes Scheduler simulator on CLI and scenario system. Hello world. This repository is scenario system for kube-sche

Jan 25, 2022
KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
 KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes

Kubernetes-based Event Driven Autoscaling KEDA allows for fine-grained autoscaling (including to/from zero) for event driven Kubernetes workloads. KED

Jan 7, 2023
An Easy to use Go framework for Kubernetes based on kubernetes/client-go

k8devel An Easy to use Go framework for Kubernetes based on kubernetes/client-go, see examples dir for a quick start. How to test it ? Download the mo

Mar 25, 2022
Litmus helps Kubernetes SREs and developers practice chaos engineering in a Kubernetes native way.
Litmus helps Kubernetes SREs and developers practice chaos engineering in a Kubernetes native way.

Litmus Cloud-Native Chaos Engineering Read this in other languages. ???? ???? ???? ???? Overview Litmus is a toolset to do cloud-native chaos engineer

Jan 1, 2023
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds

Website • Quickstart • Documentation • Blog • Twitter • Slack vcluster - Virtual Clusters For Kubernetes Lightweight & Low-Overhead - Based on k3s, bu

Jan 4, 2023
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.

Network Node Manager network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of ku

Dec 18, 2022
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Oct 15, 2022
Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.
Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.

Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes. This project is inspired by agones. Introduction Genera

Nov 25, 2022
Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:
Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:

Kubei is a vulnerabilities scanning and CIS Docker benchmark tool that allows users to get an accurate and immediate risk assessment of their kubernet

Dec 30, 2022
The OCI Service Operator for Kubernetes (OSOK) makes it easy to connect and manage OCI services from a cloud native application running in a Kubernetes environment.

OCI Service Operator for Kubernetes Introduction The OCI Service Operator for Kubernetes (OSOK) makes it easy to create, manage, and connect to Oracle

Sep 27, 2022
Kubernetes IN Docker - local clusters for testing Kubernetes
Kubernetes IN Docker - local clusters for testing Kubernetes

kind is a tool for running local Kubernetes clusters using Docker container "nodes".

Jan 5, 2023
PolarDB-X Operator is a Kubernetes extension that aims to create and manage PolarDB-X cluster on Kubernetes.

GalaxyKube -- PolarDB-X Operator PolarDB-X Operator is a Kubernetes extension that aims to create and manage PolarDB-X cluster on Kubernetes. It follo

Dec 19, 2022