You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2022. It is now read-only.
⚠️ This repo contains the source for a component of the Brigade
v1.x ecosystem. Brigade v1.x reached end-of-life on June 1, 2022 and as a
result, this component is no longer maintained.
Brigade Kubernetes Gateway
Experimental: This should not be used in production. Misconfiguration can
consume massive amounts of cluster resources.
This is a Brigade gateway that listens to the Kubernetes event stream and triggers
events inside of Brigade.
You must have the Go toolchain, make, and dep installed. For Docker support, you
will need to have Docker installed as well. From there:
$ make build
To build a Docker image, you can make docker-build.
Configuring
Configuring the gateway is tricky: You don't want to cause a build to trigger
another build. In your Helm values.yaml file you will want to configure your
filters appropriately.
Here is an example that listens to Pod events that occur in the namespace
pequod.
filters:
# Ignore all events coming from kube-system
- namespace: kube-systemaction: reject# Ignore events on Nodes. We just care about Pods
- kind: Nodeaction: reject# Ignore "Killing" messages for Pods
- kind: Podreasons:
- Killingaction: reject# ONLY Listen to events for Pods in this namespace
- kind: Podnamespace: pequodaction: accept# Reject anything else (don't DOS yourself)
- action: reject
For example, the following kinds (and more) produce events
Node
Pod
CronJob
Job
Deployment
ReplicaSet
The list of reasons is unconstrained (the value is a string in the Kubernetes
API). But here are a few examples
Node Starting: A node is starting up
Pod Killing: Triggered when a pod has been terminated
ReplicaSet SuccessfulCreate: Triggered when a ReplicaSet has been created
To make it easier to see what the gateway sees, we log the events. You can use
kubectl logs $GATEWAY_POD_NAME to see the data. HEre's an example log entry
for a Pod's Pulled event:
If you are running with RBAC, you will need to write roles and role bindings for
the namespaces you want this service to attach to. The chart includes a role/role
binding for the default namespace. You may use this as a template.
Contributing
This Brigade project accepts contributions via GitHub pull requests. This document outlines the process to help get your contribution accepted.
Signed commits
A DCO sign-off is required for contributions to repos in the brigadecore org. See the documentation in
Brigade's Contributing guide
for how this is done.