Sign inSign up

serverlab/cookie-monster

By serverlab

•Updated almost 5 years ago

Test your container host's resource management by eating it all!

Image
0

55

serverlab/cookie-monster repository overview

Cookie Monster is an application designed to consume your container host's resources. It pays homage to the movie Hackers (1995), where a virus unleashed on the Gibson begins consuming all data until it's given a cookie.

The purpose of this tool is to be able to monitor how your hosts operate under pressure.

⁠Kubernetes

Kubernetes uses several measures to ensure your nodes are healthy. When under pressure the control plane will begin evicting pods from a node until the node is no longer under pressure.

Cookie Monster was originally designed to test and manipulate Kubernete's eviction behaviour, by witnessing how different QoS classes and PriorityClasses adjust the order of pod evictions, for example.

Increase Cookie Monster's priority and see how that affects which pods get evicted first!

apiVersion: apps/v1
kind: Deployment
metadata:
  name: cookie-monster
  labels:
    app: cookie-monster
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cookie-monster
  template:
    metadata:
      labels:
        app: cookie-monster
    spec:
      containers:
      - name: cookie-monster
        image: serverlab/cookie-monster:0.1.0
        imagePullPolicy: Always

⁠Docker

docker run -d cookie-monster:0.1.0
docker run -d --memory 1Gi cookie-monster:0.1.0 

⁠Monitor Resource Consumption

Cookie Monitor outputs what he's doing, allowing you to monitor how much he's eaten.

docker log -f CONTAINER
--> CGroup Memory limit discovered (9223372036854771712 bytes)
--> Cgroup too large. Limit set to phyiscal memory size (4127531008)
--> Consuming 85% of limit (3508401356 bytes)
I'd give you a cookie, but I ate it.
Bite Size: 17542006 (0.5%% memory
Give me 🍪! *Chomp, chomp* 16M 0M 3345M
Give me 🍪! *Chomp, chomp* 16M 16M 3345M
Give me 🍪! *Chomp, chomp* 16M 33M 3345M
Give me 🍪! *Chomp, chomp* 16M 50M 3345M
Give me 🍪! *Chomp, chomp* 16M 67M 3345M
Om Nom Nom Nom
Give me 🍪! *Chomp, chomp* 16M 83M 3345M

End his rampage by just giving him a cookie.

docker exec CONTAINER touch /cookie

Tag summary

Content type

Image

Digest

Size

4.7 MB

Last updated

almost 5 years ago

docker pull serverlab/cookie-monster:0.1.0