Home

Awesome

Brigade Noisy Neighbor

build codecov Go Report Card slack

<img width="100" align="left" src="logo.png">

The Brigade Noisy Neighbor component emits events (noise) into a Brigade 2 installation's event bus at a configurable frequency. This is useful for applying load to a Brigade 2 installation for testing purposes or to gain operational insight.

<br clear="left"/>

After installation, subscribe any number of Brigade projects to events emitted by this component -- all of which have a value of brigade.sh/noisy-neighbor in their source field and a value of noise in their type field. In the example project definition below, we subscribe to all such events:

apiVersion: brigade.sh/v2
kind: Project
metadata:
  id: noisy-ned
description: Noisy Ned subscribes to events from the Brigade Noisy Neighbor!
spec:
  eventSubscriptions:
  - source: brigade.sh/noisy-neighbor
    types:
    - noise
  workerTemplate:
    defaultConfigFiles:
      brigade.js: | 
        const { events, Job } = require("@brigadecore/brigadier");

        events.on("brigade.sh/noisy-neighbor", "noise", async event => {
          let job = new Job("sleep", "debian:latest", event);
          job.primaryContainer.command = ["sleep"];
          job.primaryContainer.arguments = ["5"];
          await job.run();
        });

        events.process();

Assuming this file were named project.yaml, you can create the project like so:

$ brig project create --file project.yaml

⚠️  Projects always receive discrete copies of each event they are subscribed to, so be mindful that no matter the frequency on which the Noisy Neighbor is configured to emit events, the total volume of events will also be dependent on the number of subscribers. If this component emits an event once every five seconds, but two projects subscribe to them, you'll effectively be receiving two events every five seconds.

After allowing sufficient time to pass for new events to have been emitted by the Noisy Neighbor, list the events for the noisy-ned project to confirm you have subscribed correctly:

$ brig event list --project noisy-ned

Full coverage of brig commands is beyond the scope of this documentation, but at this point, additional brig commands can be applied to monitor and manage the events.

Contributing

The Brigade project accepts contributions via GitHub pull requests. The Contributing document outlines the process to help get your contribution accepted.

Support & Feedback

We have a slack channel! Kubernetes/#brigade Feel free to join for any support questions or feedback, we are happy to help. To report an issue or to request a feature open an issue here

Code of Conduct

Participation in the Brigade project is governed by the CNCF Code of Conduct.