k8s-cluster-simulator
k8s-cluster-simulator copied to clipboard
Making k8s-cluster-simulator event-driven
Currently, the k8s-cluster-simulator is designed as a time-driven simulator (using a variable, tick, as a time). The simplicity of the design is nice :-) This design, however, might cause some difficulties when simulating:
- Some events, like node failures, are not guaranteed to occur at regular intervals. If an event happens between ticks, it has to be postponed until the next tick.
- As a workaround of 1, we can make the tick value smaller. This can cause additional useless ticks. The result is a longer simulation time.
To address the difficulties, this issue proposes to make the simulator event-driven instead of time-driven one. The event-driven simulator can skip useless ticks since it only handles events (an element to change state) instead of handling periodic ticks. Events include a scheduler’s scheduling , node addition/deletion, submitter’s job submission/cancellation, and so on. One deficit of the proposal I recognize is complexity - I don’t know whether it fits in the current simulator’s design. So, do you have any comments about the point?
For the purpose of reference, I implemented a basic data structure, evseq, for an event-driven simulator. I hope that this sample pseudo main loop helps our discussion.