This page describes how the simulator works.
The simulator server works with the following:
- scheduler
- HTTP server
In advance, the simulator needs to launch etcd, controller-manager and kube-apiserver outside. We recommend using KWOK, see docker-compose.yml to know how we wire things up.
Users can create resources by communicating with kube-apiserver of KWOK via any clients (e.g. kubectl, k8s client library or Web UI)
When a new pod is created through kube-apiserver, the scheduler starts scheduling.
Normally, when score/filter plugins are called from scheduler, they will calculate the results and return results to the scheduler. But, in the simulator, custom plugins, that behave as score/filter plugin but records result after calculation, are used in scheduler.
The scheduler finally binds the pod to a node if succeeded, or move the pod back to queue if failed.
The result store will notice that the pod has been scheduled/marked as unscheduled by the scheduler and add the scheduling results to the pod's annotation.