k8s-mattermost

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2018 License: MIT Imports: 9 Imported by: 0

README

k8s-mattermost

Go Report Card contributions welcome

What is it ?

k8s-mattermost is a bot that connects to a Mattermost channel's websocket and watches for kubectl commands.

By default, you can trigger the bot with !k <namespace> <verb> <ressource> :

!k - get cs  # You can use "-" if ressource doesn't get namespace

!k kube-system get deploy

!k all get pod # You can use "all" to show all namespaces

The configuration is located in the config.toml.dist file (you should rename it to config.toml) :

[general]
bot_name = "k8s-bot"
kubectl_path = "/usr/local/bin/kubectl"

[mattermost]
host = "mattermost.org"
channel_name = "kubernetes"
team_name = "your-team"
user_login = "bot@email.org"
user_password = "averystr0ngpassw0rd"

You can load a different config file using the -c flag.

How can you run it ?

You can fetch the latest build for Linux with :

wget https://github.com/valentin2105/k8s-mattermost/releases/download/v0.1.0/k8s-mattermost
chmod +x k8s-mattermost 
./k8s-mattermost -c config.toml

Or build it from source :

# Install dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

# Clone repo
mkdir -p $GOPATH/src/github.com/valentin2105/ && cd $GOPATH/src/github.com/valentin2105/
git clone git@github.com:valentin2105/k8s-mattermost.git && cd k8s-mattermost 

# Install dependencies
dep ensure

# Build
go build
Screenshot

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL