• Stars
    star
    279
  • Rank 147,967 (Top 3 %)
  • Language
    C#
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A chaos engineering style game where you seek out and destroy Kubernetes pods, twinstick shmup style.

kube-chaos

Kube Chaos is a twin-stick style shmup game in the style of chaos engineering. The game interfaces with your Kubernetes cluster and allows you to explore your cluster nodes and destroy live, running pods on those nodes. The game logic is written in C# and is powered by the Unity engine.

kube-chaos-quick-demo-1.mp4

Read more about kube-chaos' beginnings here

Requirements

  • kubectl and a working kube context to your cluster. Kubectl must be in your system path too.
  • A namespace with running pods (that you don't mind destroying via the game)
  • Decent enough hardware to run the game. (It uses Unity engine)

Downloading and Running

Source

You can compile the source and build your own executable yourself. You'll need Unity version 2019.4 or later. When doing this you should be able to switch and build for multiple platforms. Linux and macOS builds should work fine in addition to Windows.

Release

You can download a pre-compiled release (Windows/macOS) from the Releases page. Unzip and run the executable to get started.

Building

To build from source, install Unity 2019.4 or later. The default installation will allow you to target PC, macOS or Linux Standalone.

  • Launch the Unity Editor or Unity Hub and load the project from the root folder level of this repository.
  • On first load, Unity will generate the library assets. Be patient as this can take a few minutes sometimes.
  • Go to File -> Build Settings (or CTRL/CMD-SHIFT-B). Make sure the settings and Scenes In Build look like the below:

  • Configure the Target Platform to the platform you want to build for. E.g. Windows / macOs / Linux.
  • Optionally configure Window resolution and other settings using the Player Settings button. The defaults should be fine though.
  • Click Build and choose a location for the output build. Once complete the executable to launch the game will be placed in this location.
  • The build will take a few moments to complete...

  • Open the executable to run the game.

Game Configuration

The starting screen will allow you to enter your:

  • Kube context name. Default kubernetes-admin@kubernetes.
  • Namespace to target (find and destroy pods). Default demo.
  • Name of your kubectl executable/binary. Default kubectl

Note for macOS: Enter the full / absolute path to kubectl in the textbox in the main menu. Click Start. If your nodes don't appear in the spawn area, then quit the game (CMD + Q) and try again. There seems to be a time related bug around the game executing the kubectl process in the background on initial start (where KubeManager.cs should load the node info to begin with in a thread).

Other

The game is really just a POC, and I hacked it together pretty quickly. In an ideal world I would have got the C# kubernetes-client library working with Unity and used the kube API. NuGet and Unity don't play nicely together so for a quick hack solution I went with calling out to the kubectl process from in-game. These processes are launched in separate threads to keep the game smooth and pause-free. I don't do any fancy thread lifecycle management, so threads are aborted/killed randomly during the game. Performance still seems fine for the demo.

There may be small issues here and there. Feel free to raise them as issues and/or fix them and submit PRs.

More Repositories

1

PixelSpriteGenerator-Unity

A port of the PixelSpriteGenerator to C# for use with the Unity3D game engine
C#
126
star
2

ec2-spot-termination-simulator

A very simple web API endpoint that returns a 200 from the endpoint that the EC2 metadata service on Amazon EC2 instances usually serves spot termination times on.
JavaScript
20
star
3

Unity3D.CharacterCreator

A character creator project utilising DynamoDB for character configuration storage.
C#
12
star
4

Hobbyistcoder.Editor.Utilities

Useful editor extensions and utilities for Unity 3D
C#
6
star
5

aws-docker-web-with-traefik

A super cheap docker web host in AWS, using Traefik for reverse proxying, and EFS storage for persistence.
TypeScript
5
star
6

fstojson-rust

Traverses a target filesystem directory & outputs the collected hierarchy to JSON
Rust
4
star
7

terraform-aws-msk

A Terraform module to provision an Amazon MSK (Amazon Managed Streaming for Apache Kafka) cluster
HCL
4
star
8

packer-windows-server-ami-with-s3download

Packer example to build a custom AWS AMI Windows Server image, download files from S3 securely, and run tests with Pester
PowerShell
3
star
9

traversefs-nim

A filesystem traversal tool written in Nim
Nim
2
star
10

terraform-eks-with-weave

A basic example Kubernetes Cluster (EKS) with Weave CNI replacing the standard AWS CNI plugin.
HCL
2
star
11

cloudwatch-lambda-to-splunk-hec

A Lambda service that ingests CloudWatch logs (via triggered event inputs from CloudWatch Log Groups), base64 decodes, decompresses, and then forwards them over to a Splunk HEC for ingestion there.
JavaScript
2
star
12

aws-cdk-step-function-saga-pattern

Saga pattern with AWS Step Functions, Lambda and aws-cdk
TypeScript
2
star
13

fstojson-nim

A simple CLI tool to traverse a target directory & output the collected hierarchy to JSON
Nim
1
star
14

remember-to-stand

A simple system tray and toast notification app to remind you to stand up and sit down. Made with Rust.
Rust
1
star
15

waypoint-docker-armhf

Docker image build for Hashicorp Waypoint on armhf. Raspberry Pi etc...
Dockerfile
1
star
16

CocoJson

Demonstrates fetching of JSON data and use of this data to create a browsable menu of iOS games/apps in application
Objective-C
1
star