Eugenio Marzo ff99a0f93f added image
2021-10-03 09:01:03 +02:00
2021-01-25 20:39:58 +01:00
2021-04-23 08:41:08 +02:00
2021-07-09 22:38:43 +02:00
2021-02-13 12:25:29 +01:00
2021-10-03 08:59:23 +02:00
2021-10-03 09:01:03 +02:00
2021-10-02 18:06:52 +02:00
2021-10-02 18:06:52 +02:00
2021-01-25 21:59:19 +01:00
2021-10-02 18:06:52 +02:00
2021-03-27 16:12:14 +01:00
2019-04-21 23:29:46 +02:00
2021-02-21 04:53:18 +01:00
2021-10-02 18:06:52 +02:00
2021-05-15 14:13:05 +02:00
2021-01-10 20:20:17 +01:00
2019-04-21 23:31:07 +02:00
2021-10-02 12:02:39 +02:00

Gamified chaos engineering tool for Kubernetes. It is like Space Invaders but the aliens are pods or worker nodes.

Alt Text

Table of Contents

  1. Description
  2. Installation
  3. Usage
  4. Known Problems
  5. Metrics
  6. Security

Description

Through KubeInvaders you can stress a Kubernetes cluster in a fun way and check how it is resilient.

Installation

Install to Kubernetes with Helm (v3+)

Artifact HUB

helm repo add kubeinvaders https://lucky-sideburn.github.io/helm-charts/

kubectl create namespace kubeinvaders

helm install kubeinvaders --set-string target_namespace="namespace1\,namespace2" \
-n kubeinvaders kubeinvaders/kubeinvaders --set ingress.hostName=kubeinvaders.io --set image.tag=v1.9

Usage

Show Special Keys

Press 'h' or select 'Show Special Keys' from the menu.

Zoom In / Out

Press + or - buttons to increase or decrease the game screen.

Do Kube-linter Lint

It is possibile using kube-linter through KubeInvaders in order to scan resources looking for best-practices or improvements to apply.

Example from YouTube

Commands and metrics

At the top you will find some metrics, the start button for automatic pilot and the rand-factor bar for increasing or decreasing speed of automatic shots.

Alt Text

Current Replicas State Delay is a metric that show how much time the cluster takes to coming back at the desired state of pods replicas.

Show / Hide pods name

Press the button "Hide Pods Name" or "Show Pods Name" to control labels under the aliens. Alt Text

Chaos Containers for masters and workers nodes

Select from the menu "Show Current Chaos Container for nodes" for watching which container start when you fire against a worker node (not an alien, they are pods). Select from the menu "Set Custom Chaos Container for nodes" for use your preferred image or configuration for stressing Kubernetes nodes.

Known problems

  • It seems that KubeInvaders does not work with EKS because of problems with ServiceAccount. Work in progress!

Hands-on Tutorial

To experience KubeInvaders in action, try it out in this free O'Reilly Katacoda scenario, KubeInvaders.

Prometheus Metrics

KubeInvaders exposes metrics for Prometheus through the standard endpoint /metrics

This is an example of Prometheus configuration

scrape_configs:
- job_name: kubeinvaders
  static_configs:
  - targets:
    - kubeinvaders.kubeinvaders.svc.cluster.local:8080

Example of metrics

Metric Description
chaos_jobs_node_count{node=workernode01} Total number of chaos jobs executed per node
chaos_node_jobs_total Total number of chaos jobs executed against all worker nodes
deleted_pods_total 16 Total number of deleted pods
deleted_namespace_pods_count{namespace=myawesomenamespace} Total number of deleted pods per namespace

Download Grafana dashboard

Alt Text

Alt Text

Security

In order to restrict the access to the Kubeinvaders endpoint add this annotation into the ingress.

nginx.ingress.kubernetes.io/whitelist-source-range: <your_ip>/32
Languages
JavaScript 39.1%
HTML 20.6%
Python 17.1%
Lua 15.8%
Shell 3.5%
Other 3.9%