k8s-slackbot

command module
v0.0.0-...-8f5dc51 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 4 Imported by: 0

README

K8S Slackbot

A slack bot built to control kubernetes cluster. based on https://github.com/danielqsj/k8s-slackbot

Image

the build is multi staged the first stage is based on go 1.18 image and builds the artifact

afterwards the next stage copies the artifact and all connecting dynamic libraries to a busybox image total size of the final image: 11 MB

Arguments

  • kubecfg-file (string): Location of kubecfg file for access to kubernetes master service;
  • bot-token (string): Token of slack bot to use
  • debug (boolean): Whether enable debug log

Usage

$ docker build -t k8s-slackbot .
$ docker run -v ~/.kube/config:/etc/kubernetes/kubeconfig k8s-slackbot --kubecfg-file=/etc/kubernetes/kubeconfig --bot-token=$(bot-token)

Then you can talk to your slack bot via slack direct message. there are 2 commands:

  • list - return a list of running pods, their age, and their version
  • logs - takes 2 argument for the pod name and tail limit and return the number of tail logs from the pod

Enjoy it.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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