GithubHelp home page GithubHelp logo

cilium / chaos-monkeys Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 6.0 796 KB

Base infrastructure plus collection of tests to assist in the Cilium chaos testing efforts

Makefile 5.79% Dockerfile 1.61% Shell 92.60%

chaos-monkeys's Introduction

Chaos Test Infrastructure

Introduction

Base infrastructure plus collection of tests to assist in the Cilium chaos testing efforts.

Requirements

  • helm
  • kubectl
  • GNU make

How to deploy the test monkeys

Generate all ConfigMaps for the test scripts

make

Create a namespace to run the chaos tests:

kubectl create namespace chaos-testing

Edit & deploy the base ConfigMap to configure the Slack hook to report test failures:

vim monkey-config.yaml
kubectl -n chaos-testing apply -f monkey-config.yaml

Deploy the test monkeys:

make deploy

How to create a new monkey

A new monkey can be initialized from templates using the following command:

./create-monkey

If run without arguments, it will print usage instructions for initializing the configuration files for your new monkey. When a monkey name is specified, it will set up "monkey/{{MONKEY_NAME}}" based on templated files.

chaos-monkeys's People

Contributors

eloycoto avatar ianvernon avatar joestringer avatar lizrice avatar nebril avatar raybejjani avatar tgraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chaos-monkeys's Issues

Slack hook policy doesn't work well with others

The slack hook policy only allows for a specific monkey, but its CNP name is the same. This means that when you deploy multiple monkeys at the same time, each monkey's slack hook policy overwrites the other monkeys' slack hook policies.

name: {{ .Values.name }}

Simple fix is this:

diff --git a/templates/slack-hook-policy.yaml b/templates/slack-hook-policy.yaml
index a60e78d67c9d..a7ba06e3e250 100644
--- a/templates/slack-hook-policy.yaml
+++ b/templates/slack-hook-policy.yaml
@@ -5,7 +5,7 @@ metadata:
 spec:
   endpointSelector:
     matchLabels:
-      name: {{ .Values.name }}
+      k8s:io.kubernetes.pod.namespace: chaos-testing
   egress:
   - toEndpoints:
     - matchLabels:

However, the above will also put every endpoint in the chaos-testing namespace into default deny. We'd have to audit each monkey to check whether it has a policy to allow its own traffic.

One alternative might be to introduce another label to each monkey, so put a policy like this:

diff --git a/templates/slack-hook-policy.yaml b/templates/slack-hook-policy.yaml
index a60e78d67c9d..e54ad7aafb06 100644
--- a/templates/slack-hook-policy.yaml
+++ b/templates/slack-hook-policy.yaml
@@ -5,7 +5,8 @@ metadata:
 spec:
   endpointSelector:
     matchLabels:
-      name: {{ .Values.name }}
+      k8s:io.kubernetes.pod.namespace: chaos-testing
+      policy: enabled
   egress:
   - toEndpoints:
     - matchLabels:

And then if we set "policy: enabled" label on every monkey that has a policy associated with it, then only those monkeys will go into default deny because only they will be selected by this policy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.