Giter VIP home page Giter VIP logo

hubbub's Introduction

Hubbub

Hubbub is a small application that runs locally inside of a Kubernetes cluster with a given service account and watches a given namespace. If a pod failure is seen (SEGFAULT, Eviction etc..) in the namespace Hubbub is watching it will send a notification containing the information about the pod and container. It has no external dependencies outside of the STDLIB and Kubernetes packages.






Installation and setup

At this time Hubbub is not hosted in any public image repository so you will need to build the image yourself and then deploy it to a kubernetes cluster. The following steps will walk you through that process.

If using slack you will also need a slack webhook. This readme does not go into the specifics for creating one, if you need assistance please see this page.


Build the docker image

Clone this repository by running

 git clone https://github.com/jxmoore/Hubbub`
 cd /Hubbub

Once cloned you will want to create the config file to suite your needs, while there are various options for an MVP approach update the example config found in /docs/exampleConfig1.json . You will want to change the namespace, webhook and slack channel to match your enviroment.

{
	"namespace": "YOUR NAMESPACE",
	"Self": "Hubbub",
	"slack": {
		"webhook": "YOUR WEBHOOK",
		"channel": "#YOUR SLACK CHANNEL"
		}
}

For a run down of all of the configuration options and enviroment variables used by Hubbub please see the config document in this repo. Save this file in the root of /Hubbub and call it config.json. With the json created, we can build the docker image by running the following :

 docker build . -t <repoName>:<versionTag>
 docker push . -t <repoName>:<versionTag>

Deploy to Kubernetes

Once you have pushed the image to a repository you can now deploy it to kubernetes. To do this update the YAML file found in this repository /Hubbub/hubbub.yaml to match your enviroment. You will wnat to put hubbub in the appropriate Namespace, update any enviroment variables you would like to use and ensure that the image points to the one you just pushed :

apiVersion: apps/v1beta1
kind: Deployment
metadata:
   name: hubbub
-  namespace: default
+  namespace: blockChaining
spec:

    ...

        - name: hubbub
-        image: repo:5000/hubbub:0.1
+        image: YOURREPO/hubbub:VERSION
        env:
-        - name: AZMON_COLLECT_ENV
-          value: "FALSE"            
+        - name: HUBBUB_USER
+          value: "Jobo"        

You can change the deployment, clusterRole, binding and service account to however you see fit but :

  • Hubbub requires GET, WATCH and LIST permissions.
  • Hubbub will try to exclude itself from notifications, meaning it wont alert on a pod/container that matches Hubbub. If you change the deployment and container names update the Self config option or set the HUBBUB_SELF enviroment variable.

Once deployed you are off to the races! Hubbub should now be watching the namespace you specified in the config.json file and will alert via a slack message on any container or pod issues :



If you encounter issues running Hubbub please see the troubleshooting document in this repo.

Building locally

If building the application locally do so outside of $GOPATH and ensure that you are using at least go V1.12. Aside from that a simple go build . in the PWD should result in a built binary. However Hubbub uses the InCluster config (this will change in the future), so a built locally binary will do you no good unless your troubleshooting the build or planning on moving it to a container in a cluster.

The supplied dockerfile can be used to build a useable docker image, see Build the docker image above.

Download:

go get github.com/jxmoore/hubbub

If you do not have the go command on your system, you need to Install Go first.


TODO

  • Update GetKubeClient() to allow using a local config for testing outside of a cluster.
  • Implement the LabelSelectors.
  • The 'value' field in the slack post should be exsposed in the config and should take Go templating syntax.
  • More notification types, e.g. SMTP

hubbub's People

Contributors

jxmoore avatar

Watchers

 avatar

hubbub's Issues

role/rolebinding vs. clusterrole/clusterrolebinding

In sample hubbub.yaml, you use the ClusterRole and ClusterRoleBinding.
Given that the hubbub app is running inside a K8s cluster, can I use the
Role / RoleBinding in the yaml for app ?

As a developer, I get assigned a specific K8s cluster to work on. I may not
have permissions to use the ClusterRole and ClusterRoleBinding.

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.