Skip to content

acrlabs/simkube

Repository files navigation

build status

simkube

A collection of tools for simulating Kubernetes scheduling and autoscaling behaviour

Overview

This package provides the following components:

  • sk-cloudprov: an external gRPC-based cloud provider for Cluster Autoscaler that can communicate with and scale the sk-vnode "node group".
  • sk-ctrl: a Kubernetes Controller that watches for Simulation custom resources and runs a simulation based on the provided trace file.
  • sk-driver: the actual runner for a specific simulation, created as a Kubernetes Job by sk-ctrl
  • sk-tracer: a watcher for Kubernetes pod creation and deletion events, saves these events in a replayable trace format.
  • sk-vnode: a Virtual Kubelet-based "hollow node" that allows customization based off a "skeleton" node file (see the example in simkube/manifests/dist/0000-sk-vnode.k8s.yaml)

Developing

When you first clone the repository, run make setup; this will initialize pre-commit and the Poetry virtualenv for generating the Kubernetes manifests. You will also need to install go-carpet 1.11.0 or higher:

go install https://github.com/drmorr0/go-carpet@latest

To deploy all the subcomponents, run make. This will also create a test deployment which is scheduled on the virtual nodes. If you scale the test deployment up or down, Cluster Autoscaler and sk-cloudprov will react to scale the sk-vnode deployment object.

If you want to run linting checks and tests manually, you can run make test.

Kubernetes manifests are generated via 🔥Config, which is based on top of cdk8s. You don't have to use the generated manifests but they are generally recommended.

All relevant build artifacts get placed in .build. If you'd like to remove them you can run make clean.